Skip to content

feat(helm): add pod securityContext and enhanced probe configuration #19013

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

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
24 changes: 24 additions & 0 deletions helm/coder/templates/_coder.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,34 @@ readinessProbe:
port: "http"
scheme: "HTTP"
initialDelaySeconds: {{ .Values.coder.readinessProbe.initialDelaySeconds }}
{{- with .Values.coder.readinessProbe.periodSeconds }}
periodSeconds: {{ . }}
{{- end }}
{{- with .Values.coder.readinessProbe.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
{{- with .Values.coder.readinessProbe.successThreshold }}
successThreshold: {{ . }}
{{- end }}
{{- with .Values.coder.readinessProbe.failureThreshold }}
failureThreshold: {{ . }}
{{- end }}
livenessProbe:
httpGet:
path: /healthz
port: "http"
scheme: "HTTP"
initialDelaySeconds: {{ .Values.coder.livenessProbe.initialDelaySeconds }}
{{- with .Values.coder.livenessProbe.periodSeconds }}
periodSeconds: {{ . }}
{{- end }}
{{- with .Values.coder.livenessProbe.timeoutSeconds }}
timeoutSeconds: {{ . }}
{{- end }}
{{- with .Values.coder.livenessProbe.successThreshold }}
successThreshold: {{ . }}
{{- end }}
{{- with .Values.coder.livenessProbe.failureThreshold }}
failureThreshold: {{ . }}
{{- end }}
{{- end }}
51 changes: 51 additions & 0 deletions helm/coder/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,33 @@ coder:
# coder.serviceAccount.disableCreate -- Whether to create the service account or use existing service account.
disableCreate: false

# coder.podSecurityContext -- Fields related to the pod's security context.
# This is useful for setting fsGroup to ensure proper file permissions for
# mounted volumes (e.g., for mTLS certificates). See:
# https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#podsecuritycontext-v1-core
#
# Example for mTLS PostgreSQL with mounted certificates:
# podSecurityContext:
# fsGroup: 1000 # Ensures coder user (1000) can read mounted TLS certs
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 1000
#
# When mounting TLS certificates for PostgreSQL mTLS, you should also set
# the volume defaultMode to 0640:
# volumes:
# - name: postgres-certs
# secret:
# secretName: postgres-tls-certs
# defaultMode: 0640
podSecurityContext: {}
# fsGroup: 1000
# runAsNonRoot: true
# runAsUser: 1000
# runAsGroup: 1000
# seccompProfile:
# type: RuntimeDefault

# coder.securityContext -- Fields related to the container's security
# context (as opposed to the pod). Some fields are also present in the pod
# security context, in which case these values will take precedence.
Expand Down Expand Up @@ -211,12 +238,36 @@ coder:
# coder.readinessProbe.initialDelaySeconds -- Number of seconds after the container
# has started before readiness probes are initiated.
initialDelaySeconds: 0
# coder.readinessProbe.periodSeconds -- How often (in seconds) to perform the probe.
# Default to 10 seconds. Minimum value is 1.
# periodSeconds: 10
# coder.readinessProbe.timeoutSeconds -- Number of seconds after which the probe times out.
# Defaults to 1 second. Minimum value is 1.
# timeoutSeconds: 1
# coder.readinessProbe.successThreshold -- Minimum consecutive successes for the probe
# to be considered successful after having failed. Defaults to 1.
# successThreshold: 1
# coder.readinessProbe.failureThreshold -- When a probe fails, Kubernetes will
# try failureThreshold times before giving up. Defaults to 3.
# failureThreshold: 3

# coder.livenessProbe -- Liveness probe configuration for the Coder container.
livenessProbe:
# coder.livenessProbe.initialDelaySeconds -- Number of seconds after the container
# has started before liveness probes are initiated.
initialDelaySeconds: 0
# coder.livenessProbe.periodSeconds -- How often (in seconds) to perform the probe.
# Default to 10 seconds. Minimum value is 1.
# periodSeconds: 10
# coder.livenessProbe.timeoutSeconds -- Number of seconds after which the probe times out.
# Defaults to 1 second. Minimum value is 1.
# timeoutSeconds: 1
# coder.livenessProbe.successThreshold -- Minimum consecutive successes for the probe
# to be considered successful after having failed. Defaults to 1. Must be 1 for liveness.
# successThreshold: 1
# coder.livenessProbe.failureThreshold -- When a probe fails, Kubernetes will
# try failureThreshold times before giving up. Defaults to 3.
# failureThreshold: 3

# coder.certs -- CA bundles to mount inside the Coder pod.
certs:
Expand Down
4 changes: 4 additions & 0 deletions helm/libcoder/templates/_coder.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ spec:
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.podSecurityContext }}
securityContext:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.coder.initContainers }}
initContainers:
{{ toYaml . | nindent 8 }}
Expand Down
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy