From fb2844ca31833f9ae314a873f5ef79002227c1d4 Mon Sep 17 00:00:00 2001 From: Kersten Schlosser <46895196+erbzn@users.noreply.github.com> Date: Wed, 10 Nov 2021 20:39:52 +0100 Subject: [PATCH 1/3] add values for fsgroup-volume image (#127) * add values for fsgroup-volume image Signed-off-by: Kersten Schlosser * Increment the Chart version and update the Changelog Signed-off-by: Kersten Schlosser * Add version 1.3.1 to CHANGELOG.md Signed-off-by: Kersten Schlosser --- charts/opensearch/CHANGELOG.md | 9 +++++++++ charts/opensearch/Chart.yaml | 2 +- charts/opensearch/templates/statefulset.yaml | 2 +- charts/opensearch/values.yaml | 4 ++++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index 860fe8ab..ddfd6f22 100644 --- a/charts/opensearch/CHANGELOG.md +++ b/charts/opensearch/CHANGELOG.md @@ -13,6 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security --- +## [1.3.1] +### Added +- Added image definition for `fsgroup-volume` initContainer to `values.yaml`. +### Changed +### Deprecated +### Removed +### Fixed +### Security +--- ## [1.3.0] ### Added ### Changed diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index b826ea3b..845c66dd 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.0 +version: 1.3.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/opensearch/templates/statefulset.yaml b/charts/opensearch/templates/statefulset.yaml index 652bb493..3241c6e0 100644 --- a/charts/opensearch/templates/statefulset.yaml +++ b/charts/opensearch/templates/statefulset.yaml @@ -213,7 +213,7 @@ spec: initContainers: {{- if and .Values.persistence.enabled .Values.persistence.enableInitChown }} - name: fsgroup-volume - image: "{{ template "opensearch.dockerRegistry" . }}busybox:latest" + image: "{{ template "opensearch.dockerRegistry" . }}{{ .Values.persistence.image | default "busybox" }}:{{ .Values.persistence.imageTag | default "latest" }}" command: ['sh', '-c'] args: - 'chown -R 1000:1000 /usr/share/opensearch/data' diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index 8ca7595c..ce40f754 100755 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -173,6 +173,10 @@ persistence: enabled: true # Set to false to disable the `fsgroup-volume` initContainer that will update permissions on the persistent disk. enableInitChown: true + # override image, which is busybox by default + # image: busybox + # override image tag, which is latest by default + # imageTag: labels: # Add default labels for the volumeClaimTemplate of the StatefulSet enabled: false From 6d478bf2f6071c8884b52b5fc445508ffc7221a8 Mon Sep 17 00:00:00 2001 From: sastorsl Date: Wed, 10 Nov 2021 21:31:09 +0100 Subject: [PATCH 2/3] fix: Handle log4j2 not being yaml (#110) and chart bump. (#123) * fix: Handle log4j2 not being yaml (#110) and chart bump. Signed-off-by: Stein Arne Storslett * Including tpl changes Signed-off-by: Aaron Layfield * Adding log4j example. Signed-off-by: Aaron Layfield * Adding some documentation AND updated per comment.s Signed-off-by: Aaron Layfield * Use project name and clarify from/to. Signed-off-by: Stein Arne Storslett * Explicitly document that config must be YAML multiline strings. Signed-off-by: Stein Arne Storslett * Cast as string for use with tpl. Signed-off-by: Stein Arne Storslett * Because this would be really annoying. Signed-off-by: Stein Arne Storslett * fix: Handle log4j2 not being yaml (#110) and chart bump to 1.4.0. Signed-off-by: Stein Arne Storslett Co-authored-by: Aaron Layfield --- charts/opensearch/CHANGELOG.md | 20 +++++++++++++++++++ charts/opensearch/Chart.yaml | 2 +- .../opensearch/ci/ci-rbac-enabled-values.yaml | 2 +- charts/opensearch/ci/ci-values.yaml | 2 +- charts/opensearch/templates/configmap.yaml | 3 ++- charts/opensearch/values.yaml | 15 +++++++++++++- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/charts/opensearch/CHANGELOG.md b/charts/opensearch/CHANGELOG.md index ddfd6f22..4d4a49fe 100644 --- a/charts/opensearch/CHANGELOG.md +++ b/charts/opensearch/CHANGELOG.md @@ -13,6 +13,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security --- +## [1.4.0] +### Changed +- Changed support for any kind of configuration type. Including `log4j2.properties` file. Added example. +### BREAKING CHANGE +- `.Values.config` items must now be interpreted as a string. Existing items must now be updated from YAML to string: + +Change from YAML: +```yaml +config: + opensearch.yml: + cluster.name: opensearch-cluster +``` + +Change to YAML multiline string: +```yaml +config: + opensearch.yml: | + cluster.name: opensearch-cluster +``` +--- ## [1.3.1] ### Added - Added image definition for `fsgroup-volume` initContainer to `values.yaml`. diff --git a/charts/opensearch/Chart.yaml b/charts/opensearch/Chart.yaml index 845c66dd..9096dafa 100644 --- a/charts/opensearch/Chart.yaml +++ b/charts/opensearch/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.3.1 +version: 1.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/opensearch/ci/ci-rbac-enabled-values.yaml b/charts/opensearch/ci/ci-rbac-enabled-values.yaml index 0f158351..a41a8c6a 100755 --- a/charts/opensearch/ci/ci-rbac-enabled-values.yaml +++ b/charts/opensearch/ci/ci-rbac-enabled-values.yaml @@ -28,7 +28,7 @@ global: opensearchHome: /usr/share/opensearch # such as opensearch.yml and log4j2.properties config: - opensearch.yml: + opensearch.yml: | cluster.name: opensearch-cluster # Bind to all interfaces because we don't know what IP address Docker will assign to us. diff --git a/charts/opensearch/ci/ci-values.yaml b/charts/opensearch/ci/ci-values.yaml index 483c01f5..b4b39c62 100755 --- a/charts/opensearch/ci/ci-values.yaml +++ b/charts/opensearch/ci/ci-values.yaml @@ -28,7 +28,7 @@ global: opensearchHome: /usr/share/opensearch # such as opensearch.yml and log4j2.properties config: - opensearch.yml: + opensearch.yml: | cluster.name: opensearch-cluster # Bind to all interfaces because we don't know what IP address Docker will assign to us. diff --git a/charts/opensearch/templates/configmap.yaml b/charts/opensearch/templates/configmap.yaml index af50771d..124f44d5 100644 --- a/charts/opensearch/templates/configmap.yaml +++ b/charts/opensearch/templates/configmap.yaml @@ -1,3 +1,4 @@ +{{- $root := . }} {{- if .Values.config }} apiVersion: v1 kind: ConfigMap @@ -8,6 +9,6 @@ metadata: data: {{- range $configName, $configYaml := .Values.config }} {{ $configName }}: | - {{- toYaml $configYaml | nindent 4 }} + {{- tpl $configYaml $root | nindent 4 }} {{- end -}} {{- end -}} diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index ce40f754..d0eedb44 100755 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -28,7 +28,20 @@ global: opensearchHome: /usr/share/opensearch # such as opensearch.yml and log4j2.properties config: - opensearch.yml: + # Values must be YAML literal style scalar / YAML multiline string. + # : | + # + # log4j2.properties: | + # status = error + # + # appender.console.type = Console + # appender.console.name = console + # appender.console.layout.type = PatternLayout + # appender.console.layout.pattern = [%d{ISO8601}][%-5p][%-25c{1.}] [%node_name]%marker %m%n + # + # rootLogger.level = info + # rootLogger.appenderRef.console.ref = console + opensearch.yml: | cluster.name: opensearch-cluster # Bind to all interfaces because we don't know what IP address Docker will assign to us. From 1ef443119509d1d129c7c558d7b5844e3de429db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20BUTET?= Date: Thu, 11 Nov 2021 09:18:03 +0100 Subject: [PATCH 3/3] [Dashboards] Add extraVolumes and extraVolumeMounts (#128) Signed-off-by: remi.butet --- charts/opensearch-dashboards/CHANGELOG.md | 13 +++++++++++- charts/opensearch-dashboards/Chart.yaml | 2 +- .../templates/deployment.yaml | 20 +++++++++++++++++++ charts/opensearch-dashboards/values.yaml | 9 +++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) diff --git a/charts/opensearch-dashboards/CHANGELOG.md b/charts/opensearch-dashboards/CHANGELOG.md index 03c1e2f0..728d489f 100644 --- a/charts/opensearch-dashboards/CHANGELOG.md +++ b/charts/opensearch-dashboards/CHANGELOG.md @@ -12,6 +12,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed ### Fixed ### Security +--- +## [1.0.7] +### Added +- Add `extraVolumes` and `extraVolumeMounts`. +### Changed +### Deprecated +### Removed +### Fixed +### Security + --- ## [1.0.6] ### Added @@ -56,7 +66,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed ### Security -[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.0.5...HEAD +[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.0.6...HEAD +[1.0.6]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.5...opensearch-1.0.6 [1.0.5]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.4...opensearch-1.0.5 [1.0.4]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.2...opensearch-1.0.4 [1.0.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.0.1...opensearch-dashboards-1.0.2 diff --git a/charts/opensearch-dashboards/Chart.yaml b/charts/opensearch-dashboards/Chart.yaml index b59b59d8..caf1a236 100644 --- a/charts/opensearch-dashboards/Chart.yaml +++ b/charts/opensearch-dashboards/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.6 +version: 1.0.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/opensearch-dashboards/templates/deployment.yaml b/charts/opensearch-dashboards/templates/deployment.yaml index c8787b43..f3776a65 100644 --- a/charts/opensearch-dashboards/templates/deployment.yaml +++ b/charts/opensearch-dashboards/templates/deployment.yaml @@ -48,6 +48,16 @@ spec: configMap: name: {{ template "opensearch-dashboards.fullname" . }}-config {{- end }} + {{- if .Values.extraVolumes }} + # Currently some extra blocks accept strings + # to continue with backwards compatibility this is being kept + # whilst also allowing for yaml to be specified too. + {{- if eq "string" (printf "%T" .Values.extraVolumes) }} +{{ tpl .Values.extraVolumes . | indent 8 }} + {{- else }} +{{ toYaml .Values.extraVolumes | indent 8 }} + {{- end }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{ toYaml . | indent 8 }} @@ -146,6 +156,16 @@ spec: mountPath: /usr/share/opensearch-dashboards/config/{{ $path }} subPath: {{ $path }} {{- end }} + {{- if .Values.extraVolumeMounts }} + # Currently some extra blocks accept strings + # to continue with backwards compatibility this is being kept + # whilst also allowing for yaml to be specified too. + {{- if eq "string" (printf "%T" .Values.extraVolumeMounts) }} +{{ tpl .Values.extraVolumeMounts . | indent 10 }} + {{- else }} +{{ toYaml .Values.extraVolumeMounts | indent 10 }} + {{- end }} + {{- end }} {{- if .Values.extraContainers }} # Currently some extra blocks accept strings # to continue with backwards compatibility this is being kept diff --git a/charts/opensearch-dashboards/values.yaml b/charts/opensearch-dashboards/values.yaml index 1cabc792..a678b292 100644 --- a/charts/opensearch-dashboards/values.yaml +++ b/charts/opensearch-dashboards/values.yaml @@ -44,6 +44,15 @@ extraEnvs: [] envFrom: [] +extraVolumes: [] + # - name: extras + # emptyDir: {} + +extraVolumeMounts: [] + # - name: extras + # mountPath: /usr/share/extras + # readOnly: true + extraInitContainers: "" extraContainers: ""