Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the initContainers parameter securityContext to be configurable. #501

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
---
## [2.17.1]
### Added
### Changed
- Fix the initContainers parameter securityContext to be configurable.
### Deprecated
### Removed
### Fixed
### Security
---
## [2.17.0]
### Added
- Updated OpenSearch appVersion to 2.11.1
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: 2.17.0
version: 2.18.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
5 changes: 2 additions & 3 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ spec:
args:
- 'chown -R 1000:1000 /usr/share/opensearch/data'
securityContext:
runAsUser: 0
{{- toYaml .Values.persistence.securityContext | nindent 10 }}
resources:
{{- toYaml .Values.initResources | nindent 10 }}
volumeMounts:
Expand All @@ -261,8 +261,7 @@ spec:
sysctl -w vm.max_map_count=$DESIRED
fi
securityContext:
runAsUser: 0
privileged: true
{{- toYaml .Values.sysctlInit.securityContext | nindent 10 }}
resources:
{{- toYaml .Values.initResources | nindent 10 }}
{{- end }}
Expand Down
11 changes: 11 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,11 @@ persistence:
- ReadWriteOnce
size: 8Gi
annotations: {}
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
##
securityContext:
runAsUser: 0

extraVolumes: []
# - name: extras
Expand Down Expand Up @@ -467,6 +472,12 @@ sysctlInit:
# image: busybox
# override image tag, which is latest by default
# imageTag:
## Configure Pods Security Context
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
##
securityContext:
runAsUser: 0
privileged: true

## Enable to add 3rd Party / Custom plugins not offered in the default OpenSearch image.
plugins:
Expand Down
Loading