Skip to content

Commit

Permalink
Backport 0276f54 (#313)
Browse files Browse the repository at this point in the history
Signed-off-by: prudhvigodithi <[email protected]>

Signed-off-by: prudhvigodithi <[email protected]>
Co-authored-by: Henning <[email protected]>
  • Loading branch information
prudhvigodithi and hensur authored Aug 26, 2022
1 parent 2e27c3e commit 7a0f31b
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
14 changes: 12 additions & 2 deletions charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security

---
## [1.13.2]
### Added
- Add "singleNode" feature to disable the "cluster.initial_master_nodes" env var.
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.13.1]
### Added
Expand Down Expand Up @@ -457,7 +466,8 @@ config:
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.1...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.2...HEAD
[1.13.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.1...opensearch-1.13.2
[1.13.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.0...opensearch-1.13.1
[1.13.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.12.1...opensearch-1.13.0
[1.12.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.12.0...opensearch-1.12.1
Expand Down Expand Up @@ -503,4 +513,4 @@ config:
[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-1.0.1...opensearch-1.0.2
[1.0.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.1...opensearch-1.0.2
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.13.1
version: 1.13.2

# 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
1 change: 1 addition & 0 deletions charts/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ helm uninstall my-release
| `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 list of the specific node [roles][] for the `nodeGroup` | see [values.yaml][] |
| `singleNode` | If `discovery.type` in the opensearch configuration is set to `"single-node"`, this should be set to `true`. If `true`, replicas will be forced to `1`. | `false` |
| `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][] details. | By default an insecure demonstration configuration is set. This **must** be changed before going to production. |
Expand Down
12 changes: 10 additions & 2 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ spec:
selector:
matchLabels:
{{- include "opensearch.selectorLabels" . | nindent 6 }}
{{- if .Values.singleNode }}
replicas: 1
{{- else }}
replicas: {{ .Values.replicas }}
{{- end }}
podManagementPolicy: {{ .Values.podManagementPolicy }}
updateStrategy:
type: {{ .Values.updateStrategy }}
Expand Down Expand Up @@ -320,7 +324,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.name
{{- if has "master" .Values.roles }}
{{- if (and (has "master" .Values.roles) (not .Values.singleNode)) }}
- name: cluster.initial_master_nodes
value: "{{ template "opensearch.endpoints" . }}"
{{- end }}
Expand All @@ -334,6 +338,10 @@ spec:
value: "{{ .Values.opensearchJavaOpts }}"
- name: node.roles
value: "{{ template "opensearch.roles" . }}"
{{- if .Values.singleNode }}
- name: discovery.type
value: "single-node"
{{- end }}
{{- if .Values.extraEnvs }}
{{ toYaml .Values.extraEnvs | indent 8 }}
{{- end }}
Expand Down Expand Up @@ -490,4 +498,4 @@ spec:
{{- else }}
{{ toYaml .Values.extraContainers | indent 6 }}
{{- end }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
clusterName: "opensearch-cluster"
nodeGroup: "master"

# If discovery.type in the opensearch configuration is set to "single-node",
# this should be set to "true"
# If "true", replicas will be forced to 1
singleNode: false

# The service that non master groups will try to connect to when joining the cluster
# This should be set to clusterName + "-" + nodeGroup for your master group
masterService: "opensearch-cluster-master"
Expand Down Expand Up @@ -47,6 +52,7 @@ config:
network.host: 0.0.0.0
# Setting network.host to a non-loopback address enables the annoying bootstrap checks. "Single-node" mode disables them again.
# Implicitly done if ".singleNode" is set to "true".
# discovery.type: single-node
# Start OpenSearch Security Demo Configuration
Expand Down

0 comments on commit 7a0f31b

Please sign in to comment.