Skip to content

Commit

Permalink
fix: Handle log4j2 not being yaml (opensearch-project#110) and chart …
Browse files Browse the repository at this point in the history
…bump. (opensearch-project#123)

* fix: Handle log4j2 not being yaml (opensearch-project#110) and chart bump.


* Including tpl changes


* Adding log4j example.


* Adding some documentation AND updated per comment.s


* Use project name and clarify from/to.


* Explicitly document that config must be YAML multiline strings.


* Cast as string for use with tpl.


* Because this would be really annoying.


* fix: Handle log4j2 not being yaml (opensearch-project#110) and chart bump to 1.4.0.


Co-authored-by: Aaron Layfield <aaron.layfield@gmail.com>
  • Loading branch information
sastorsl and DandyDeveloper committed Nov 10, 2021
1 parent 1e5ff35 commit 133603b
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 5 deletions.
20 changes: 20 additions & 0 deletions charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/ci/ci-rbac-enabled-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/ci/ci-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion charts/opensearch/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{- $root := . }}
{{- if .Values.config }}
apiVersion: v1
kind: ConfigMap
Expand All @@ -8,6 +9,6 @@ metadata:
data:
{{- range $configName, $configYaml := .Values.config }}
{{ $configName }}: |
{{- toYaml $configYaml | nindent 4 }}
{{- tpl $configYaml $root | nindent 4 }}
{{- end -}}
{{- end -}}
15 changes: 14 additions & 1 deletion charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
# <filename>: |
# <formatted-value(s)>
# 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.
Expand Down

0 comments on commit 133603b

Please sign in to comment.