Skip to content

Commit

Permalink
make pod security context fully configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
CatherineThompson committed Aug 26, 2024
1 parent befa7cf commit 98e3a12
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
8 changes: 5 additions & 3 deletions charts/trino/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,9 @@ Fast distributed SQL query engine for big data analytics that helps you explore
imagePullPolicy: IfNotPresent
command: ['sleep', '1']
```
* `securityContext.runAsUser` - int, default: `1000`
* `securityContext.runAsGroup` - int, default: `1000`
* `securityContext` - object, default: `{"runAsGroup":1000,"runAsUser":1000}`

[Container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) configuration.
* `containerSecurityContext` - object, default: `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]}}`

[Container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container) configuration.
Expand Down Expand Up @@ -662,6 +663,7 @@ Fast distributed SQL query engine for big data analytics that helps you explore
value: '$2'
help: 'ThreadCount (java.lang<type=Threading><>ThreadCount)'
type: UNTYPED
* `jmx.exporter.securityContext` - object, default: `{}`
* `serviceMonitor.enabled` - bool, default: `false`

Set to true to create resources for the [prometheus-operator](https://github.com/prometheus-operator/prometheus-operator).
Expand Down Expand Up @@ -690,4 +692,4 @@ Fast distributed SQL query engine for big data analytics that helps you explore
* `ingress.tls` - list, default: `[]`

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1)
7 changes: 5 additions & 2 deletions charts/trino/templates/deployment-coordinator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ spec:
serviceAccountName: {{ include "trino.serviceAccountName" . }}
{{- with .Values.securityContext }}
securityContext:
runAsUser: {{ .runAsUser }}
runAsGroup: {{ .runAsGroup }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.shareProcessNamespace.coordinator }}
shareProcessNamespace: {{ .Values.shareProcessNamespace.coordinator }}
Expand Down Expand Up @@ -203,6 +202,10 @@ spec:
- name: jmx-exporter
image: {{ .Values.jmx.exporter.image }}
imagePullPolicy: {{ .Values.jmx.exporter.pullPolicy }}
{{- with .Values.jmx.exporter.securityContext }}
securityContext:
{{- toYaml .Values.jmx.exporter.securityContext | nindent 12 }}
{{- end }}
args:
- "{{ .Values.jmx.exporter.port }}"
- /etc/jmx-exporter/jmx-exporter-config.yaml
Expand Down
3 changes: 1 addition & 2 deletions charts/trino/templates/deployment-worker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ spec:
serviceAccountName: {{ include "trino.serviceAccountName" . }}
{{- with .Values.securityContext }}
securityContext:
runAsUser: {{ .runAsUser }}
runAsGroup: {{ .runAsGroup }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.shareProcessNamespace.worker }}
shareProcessNamespace: {{ .Values.shareProcessNamespace.worker }}
Expand Down
2 changes: 2 additions & 0 deletions charts/trino/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ sidecarContainers: {}
# command: ['sleep', '1']
# ```

# -- [Container security context](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod) configuration.
securityContext:
runAsUser: 1000
runAsGroup: 1000
Expand Down Expand Up @@ -760,6 +761,7 @@ jmx:
pullPolicy: Always
port: 5556
configProperties: []
securityContext: {}
# jmx.exporter.configProperties -- JMX Config Properties is mounted to /etc/jmx-exporter/jmx-exporter-config.yaml
# @raw
# Example:
Expand Down

0 comments on commit 98e3a12

Please sign in to comment.