Skip to content

Commit

Permalink
Fix deprication warnings about node.roles. Now roles described as a l…
Browse files Browse the repository at this point in the history
…ist (#124)

Signed-off-by: Sebor <[email protected]>
  • Loading branch information
Sebor authored Nov 9, 2021
1 parent 2ace731 commit d45f215
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 15 deletions.
9 changes: 9 additions & 0 deletions charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.3.0]
### Added
### Changed
- Rework deprecated node roles definition. Now in `values.yaml` roles are described as a list and there are no any deprecation warnings in logs.
### Deprecated
### Removed
### Fixed
### Security
---
## [1.2.4]
### Added
### Changed
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.2.5
version: 1.3.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/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ helm uninstall my-release
| `rbac` | Configuration for creating a role, role binding and ServiceAccount as part of this Helm chart with `create: true`. Also can be used to reference an external ServiceAccount with `serviceAccountName: "externalServiceAccountName"` | see [values.yaml][] |
| `replicas` | Kubernetes replica count for the StatefulSet (i.e. how many pods) | `3` |
| `resources` | Allows you to set the [resources][] for the StatefulSet | see [values.yaml][] |
| `roles` | A hash map with the specific [roles][] for the `nodeGroup` | see [values.yaml][] |
| `roles` | A list of the specific node [roles][] for the `nodeGroup` | see [values.yaml][] |
| `schedulerName` | Name of the [alternate scheduler][] | `""` |
| `secretMounts` | Allows you easily mount a secret as a file inside the StatefulSet. Useful for mounting certificates and other secrets. See [values.yaml][] for an example | `[]` |
| `securityConfig` | Configure the opensearch security plugin. There are multiple ways to inject configuration into the chart, see [values.yaml](https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml) details. | By default an insecure demonstration configuration is set. This **must** be changed before going to production. |
Expand Down
8 changes: 4 additions & 4 deletions charts/opensearch/ci/ci-rbac-enabled-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ masterService: "opensearch-cluster-master"
# OpenSearch roles that will be applied to this nodeGroup
# These will be set as environment variables. E.g. node.master=true
roles:
master: "true"
ingest: "true"
data: "true"
remote_cluster_client: "true"
- master
- ingest
- data
- remote_cluster_client

replicas: 1
minimumMasterNodes: 1
Expand Down
8 changes: 4 additions & 4 deletions charts/opensearch/ci/ci-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ masterService: "opensearch-cluster-master"
# OpenSearch roles that will be applied to this nodeGroup
# These will be set as environment variables. E.g. node.master=true
roles:
master: "true"
ingest: "true"
data: "true"
remote_cluster_client: "true"
- master
- ingest
- data
- remote_cluster_client

replicas: 1
minimumMasterNodes: 1
Expand Down
6 changes: 6 additions & 0 deletions charts/opensearch/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,9 @@ app.kubernetes.io/instance: {{ .Release.Name }}
{{- .Values.global.dockerRegistry | trimSuffix "/" | printf "%s/" -}}
{{- end -}}
{{- end -}}

{{- define "opensearch.roles" -}}
{{- range $.Values.roles -}}
{{ . }},
{{- end -}}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if eq .Values.roles.master "true" }}
{{- if has "master" .Values.roles }}
- name: cluster.initial_master_nodes
value: "{{ template "opensearch.endpoints" . }}"
{{- end }}
Expand Down
8 changes: 4 additions & 4 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ masterService: "opensearch-cluster-master"
# OpenSearch roles that will be applied to this nodeGroup
# These will be set as environment variables. E.g. node.master=true
roles:
master: "true"
ingest: "true"
data: "true"
remote_cluster_client: "true"
- master
- ingest
- data
- remote_cluster_client

replicas: 3
minimumMasterNodes: 1
Expand Down

0 comments on commit d45f215

Please sign in to comment.