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

added missing secrets on statefulset template #272

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
---
## [Unreleased]
### Added
- Updated StatefulSet with node_dn.yml and whitelist.yml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind seeing the PR(s) before on updating the CHANGELOG?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, Do you want me to remove this from the current PR and submit a different one?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

### Changed
### Deprecated
### Removed
Expand Down
4 changes: 3 additions & 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.0.1
version: 2.0.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 All @@ -30,3 +30,5 @@ maintainers:
- name: peterzhuamazon
- name: prudhvigodithi
- name: TheAlgo
- name: phijojo
Copy link
Member

@bbarani bbarani Jun 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We wont be able to add you as a maintainer without going through the nomination process. Please refer to at maintainers.md guide to understand the process to become a maintainer.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, thanks for sharing the document. I have removed my name from the maintainer's list.


26 changes: 23 additions & 3 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,16 @@ spec:
secret:
secretName: {{ .Values.securityConfig.tenantsSecret }}
{{- end }}
{{- if .Values.securityConfig.nodesDnSecret }}
- name: nodes-dn
secret:
secretName: {{ .Values.securityConfig.nodesDnSecret }}
{{- end }}
{{- if .Values.securityConfig.whitelistSecret }}
- name: whitelist
secret:
secretName: {{ .Values.securityConfig.whitelistSecret }}
{{- end }}
Comment on lines +198 to +202
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be.
I have used 2.0.0 image, in which the securityadmin.sh doesn't check for allowlist.yml instead it's still using whitelist.yml.So I guess securityadmin.sh need a change before we use allowlist.yml.

{{- if .Values.keystore }}
- name: keystore
emptyDir: {}
Expand Down Expand Up @@ -226,7 +236,7 @@ spec:
- 'chown -R 1000:1000 /usr/share/opensearch/data'
securityContext:
runAsUser: 0
resources:
resources:
{{ toYaml .Values.initResources | nindent 10 }}
volumeMounts:
- name: "{{ template "opensearch.uname" . }}"
Expand Down Expand Up @@ -260,7 +270,7 @@ spec:
cp -a {{ .Values.opensearchHome }}/config/opensearch.keystore /tmp/keystore/
env: {{ toYaml .Values.extraEnvs | nindent 10 }}
envFrom: {{ toYaml .Values.envFrom | nindent 10 }}
resources:
resources:
{{ toYaml .Values.initResources | nindent 10 }}
volumeMounts:
- name: keystore
Expand Down Expand Up @@ -375,6 +385,16 @@ spec:
name: tenants
subPath: tenants.yml
{{- end }}
{{- if .Values.securityConfig.whitelistSecret }}
- mountPath: {{ .Values.securityConfig.path }}/whitelist.yml
name: whitelist
subPath: whitelist.yml
{{- end }}
Comment on lines +388 to +392
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it should be.
I have used 2.0.0 image, in which the securityadmin.sh doesn't check for allowlist.yml instead it's still using whitelist.yml.So I guess securityadmin.sh need a change before we use allowlist.yml.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DandyDeveloper @prudhvigodithi @TheAlgo

I think it's a bug in securityadmin.sh. I have added a ticket for that opensearch-project/security#1879

I'll change whitelist.yml to allowlist.yml on this PR and will create another PR for 1.x.x to handle the whitelist.yml

{{- if .Values.securityConfig.nodesDnSecret }}
- mountPath: {{ .Values.securityConfig.path }}/nodes_dn.yml
name: nodes-dn
subPath: nodes_dn.yml
{{- end }}
{{- if .Values.securityConfig.config.data }}
{{- if .Values.securityConfig.config.dataComplete }}
- mountPath: {{ .Values.securityConfig.path }}
Expand Down Expand Up @@ -483,4 +503,4 @@ spec:
{{- else }}
{{ toYaml .Values.extraContainers | indent 6 }}
{{- end }}
{{- end }}
{{- end }}
2 changes: 2 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ securityConfig:
rolesSecret:
rolesMappingSecret:
tenantsSecret:
nodesDnSecret:
whitelistSecret:
# The following option simplifies securityConfig by using a single secret and
# specifying the config files as keys in the secret instead of creating
# different secrets for for each config file.
Expand Down