add opensearch addons
3
opensearch-coord1/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-coord1/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Node: os-coord-1 roles:['coordinating_only'] heap:2g http:9203 transport:9303
|
98
opensearch-coord1/config.json
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch os-coord-1",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-coord1",
|
||||||
|
"description": "OpenSearch server (es-compatible) for logs and metrics. Configurable JVM heap, node roles, cluster discovery and volumes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"host_pid": false,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"data",
|
||||||
|
"/var/lib/opensearch",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cluster_name": "hass-opensearch-cluster",
|
||||||
|
"node_name": "os-coord-1",
|
||||||
|
"node_roles": [
|
||||||
|
"coordinating_only"
|
||||||
|
],
|
||||||
|
"discovery_type": "single-node",
|
||||||
|
"discovery_seed_hosts": [],
|
||||||
|
"initial_master_nodes": [],
|
||||||
|
"opensearch_heap": "2g",
|
||||||
|
"plugins": [],
|
||||||
|
"bootstrap_memory_lock": false,
|
||||||
|
"http_port": 9203,
|
||||||
|
"transport_port": 9303,
|
||||||
|
"network_host": "0.0.0.0",
|
||||||
|
"path_data": "/var/lib/opensearch",
|
||||||
|
"path_logs": "/var/log/opensearch",
|
||||||
|
"security_enabled": false
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"cluster_name": "str",
|
||||||
|
"node_name": "str",
|
||||||
|
"node_roles": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_type": [
|
||||||
|
"str",
|
||||||
|
[
|
||||||
|
"single-node",
|
||||||
|
"zen",
|
||||||
|
"dns",
|
||||||
|
"ec2"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_seed_hosts": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"initial_master_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"opensearch_heap": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"bootstrap_memory_lock": "bool",
|
||||||
|
"http_port": "int",
|
||||||
|
"transport_port": "int",
|
||||||
|
"network_host": "str",
|
||||||
|
"path_data": "str",
|
||||||
|
"path_logs": "str",
|
||||||
|
"security_enabled": "bool"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9203/tcp": 9203,
|
||||||
|
"9303/tcp": 9303
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"OPENSEARCH_JAVA_OPTS": "-Xms${options[opensearch_heap]} -Xmx${options[opensearch_heap]}"
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-coord1/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-coord1/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
14
opensearch-coord1/rootfs/etc/cont-init.d/10-copy-config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
SRC_DIR=/rootfs-config
|
||||||
|
DST_DIR=/usr/share/opensearch/config
|
||||||
|
if [ -d "$SRC_DIR" ]; then
|
||||||
|
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
|
||||||
|
for f in "$SRC_DIR"/*; do
|
||||||
|
base=$(basename "$f")
|
||||||
|
if [ ! -f "$DST_DIR/$base" ]; then
|
||||||
|
cp "$f" "$DST_DIR/"
|
||||||
|
echo "[cont-init] Copied $base"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
20
opensearch-coord1/rootfs/etc/cont-init.d/20-install-plugins
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing plugin: $plugin"
|
||||||
|
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
|
||||||
|
echo "[cont-init] Installed $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,33 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json || true
|
||||||
|
NODE_NAME="os-coord-1"
|
||||||
|
HEAP="2g"
|
||||||
|
CLUSTER_NAME="hass-opensearch-cluster"
|
||||||
|
HTTP_PORT=9203
|
||||||
|
TRANSPORT_PORT=9303
|
||||||
|
NODE_ROLES="coordinating_only"
|
||||||
|
|
||||||
|
# override from options.json if present
|
||||||
|
if [ -f "$OPTIONS_FILE" ]; then
|
||||||
|
NODE_NAME=$(jq -r '.node_name // "os-coord-1"' "$OPTIONS_FILE" 2>/dev/null || echo "os-coord-1")
|
||||||
|
HEAP=$(jq -r '.opensearch_heap // "2g"' "$OPTIONS_FILE" 2>/dev/null || echo "2g")
|
||||||
|
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||||
|
HTTP_PORT=$(jq -r '.http_port // 9203' "$OPTIONS_FILE" 2>/dev/null || echo 9203)
|
||||||
|
TRANSPORT_PORT=$(jq -r '.transport_port // 9303' "$OPTIONS_FILE" 2>/dev/null || echo 9303)
|
||||||
|
NODE_ROLES=$(jq -r '.node_roles // ["coordinating_only"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "coordinating_only")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENSEARCH_JAVA_OPTS="-Xms$2g -Xmx$2g"
|
||||||
|
|
||||||
|
echo "[s6-run] Starting OpenSearch node: $os-coord-1 roles:$coordinating_only heap:$2g http:$9203 transport:$9303"
|
||||||
|
|
||||||
|
exec /usr/share/opensearch/bin/opensearch \
|
||||||
|
-E cluster.name=$hass-opensearch-cluster \
|
||||||
|
-E node.name=$os-coord-1 \
|
||||||
|
-E node.roles=[$coordinating_only] \
|
||||||
|
-E http.port=$9203 \
|
||||||
|
-E transport.port=$9303 \
|
||||||
|
-E network.host=0.0.0.0 \
|
||||||
|
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||||
|
-E cluster.initial_master_nodes=os-master
|
8
opensearch-coord1/rootfs/rootfs-config/opensearch.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
cluster.name: hass-opensearch-cluster
|
||||||
|
node.name: os-coord-1
|
||||||
|
path.data: /var/lib/opensearch
|
||||||
|
path.logs: /var/log/opensearch
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
http.port: 9203
|
||||||
|
transport.port: 9303
|
||||||
|
node.roles: ['coordinating_only']
|
3
opensearch-coord2/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-coord2/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Node: os-coord-2 roles:['coordinating_only'] heap:2g http:9204 transport:9304
|
98
opensearch-coord2/config.json
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch os-coord-2",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-coord2",
|
||||||
|
"description": "OpenSearch server (es-compatible) for logs and metrics. Configurable JVM heap, node roles, cluster discovery and volumes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"host_pid": false,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"data",
|
||||||
|
"/var/lib/opensearch",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cluster_name": "hass-opensearch-cluster",
|
||||||
|
"node_name": "os-coord-2",
|
||||||
|
"node_roles": [
|
||||||
|
"coordinating_only"
|
||||||
|
],
|
||||||
|
"discovery_type": "single-node",
|
||||||
|
"discovery_seed_hosts": [],
|
||||||
|
"initial_master_nodes": [],
|
||||||
|
"opensearch_heap": "2g",
|
||||||
|
"plugins": [],
|
||||||
|
"bootstrap_memory_lock": false,
|
||||||
|
"http_port": 9204,
|
||||||
|
"transport_port": 9304,
|
||||||
|
"network_host": "0.0.0.0",
|
||||||
|
"path_data": "/var/lib/opensearch",
|
||||||
|
"path_logs": "/var/log/opensearch",
|
||||||
|
"security_enabled": false
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"cluster_name": "str",
|
||||||
|
"node_name": "str",
|
||||||
|
"node_roles": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_type": [
|
||||||
|
"str",
|
||||||
|
[
|
||||||
|
"single-node",
|
||||||
|
"zen",
|
||||||
|
"dns",
|
||||||
|
"ec2"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_seed_hosts": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"initial_master_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"opensearch_heap": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"bootstrap_memory_lock": "bool",
|
||||||
|
"http_port": "int",
|
||||||
|
"transport_port": "int",
|
||||||
|
"network_host": "str",
|
||||||
|
"path_data": "str",
|
||||||
|
"path_logs": "str",
|
||||||
|
"security_enabled": "bool"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9204/tcp": 9204,
|
||||||
|
"9304/tcp": 9304
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"OPENSEARCH_JAVA_OPTS": "-Xms${options[opensearch_heap]} -Xmx${options[opensearch_heap]}"
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-coord2/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-coord2/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
14
opensearch-coord2/rootfs/etc/cont-init.d/10-copy-config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
SRC_DIR=/rootfs-config
|
||||||
|
DST_DIR=/usr/share/opensearch/config
|
||||||
|
if [ -d "$SRC_DIR" ]; then
|
||||||
|
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
|
||||||
|
for f in "$SRC_DIR"/*; do
|
||||||
|
base=$(basename "$f")
|
||||||
|
if [ ! -f "$DST_DIR/$base" ]; then
|
||||||
|
cp "$f" "$DST_DIR/"
|
||||||
|
echo "[cont-init] Copied $base"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
20
opensearch-coord2/rootfs/etc/cont-init.d/20-install-plugins
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing plugin: $plugin"
|
||||||
|
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
|
||||||
|
echo "[cont-init] Installed $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,33 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json || true
|
||||||
|
NODE_NAME="os-coord-2"
|
||||||
|
HEAP="2g"
|
||||||
|
CLUSTER_NAME="hass-opensearch-cluster"
|
||||||
|
HTTP_PORT=9204
|
||||||
|
TRANSPORT_PORT=9304
|
||||||
|
NODE_ROLES="coordinating_only"
|
||||||
|
|
||||||
|
# override from options.json if present
|
||||||
|
if [ -f "$OPTIONS_FILE" ]; then
|
||||||
|
NODE_NAME=$(jq -r '.node_name // "os-coord-2"' "$OPTIONS_FILE" 2>/dev/null || echo "os-coord-2")
|
||||||
|
HEAP=$(jq -r '.opensearch_heap // "2g"' "$OPTIONS_FILE" 2>/dev/null || echo "2g")
|
||||||
|
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||||
|
HTTP_PORT=$(jq -r '.http_port // 9204' "$OPTIONS_FILE" 2>/dev/null || echo 9204)
|
||||||
|
TRANSPORT_PORT=$(jq -r '.transport_port // 9304' "$OPTIONS_FILE" 2>/dev/null || echo 9304)
|
||||||
|
NODE_ROLES=$(jq -r '.node_roles // ["coordinating_only"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "coordinating_only")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENSEARCH_JAVA_OPTS="-Xms$2g -Xmx$2g"
|
||||||
|
|
||||||
|
echo "[s6-run] Starting OpenSearch node: $os-coord-2 roles:$coordinating_only heap:$2g http:$9204 transport:$9304"
|
||||||
|
|
||||||
|
exec /usr/share/opensearch/bin/opensearch \
|
||||||
|
-E cluster.name=$hass-opensearch-cluster \
|
||||||
|
-E node.name=$os-coord-2 \
|
||||||
|
-E node.roles=[$coordinating_only] \
|
||||||
|
-E http.port=$9204 \
|
||||||
|
-E transport.port=$9304 \
|
||||||
|
-E network.host=0.0.0.0 \
|
||||||
|
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||||
|
-E cluster.initial_master_nodes=os-master
|
8
opensearch-coord2/rootfs/rootfs-config/opensearch.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
cluster.name: hass-opensearch-cluster
|
||||||
|
node.name: os-coord-2
|
||||||
|
path.data: /var/lib/opensearch
|
||||||
|
path.logs: /var/log/opensearch
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
http.port: 9204
|
||||||
|
transport.port: 9304
|
||||||
|
node.roles: ['coordinating_only']
|
3
opensearch-dashboards/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch-dashboards:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-dashboards/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
OpenSearch Dashboards add-on. Point opensearch_host to coordinator nodes or a load balancer.
|
47
opensearch-dashboards/config.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch Dashboards",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-dashboards",
|
||||||
|
"description": "OpenSearch Dashboards (Kibana compatible) to visualize OpenSearch data.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"opensearch_host": "http://os-coord-1",
|
||||||
|
"opensearch_port": 9203,
|
||||||
|
"dashboards_port": 5601,
|
||||||
|
"opensearch_username": "",
|
||||||
|
"opensearch_password": "",
|
||||||
|
"kibana_index": ".kibana",
|
||||||
|
"plugins": []
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"opensearch_host": "str",
|
||||||
|
"opensearch_port": "int",
|
||||||
|
"dashboards_port": "int",
|
||||||
|
"opensearch_username": "str",
|
||||||
|
"opensearch_password": "str",
|
||||||
|
"kibana_index": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"5601/tcp": 5601
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-dashboards/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-dashboards/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping dashboards plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No dashboards plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing dashboards plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing dashboards plugin: $plugin"
|
||||||
|
if /usr/share/opensearch-dashboards/bin/opensearch-dashboards-plugin install --allow-root "$plugin"; then
|
||||||
|
echo "[cont-init] Installed dashboards plugin $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install dashboards plugin $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,8 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
HOST=$(jq -r '.opensearch_host // "http://localhost"' "$OPTIONS_FILE" 2>/dev/null || echo "http://localhost")
|
||||||
|
PORT=$(jq -r '.opensearch_port // 9200' "$OPTIONS_FILE" 2>/dev/null || echo 9200)
|
||||||
|
OPTS_HOSTS="${HOST}:${PORT}"
|
||||||
|
echo "[s6-run] Starting OpenSearch Dashboards connecting to ${OPTS_HOSTS}"
|
||||||
|
exec /usr/share/opensearch-dashboards/bin/opensearch-dashboards --opensearch.hosts="${OPTS_HOSTS}" --server.host=0.0.0.0
|
@@ -0,0 +1 @@
|
|||||||
|
server.host: 0.0.0.0
|
3
opensearch-data1/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-data1/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Node: os-data-1 roles:['data', 'ingest'] heap:5g http:9201 transport:9301
|
99
opensearch-data1/config.json
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch os-data-1",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-data1",
|
||||||
|
"description": "OpenSearch server (es-compatible) for logs and metrics. Configurable JVM heap, node roles, cluster discovery and volumes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"host_pid": false,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"data",
|
||||||
|
"/var/lib/opensearch",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cluster_name": "hass-opensearch-cluster",
|
||||||
|
"node_name": "os-data-1",
|
||||||
|
"node_roles": [
|
||||||
|
"data",
|
||||||
|
"ingest"
|
||||||
|
],
|
||||||
|
"discovery_type": "single-node",
|
||||||
|
"discovery_seed_hosts": [],
|
||||||
|
"initial_master_nodes": [],
|
||||||
|
"opensearch_heap": "5g",
|
||||||
|
"plugins": [],
|
||||||
|
"bootstrap_memory_lock": false,
|
||||||
|
"http_port": 9201,
|
||||||
|
"transport_port": 9301,
|
||||||
|
"network_host": "0.0.0.0",
|
||||||
|
"path_data": "/var/lib/opensearch",
|
||||||
|
"path_logs": "/var/log/opensearch",
|
||||||
|
"security_enabled": false
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"cluster_name": "str",
|
||||||
|
"node_name": "str",
|
||||||
|
"node_roles": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_type": [
|
||||||
|
"str",
|
||||||
|
[
|
||||||
|
"single-node",
|
||||||
|
"zen",
|
||||||
|
"dns",
|
||||||
|
"ec2"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_seed_hosts": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"initial_master_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"opensearch_heap": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"bootstrap_memory_lock": "bool",
|
||||||
|
"http_port": "int",
|
||||||
|
"transport_port": "int",
|
||||||
|
"network_host": "str",
|
||||||
|
"path_data": "str",
|
||||||
|
"path_logs": "str",
|
||||||
|
"security_enabled": "bool"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9201/tcp": 9201,
|
||||||
|
"9301/tcp": 9301
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"OPENSEARCH_JAVA_OPTS": "-Xms${options[opensearch_heap]} -Xmx${options[opensearch_heap]}"
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-data1/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-data1/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
14
opensearch-data1/rootfs/etc/cont-init.d/10-copy-config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
SRC_DIR=/rootfs-config
|
||||||
|
DST_DIR=/usr/share/opensearch/config
|
||||||
|
if [ -d "$SRC_DIR" ]; then
|
||||||
|
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
|
||||||
|
for f in "$SRC_DIR"/*; do
|
||||||
|
base=$(basename "$f")
|
||||||
|
if [ ! -f "$DST_DIR/$base" ]; then
|
||||||
|
cp "$f" "$DST_DIR/"
|
||||||
|
echo "[cont-init] Copied $base"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
20
opensearch-data1/rootfs/etc/cont-init.d/20-install-plugins
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing plugin: $plugin"
|
||||||
|
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
|
||||||
|
echo "[cont-init] Installed $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,33 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json || true
|
||||||
|
NODE_NAME="os-data-1"
|
||||||
|
HEAP="5g"
|
||||||
|
CLUSTER_NAME="hass-opensearch-cluster"
|
||||||
|
HTTP_PORT=9201
|
||||||
|
TRANSPORT_PORT=9301
|
||||||
|
NODE_ROLES="data,ingest"
|
||||||
|
|
||||||
|
# override from options.json if present
|
||||||
|
if [ -f "$OPTIONS_FILE" ]; then
|
||||||
|
NODE_NAME=$(jq -r '.node_name // "os-data-1"' "$OPTIONS_FILE" 2>/dev/null || echo "os-data-1")
|
||||||
|
HEAP=$(jq -r '.opensearch_heap // "5g"' "$OPTIONS_FILE" 2>/dev/null || echo "5g")
|
||||||
|
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||||
|
HTTP_PORT=$(jq -r '.http_port // 9201' "$OPTIONS_FILE" 2>/dev/null || echo 9201)
|
||||||
|
TRANSPORT_PORT=$(jq -r '.transport_port // 9301' "$OPTIONS_FILE" 2>/dev/null || echo 9301)
|
||||||
|
NODE_ROLES=$(jq -r '.node_roles // ["data,ingest"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "data,ingest")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENSEARCH_JAVA_OPTS="-Xms$5g -Xmx$5g"
|
||||||
|
|
||||||
|
echo "[s6-run] Starting OpenSearch node: $os-data-1 roles:$data,ingest heap:$5g http:$9201 transport:$9301"
|
||||||
|
|
||||||
|
exec /usr/share/opensearch/bin/opensearch \
|
||||||
|
-E cluster.name=$hass-opensearch-cluster \
|
||||||
|
-E node.name=$os-data-1 \
|
||||||
|
-E node.roles=[$data,ingest] \
|
||||||
|
-E http.port=$9201 \
|
||||||
|
-E transport.port=$9301 \
|
||||||
|
-E network.host=0.0.0.0 \
|
||||||
|
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||||
|
-E cluster.initial_master_nodes=os-master
|
8
opensearch-data1/rootfs/rootfs-config/opensearch.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
cluster.name: hass-opensearch-cluster
|
||||||
|
node.name: os-data-1
|
||||||
|
path.data: /var/lib/opensearch
|
||||||
|
path.logs: /var/log/opensearch
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
http.port: 9201
|
||||||
|
transport.port: 9301
|
||||||
|
node.roles: ['data', 'ingest']
|
3
opensearch-data2/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-data2/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Node: os-data-2 roles:['data', 'ingest'] heap:5g http:9202 transport:9302
|
99
opensearch-data2/config.json
Normal file
@@ -0,0 +1,99 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch os-data-2",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-data2",
|
||||||
|
"description": "OpenSearch server (es-compatible) for logs and metrics. Configurable JVM heap, node roles, cluster discovery and volumes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"host_pid": false,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"data",
|
||||||
|
"/var/lib/opensearch",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cluster_name": "hass-opensearch-cluster",
|
||||||
|
"node_name": "os-data-2",
|
||||||
|
"node_roles": [
|
||||||
|
"data",
|
||||||
|
"ingest"
|
||||||
|
],
|
||||||
|
"discovery_type": "single-node",
|
||||||
|
"discovery_seed_hosts": [],
|
||||||
|
"initial_master_nodes": [],
|
||||||
|
"opensearch_heap": "5g",
|
||||||
|
"plugins": [],
|
||||||
|
"bootstrap_memory_lock": false,
|
||||||
|
"http_port": 9202,
|
||||||
|
"transport_port": 9302,
|
||||||
|
"network_host": "0.0.0.0",
|
||||||
|
"path_data": "/var/lib/opensearch",
|
||||||
|
"path_logs": "/var/log/opensearch",
|
||||||
|
"security_enabled": false
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"cluster_name": "str",
|
||||||
|
"node_name": "str",
|
||||||
|
"node_roles": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_type": [
|
||||||
|
"str",
|
||||||
|
[
|
||||||
|
"single-node",
|
||||||
|
"zen",
|
||||||
|
"dns",
|
||||||
|
"ec2"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_seed_hosts": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"initial_master_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"opensearch_heap": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"bootstrap_memory_lock": "bool",
|
||||||
|
"http_port": "int",
|
||||||
|
"transport_port": "int",
|
||||||
|
"network_host": "str",
|
||||||
|
"path_data": "str",
|
||||||
|
"path_logs": "str",
|
||||||
|
"security_enabled": "bool"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9202/tcp": 9202,
|
||||||
|
"9302/tcp": 9302
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"OPENSEARCH_JAVA_OPTS": "-Xms${options[opensearch_heap]} -Xmx${options[opensearch_heap]}"
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-data2/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-data2/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
14
opensearch-data2/rootfs/etc/cont-init.d/10-copy-config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
SRC_DIR=/rootfs-config
|
||||||
|
DST_DIR=/usr/share/opensearch/config
|
||||||
|
if [ -d "$SRC_DIR" ]; then
|
||||||
|
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
|
||||||
|
for f in "$SRC_DIR"/*; do
|
||||||
|
base=$(basename "$f")
|
||||||
|
if [ ! -f "$DST_DIR/$base" ]; then
|
||||||
|
cp "$f" "$DST_DIR/"
|
||||||
|
echo "[cont-init] Copied $base"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
20
opensearch-data2/rootfs/etc/cont-init.d/20-install-plugins
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing plugin: $plugin"
|
||||||
|
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
|
||||||
|
echo "[cont-init] Installed $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,33 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json || true
|
||||||
|
NODE_NAME="os-data-2"
|
||||||
|
HEAP="5g"
|
||||||
|
CLUSTER_NAME="hass-opensearch-cluster"
|
||||||
|
HTTP_PORT=9202
|
||||||
|
TRANSPORT_PORT=9302
|
||||||
|
NODE_ROLES="data,ingest"
|
||||||
|
|
||||||
|
# override from options.json if present
|
||||||
|
if [ -f "$OPTIONS_FILE" ]; then
|
||||||
|
NODE_NAME=$(jq -r '.node_name // "os-data-2"' "$OPTIONS_FILE" 2>/dev/null || echo "os-data-2")
|
||||||
|
HEAP=$(jq -r '.opensearch_heap // "5g"' "$OPTIONS_FILE" 2>/dev/null || echo "5g")
|
||||||
|
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||||
|
HTTP_PORT=$(jq -r '.http_port // 9202' "$OPTIONS_FILE" 2>/dev/null || echo 9202)
|
||||||
|
TRANSPORT_PORT=$(jq -r '.transport_port // 9302' "$OPTIONS_FILE" 2>/dev/null || echo 9302)
|
||||||
|
NODE_ROLES=$(jq -r '.node_roles // ["data,ingest"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "data,ingest")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENSEARCH_JAVA_OPTS="-Xms$5g -Xmx$5g"
|
||||||
|
|
||||||
|
echo "[s6-run] Starting OpenSearch node: $os-data-2 roles:$data,ingest heap:$5g http:$9202 transport:$9302"
|
||||||
|
|
||||||
|
exec /usr/share/opensearch/bin/opensearch \
|
||||||
|
-E cluster.name=$hass-opensearch-cluster \
|
||||||
|
-E node.name=$os-data-2 \
|
||||||
|
-E node.roles=[$data,ingest] \
|
||||||
|
-E http.port=$9202 \
|
||||||
|
-E transport.port=$9302 \
|
||||||
|
-E network.host=0.0.0.0 \
|
||||||
|
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||||
|
-E cluster.initial_master_nodes=os-master
|
8
opensearch-data2/rootfs/rootfs-config/opensearch.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
cluster.name: hass-opensearch-cluster
|
||||||
|
node.name: os-data-2
|
||||||
|
path.data: /var/lib/opensearch
|
||||||
|
path.logs: /var/log/opensearch
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
http.port: 9202
|
||||||
|
transport.port: 9302
|
||||||
|
node.roles: ['data', 'ingest']
|
3
opensearch-master/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=opensearchproject/opensearch:latest
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
1
opensearch-master/README.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Node: os-master roles:['master'] heap:1.5g http:9200 transport:9300
|
98
opensearch-master/config.json
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch os-master",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-master",
|
||||||
|
"description": "OpenSearch server (es-compatible) for logs and metrics. Configurable JVM heap, node roles, cluster discovery and volumes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"host_pid": false,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"data",
|
||||||
|
"/var/lib/opensearch",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"cluster_name": "hass-opensearch-cluster",
|
||||||
|
"node_name": "os-master",
|
||||||
|
"node_roles": [
|
||||||
|
"master"
|
||||||
|
],
|
||||||
|
"discovery_type": "single-node",
|
||||||
|
"discovery_seed_hosts": [],
|
||||||
|
"initial_master_nodes": [],
|
||||||
|
"opensearch_heap": "1.5g",
|
||||||
|
"plugins": [],
|
||||||
|
"bootstrap_memory_lock": false,
|
||||||
|
"http_port": 9200,
|
||||||
|
"transport_port": 9300,
|
||||||
|
"network_host": "0.0.0.0",
|
||||||
|
"path_data": "/var/lib/opensearch",
|
||||||
|
"path_logs": "/var/log/opensearch",
|
||||||
|
"security_enabled": false
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"cluster_name": "str",
|
||||||
|
"node_name": "str",
|
||||||
|
"node_roles": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_type": [
|
||||||
|
"str",
|
||||||
|
[
|
||||||
|
"single-node",
|
||||||
|
"zen",
|
||||||
|
"dns",
|
||||||
|
"ec2"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"discovery_seed_hosts": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"initial_master_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"opensearch_heap": "str",
|
||||||
|
"plugins": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"bootstrap_memory_lock": "bool",
|
||||||
|
"http_port": "int",
|
||||||
|
"transport_port": "int",
|
||||||
|
"network_host": "str",
|
||||||
|
"path_data": "str",
|
||||||
|
"path_logs": "str",
|
||||||
|
"security_enabled": "bool"
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9200/tcp": 9200,
|
||||||
|
"9300/tcp": 9300
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"OPENSEARCH_JAVA_OPTS": "-Xms${options[opensearch_heap]} -Xmx${options[opensearch_heap]}"
|
||||||
|
}
|
||||||
|
}
|
1
opensearch-master/icon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
1
opensearch-master/logo.png
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128"><rect width="128" height="128" rx="16" fill="#0A4A6F"/><text x="50%" y="54%" font-size="36" fill="#fff" text-anchor="middle" font-family="Arial">OS</text></svg>
|
After Width: | Height: | Size: 225 B |
14
opensearch-master/rootfs/etc/cont-init.d/10-copy-config
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
SRC_DIR=/rootfs-config
|
||||||
|
DST_DIR=/usr/share/opensearch/config
|
||||||
|
if [ -d "$SRC_DIR" ]; then
|
||||||
|
echo "[cont-init] Copying config snippets from $SRC_DIR to $DST_DIR"
|
||||||
|
for f in "$SRC_DIR"/*; do
|
||||||
|
base=$(basename "$f")
|
||||||
|
if [ ! -f "$DST_DIR/$base" ]; then
|
||||||
|
cp "$f" "$DST_DIR/"
|
||||||
|
echo "[cont-init] Copied $base"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
20
opensearch-master/rootfs/etc/cont-init.d/20-install-plugins
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json
|
||||||
|
if [ ! -f "$OPTIONS_FILE" ]; then
|
||||||
|
echo "[cont-init] No options.json, skipping plugin install"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
if ! jq -e '.plugins // [] | length > 0' "$OPTIONS_FILE" >/dev/null 2>&1; then
|
||||||
|
echo "[cont-init] No plugins configured, skipping"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
echo "[cont-init] Installing plugins from options.json"
|
||||||
|
jq -r '.plugins[]' "$OPTIONS_FILE" | while read -r plugin; do
|
||||||
|
echo "[cont-init] Installing plugin: $plugin"
|
||||||
|
if /usr/share/opensearch/bin/opensearch-plugin install --batch "$plugin"; then
|
||||||
|
echo "[cont-init] Installed $plugin"
|
||||||
|
else
|
||||||
|
echo "[cont-init] Failed to install $plugin (continuing)"
|
||||||
|
fi
|
||||||
|
done
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,33 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
OPTIONS_FILE=/data/options.json || true
|
||||||
|
NODE_NAME="os-master"
|
||||||
|
HEAP="1.5g"
|
||||||
|
CLUSTER_NAME="hass-opensearch-cluster"
|
||||||
|
HTTP_PORT=9200
|
||||||
|
TRANSPORT_PORT=9300
|
||||||
|
NODE_ROLES="master"
|
||||||
|
|
||||||
|
# override from options.json if present
|
||||||
|
if [ -f "$OPTIONS_FILE" ]; then
|
||||||
|
NODE_NAME=$(jq -r '.node_name // "os-master"' "$OPTIONS_FILE" 2>/dev/null || echo "os-master")
|
||||||
|
HEAP=$(jq -r '.opensearch_heap // "1.5g"' "$OPTIONS_FILE" 2>/dev/null || echo "1.5g")
|
||||||
|
CLUSTER_NAME=$(jq -r '.cluster_name // "hass-opensearch-cluster"' "$OPTIONS_FILE" 2>/dev/null || echo "hass-opensearch-cluster")
|
||||||
|
HTTP_PORT=$(jq -r '.http_port // 9200' "$OPTIONS_FILE" 2>/dev/null || echo 9200)
|
||||||
|
TRANSPORT_PORT=$(jq -r '.transport_port // 9300' "$OPTIONS_FILE" 2>/dev/null || echo 9300)
|
||||||
|
NODE_ROLES=$(jq -r '.node_roles // ["master"] | join(",")' "$OPTIONS_FILE" 2>/dev/null || echo "master")
|
||||||
|
fi
|
||||||
|
|
||||||
|
export OPENSEARCH_JAVA_OPTS="-Xms$1.5g -Xmx$1.5g"
|
||||||
|
|
||||||
|
echo "[s6-run] Starting OpenSearch node: $os-master roles:$master heap:$1.5g http:$9200 transport:$9300"
|
||||||
|
|
||||||
|
exec /usr/share/opensearch/bin/opensearch \
|
||||||
|
-E cluster.name=$hass-opensearch-cluster \
|
||||||
|
-E node.name=$os-master \
|
||||||
|
-E node.roles=[$master] \
|
||||||
|
-E http.port=$9200 \
|
||||||
|
-E transport.port=$9300 \
|
||||||
|
-E network.host=0.0.0.0 \
|
||||||
|
-E discovery.seed_hosts=os-master,os-data-1,os-data-2,os-coord-1,os-coord-2 \
|
||||||
|
-E cluster.initial_master_nodes=os-master
|
8
opensearch-master/rootfs/rootfs-config/opensearch.yml
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
cluster.name: hass-opensearch-cluster
|
||||||
|
node.name: os-master
|
||||||
|
path.data: /var/lib/opensearch
|
||||||
|
path.logs: /var/log/opensearch
|
||||||
|
network.host: 0.0.0.0
|
||||||
|
http.port: 9200
|
||||||
|
transport.port: 9300
|
||||||
|
node.roles: ['master']
|
3
opensearch-nginx-lb/Dockerfile
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
ARG BASE_IMAGE=nginx:stable
|
||||||
|
FROM ${BASE_IMAGE}
|
||||||
|
COPY rootfs/ /
|
40
opensearch-nginx-lb/config.json
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
{
|
||||||
|
"name": "OpenSearch NGINX Load Balancer",
|
||||||
|
"version": "1.0.0",
|
||||||
|
"slug": "opensearch-nginx-lb",
|
||||||
|
"description": "NGINX load balancer for OpenSearch coordinator nodes.",
|
||||||
|
"arch": [
|
||||||
|
"amd64",
|
||||||
|
"armv7",
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"startup": "services",
|
||||||
|
"boot": "auto",
|
||||||
|
"host_network": true,
|
||||||
|
"map": [
|
||||||
|
[
|
||||||
|
"config",
|
||||||
|
"./config",
|
||||||
|
"rw"
|
||||||
|
]
|
||||||
|
],
|
||||||
|
"options": {
|
||||||
|
"lb_port": 9200,
|
||||||
|
"coordinator_nodes": [
|
||||||
|
"os-coord-1",
|
||||||
|
"os-coord-2"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"schema": {
|
||||||
|
"lb_port": "int",
|
||||||
|
"coordinator_nodes": [
|
||||||
|
"list",
|
||||||
|
[
|
||||||
|
"str"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"ports": {
|
||||||
|
"9200/tcp": 9200
|
||||||
|
}
|
||||||
|
}
|
13
opensearch-nginx-lb/rootfs/config/nginx.conf
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
events {}
|
||||||
|
http {
|
||||||
|
upstream opensearch_coord {
|
||||||
|
server os-coord-1:9200;
|
||||||
|
server os-coord-2:9200;
|
||||||
|
}
|
||||||
|
server {
|
||||||
|
listen 9200;
|
||||||
|
location / {
|
||||||
|
proxy_pass http://opensearch_coord;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,3 @@
|
|||||||
|
#!/command/execlineb -S0
|
||||||
|
# Prevent restart loops; allow clean exit
|
||||||
|
exit 0
|
@@ -0,0 +1,4 @@
|
|||||||
|
#!/command/with-contenv bash
|
||||||
|
set -euo pipefail
|
||||||
|
echo "[s6-run] Starting NGINX load balancer"
|
||||||
|
exec nginx -g 'daemon off;'
|