Skip to content

Commit aa0f74d

Browse files
committed
Deploy: updated charts.
1 parent 1c06ce7 commit aa0f74d

14 files changed

+59
-1346
lines changed

deploy/Makefile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ REMOTE_SSH_KEY_ARG = $(if $(strip $(REMOTE_SSH_KEY)),-i $(REMOTE_SSH_KEY),)
1111
HELM_OPENSEARCH_RELEASE ?= cogstack-opensearch
1212
HELM_OPENSEARCH_NAMESPACE ?= cogstack
1313
HELM_OPENSEARCH_CHART ?= ./charts/opensearch
14+
HELM_OPENSEARCH_CONFIG_FILE ?= ../services/elasticsearch/config/opensearch.yml
15+
HELM_OPENSEARCH_LOG4J_FILE ?= ../services/elasticsearch/config/log4j2_opensearch.properties
16+
HELM_DASHBOARDS_CONFIG_FILE ?= ../services/kibana/config/opensearch.yml
1417
HELM_OPENSEARCH_ENV_FILE ?= ./elasticsearch.env
1518
HELM_OPENSEARCH_USERS_ENV_FILE ?= ../security/env/users_elasticsearch.env
1619
HELM_OPENSEARCH_CERTS_ENV_FILE ?= ../security/env/certificates_elasticsearch.env
1720
HELM_OPENSEARCH_SECURITY_DIR ?= ../security/es_roles/opensearch
18-
HELM_OPENSEARCH_SET_FILES = --set-file envFile.raw=$(HELM_OPENSEARCH_ENV_FILE) \
21+
HELM_OPENSEARCH_SET_FILES = --set-file configFiles.opensearchRaw=$(HELM_OPENSEARCH_CONFIG_FILE) \
22+
--set-file configFiles.log4jRaw=$(HELM_OPENSEARCH_LOG4J_FILE) \
23+
--set-file configFiles.dashboardsRaw=$(HELM_DASHBOARDS_CONFIG_FILE) \
24+
--set-file envFile.raw=$(HELM_OPENSEARCH_ENV_FILE) \
1925
--set-file usersEnvFile.raw=$(HELM_OPENSEARCH_USERS_ENV_FILE) \
2026
--set-file certificatesEnvFile.raw=$(HELM_OPENSEARCH_CERTS_ENV_FILE) \
2127
--set-file securityFiles.configRaw=$(HELM_OPENSEARCH_SECURITY_DIR)/config.yml \
@@ -83,10 +89,10 @@ load-env: ## Load variables from export_env_vars.sh in a subshell
8389
show-env: ## Print sorted environment variables after loading export_env_vars.sh
8490
${WITH_ENV} >/dev/null 2>&1; printenv | sort
8591

86-
helm-template-opensearch: ## Render OpenSearch chart using deploy/security env + opensearch role files
92+
helm-template-opensearch: ## Render OpenSearch chart using shared services/security config files
8793
helm template $(HELM_OPENSEARCH_RELEASE) $(HELM_OPENSEARCH_CHART) $(HELM_OPENSEARCH_SET_FILES)
8894

89-
helm-install-opensearch: ## Install/upgrade OpenSearch chart using deploy/security env + opensearch role files
95+
helm-install-opensearch: ## Install/upgrade OpenSearch chart using shared services/security config files
9096
helm upgrade --install $(HELM_OPENSEARCH_RELEASE) $(HELM_OPENSEARCH_CHART) $(HELM_OPENSEARCH_SET_FILES) --namespace $(HELM_OPENSEARCH_NAMESPACE) --create-namespace
9197

9298

deploy/charts/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ This directory contains Helm charts owned by this repository's deployment layer.
1616
```bash
1717
# Render manifests
1818
helm template cogstack-opensearch ./deploy/charts/opensearch \
19+
--set-file configFiles.opensearchRaw=./services/elasticsearch/config/opensearch.yml \
20+
--set-file configFiles.log4jRaw=./services/elasticsearch/config/log4j2_opensearch.properties \
21+
--set-file configFiles.dashboardsRaw=./services/kibana/config/opensearch.yml \
1922
--set-file envFile.raw=./deploy/elasticsearch.env \
2023
--set-file usersEnvFile.raw=./security/env/users_elasticsearch.env \
2124
--set-file certificatesEnvFile.raw=./security/env/certificates_elasticsearch.env \
@@ -26,6 +29,9 @@ helm template cogstack-opensearch ./deploy/charts/opensearch \
2629

2730
# Install/upgrade
2831
helm upgrade --install cogstack-opensearch ./deploy/charts/opensearch \
32+
--set-file configFiles.opensearchRaw=./services/elasticsearch/config/opensearch.yml \
33+
--set-file configFiles.log4jRaw=./services/elasticsearch/config/log4j2_opensearch.properties \
34+
--set-file configFiles.dashboardsRaw=./services/kibana/config/opensearch.yml \
2935
--set-file envFile.raw=./deploy/elasticsearch.env \
3036
--set-file usersEnvFile.raw=./security/env/users_elasticsearch.env \
3137
--set-file certificatesEnvFile.raw=./security/env/certificates_elasticsearch.env \
@@ -36,4 +42,5 @@ helm upgrade --install cogstack-opensearch ./deploy/charts/opensearch \
3642
--namespace cogstack --create-namespace
3743
```
3844

