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

Update Helm Chart to Run as Non-Root User in OpenShift #5

Open
wants to merge 1 commit 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
2 changes: 1 addition & 1 deletion charts/presto/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: presto
description: The official Helm chart for Presto
type: application
version: 0.3.0
version: 0.3.1
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
version: 0.3.1
version: 0.3.0

Please, do not bump the chart version, because it triggers the release workflow. Usually we collect few changes for the next release.

Copy link
Author

Choose a reason for hiding this comment

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

@dnskr Thanks for suggestion the changing the path. it is working.

Changes of values.yaml need to commit.

I chose different names for podSecurityContext and securityContext because some properties, such as privileged, only apply at the container level and not at the pod level, ensuring that settings are accurately and appropriately applied.

appVersion: "0.288"
home: https://prestodb.io
icon: https://prestodb.io/docs/current/_static/logo.png
Expand Down
6 changes: 5 additions & 1 deletion charts/presto/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- $affinity := or .Values.coordinator.affinity .Values.affinity }}
{{- $tolerations := or .Values.coordinator.tolerations .Values.tolerations }}
{{- $securityContext := or .Values.coordinator.securityContext .Values.securityContext }}
{{- $podSecurityContext := or .Values.coordinator.podSecurityContext .Values.podSecurityContext }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -51,6 +52,9 @@ spec:
- name: coordinator
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with $securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.coordinator.command }}
command: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -130,6 +134,6 @@ spec:
{{- with $tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $securityContext }}
{{- with $podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/presto/templates/deployment-resource-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
{{- $affinity := or .Values.resourceManager.affinity .Values.affinity }}
{{- $tolerations := or .Values.resourceManager.tolerations .Values.tolerations }}
{{- $securityContext := or .Values.resourceManager.securityContext .Values.securityContext }}
{{- $podSecurityContext := or .Values.resourceManager.podSecurityContext .Values.podSecurityContext }}
{{- if eq .Values.mode "ha-cluster" }}
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -52,6 +53,9 @@ spec:
- name: resource-manager
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with $securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.resourceManager.command }}
command: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -124,7 +128,7 @@ spec:
{{- with $tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $securityContext }}
{{- with $podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 5 additions & 1 deletion charts/presto/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
{{- $tolerations := or .Values.worker.tolerations .Values.tolerations }}
{{- $securityContext := or .Values.worker.securityContext .Values.securityContext }}
{{- if or (eq .Values.mode "cluster") (eq .Values.mode "ha-cluster") }}
{{- $podSecurityContext := or .Values.worker.podSecurityContext .Values.podSecurityContext }}
apiVersion: apps/v1
kind: Deployment
metadata:
Expand Down Expand Up @@ -52,6 +53,9 @@ spec:
- name: worker
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with $securityContext }}
securityContext: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.worker.command }}
command: {{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -122,7 +126,7 @@ spec:
{{- with $tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with $securityContext }}
{{- with $podSecurityContext }}
securityContext: {{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}