Skip to content

Commit

Permalink
feat: Add ability to define securityContext and podSecurityContext
Browse files Browse the repository at this point in the history
Signed-off-by: Marco Maurer <[email protected]>
  • Loading branch information
mkilchhofer committed Apr 15, 2024
1 parent a7d0f6c commit a7f4cc6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
2 changes: 2 additions & 0 deletions deploy/charts/version-checker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ A Helm chart for version-checker
| livenessProbe.initialDelaySeconds | int | `3` | Number of seconds after the container has started before liveness probes are initiated. |
| livenessProbe.periodSeconds | int | `3` | How often (in seconds) to perform the livenessProbe. |
| nodeSelector | object | `{}` | Configure nodeSelector |
| podSecurityContext | object | `{}` | Set pod-level security context |
| prometheus.enabled | bool | `false` | Deploy a Prometheus-Operator Prometheus Object to collect version-checker metrics |
| prometheus.replicas | int | `1` | Number of Prometheus replicas to create |
| prometheus.serviceAccountName | string | `"prometheus"` | ServiceAccount for new Prometheus Object |
Expand All @@ -51,6 +52,7 @@ A Helm chart for version-checker
| readinessProbe.periodSeconds | int | `3` | How often (in seconds) to perform the readinessProbe. |
| replicaCount | int | `1` | Replica Count for version-checker |
| resources | object | `{}` | Setup version-checkers resource requests/limits |
| securityContext | object | `{}` | Set container-level security context |
| selfhosted | []{name: "", host: "", username:"", password:"", token:""}] | `[]` | Setup a number of SelfHosted Repositories and their credentials |
| service.annotations | object | `{}` | Additional annotations to add to the service |
| service.labels | object | `{}` | Additional labels to add to the service |
Expand Down
9 changes: 8 additions & 1 deletion deploy/charts/version-checker/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ spec:
- "--test-all-containers={{.Values.versionChecker.testAllContainers}}"
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.securityContext }}
securityContext:
{{- toYaml . | nindent 10 }}
{{- end }}
{{- if .Values.livenessProbe.enabled }}
livenessProbe:
{{- omit .Values.livenessProbe "enabled" | toYaml | nindent 10}}
Expand Down Expand Up @@ -202,7 +206,10 @@ spec:
{{- if .Values.env }}
{{- toYaml .Values.env | nindent 8 }}
{{- end }}

{{- with .Values.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
{{- if $secretEnabled }}
- name: {{ include "version-checker.name" . }}
Expand Down
15 changes: 15 additions & 0 deletions deploy/charts/version-checker/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,21 @@ resources:
# memory: 128Mi
#

# -- Set container-level security context
securityContext: {}
# allowPrivilegeEscalation: false
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 65534
# seccompProfile:
# type: RuntimeDefault

# -- Set pod-level security context
podSecurityContext: {}

# Configure the readiness probe for version-checker
readinessProbe:
# -- Enable/Disable the setting of a readinessProbe
Expand Down

0 comments on commit a7f4cc6

Please sign in to comment.