45+
The OpenSearch and Dashboards config files should come from `services/`, and the security files from `security/`, so Docker and Kubernetes use the same source files.
3946
Only keys in `envFile.includeKeys` and `usersEnvFile.includeKeys` are imported.

deploy/charts/opensearch/README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ Secret keys are mapped via:
3838

3939
```bash
4040
helm upgrade --install cogstack-opensearch ./deploy/charts/opensearch \
41+
--set-file configFiles.opensearchRaw=./services/elasticsearch/config/opensearch.yml \
42+
--set-file configFiles.log4jRaw=./services/elasticsearch/config/log4j2_opensearch.properties \
43+
--set-file configFiles.dashboardsRaw=./services/kibana/config/opensearch.yml \
4144
--set-file envFile.raw=./deploy/elasticsearch.env \
4245
--set-file usersEnvFile.raw=./security/env/users_elasticsearch.env \
4346
--set-file certificatesEnvFile.raw=./security/env/certificates_elasticsearch.env \
@@ -64,6 +67,9 @@ helm upgrade --install cogstack-dashboards ./deploy/charts/opensearch \
6467

6568
```bash
6669
helm template cogstack-opensearch ./deploy/charts/opensearch \
70+
--set-file configFiles.opensearchRaw=./services/elasticsearch/config/opensearch.yml \
71+
--set-file configFiles.log4jRaw=./services/elasticsearch/config/log4j2_opensearch.properties \
72+
--set-file configFiles.dashboardsRaw=./services/kibana/config/opensearch.yml \
6773
--set-file envFile.raw=./deploy/elasticsearch.env \
6874
--set-file usersEnvFile.raw=./security/env/users_elasticsearch.env \
6975
--set-file certificatesEnvFile.raw=./security/env/certificates_elasticsearch.env \
@@ -75,10 +81,16 @@ helm template cogstack-opensearch ./deploy/charts/opensearch \
7581

7682
## Notes
7783

78-
- The chart packages current repository config files under `files/`.
84+
- Helm templates cannot read arbitrary `../../...` paths directly; `.Files.Get` only sees files packaged inside the chart.
85+
- In this repo, the chart `files/` entries are symlinked to the shared `services/` and `security/` sources so Docker and Kubernetes stay aligned.
86+
- The standard install/render commands still use `--set-file` explicitly to make the source-of-truth paths obvious at invocation time.
87+
- If you run Helm from `deploy/charts/opensearch`, the equivalent relative paths are `../../../services/...` and `../../../security/...`.
7988
- `envFile.raw` can be set from `deploy/elasticsearch.env` and is loaded via `envFrom` into OpenSearch and Dashboards.
8089
- `usersEnvFile.raw` can be set from `security/env/users_elasticsearch.env` and feeds the credentials Secret (`OPENSEARCH_INITIAL_ADMIN_PASSWORD`, `KIBANA_USER`, `KIBANA_PASSWORD`).
8190
- `certificatesEnvFile.raw` can be set from `security/env/certificates_elasticsearch.env`; currently `ES_CLIENT_CERT_NAME` is used to resolve Dashboards cert secret keys (`<name>.pem` / `<name>.key`).
91+
- `configFiles.opensearchRaw` can be set from `services/elasticsearch/config/opensearch.yml`.
92+
- `configFiles.log4jRaw` can be set from `services/elasticsearch/config/log4j2_opensearch.properties`.
93+
- `configFiles.dashboardsRaw` can be set from `services/kibana/config/opensearch.yml`.
8294
- `securityFiles.*Raw` can be set from `security/es_roles/opensearch/*.yml` and overrides the chart-bundled OpenSearch security files.
8395
- Only keys listed in `envFile.includeKeys` are imported (to avoid leaking secrets from env files into ConfigMaps).
8496
- Review security and certificate settings before production use.

deploy/charts/opensearch/files/log4j2.properties

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../services/elasticsearch/config/log4j2_opensearch.properties

deploy/charts/opensearch/files/opensearch-security/config.yml

Lines changed: 0 additions & 265 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../security/es_roles/opensearch/config.yml

0 commit comments

Comments
 (0)