Skip to content

Commit

Permalink
Implement livenessProbe variables and readinessProbe variables
Browse files Browse the repository at this point in the history
It's sometimes needed to configure certain timeouts. This PR makes all
the settings available as helm variables.

Signed-off-by: Stefan Andres <[email protected]>
  • Loading branch information
stefanandres committed Nov 7, 2024
1 parent dbac911 commit c468b6f
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 24 deletions.
11 changes: 7 additions & 4 deletions charts/kargo/templates/api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ spec:
- name: h2c
containerPort: 8080
protocol: TCP

{{- if .Values.api.probes.enabled }}
livenessProbe:
{{- with .Values.api.probes.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
exec:
command:
- /usr/local/bin/grpc_health_probe
Expand All @@ -95,8 +98,9 @@ spec:
- -tls
- -tls-no-verify
{{- end }}
initialDelaySeconds: 10
readinessProbe:
{{- with .Values.api.probes.readinessProbe }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
exec:
command:
- /usr/local/bin/grpc_health_probe
Expand All @@ -105,7 +109,6 @@ spec:
- -tls
- -tls-no-verify
{{- end }}
initialDelaySeconds: 5
{{- end }}
{{- if or .Values.kubeconfigSecrets.kargo (and .Values.api.oidc.enabled .Values.api.oidc.dex.enabled) .Values.api.tls.enabled .Values.api.cabundle.configMapName .Values.api.cabundle.secretName }}
volumeMounts:
Expand Down
26 changes: 7 additions & 19 deletions charts/kargo/templates/dex-server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,25 +74,13 @@ spec:
resources:
{{- toYaml .Values.api.oidc.dex.resources | nindent 10 }}
{{- if .Values.api.oidc.dex.probes.enabled }}
livenessProbe:
httpGet:
path: /healthz/live
port: 5558
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 300
readinessProbe:
httpGet:
path: /healthz/ready
port: 5558
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 300
{{- end }}
{{- with .Values.api.oidc.dex.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.api.oidc.dex.readinessProbe }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: config
projected:
Expand Down
24 changes: 23 additions & 1 deletion charts/kargo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ api:
probes:
## @param api.probes.enabled Whether liveness and readiness probes should be included in the API server deployment. It is sometimes advantageous to disable these during local development.
enabled: true
livenessProbe:
initialDelaySeconds: 10

readinessProbe:
initialDelaySeconds: 5

tls:
## @param api.tls.enabled Whether to enable TLS directly on the API server. This is helpful if you do not intend to use an ingress controller or if you require TLS end-to-end. All other settings in this section will be ignored when this is set to `false`.
Expand Down Expand Up @@ -283,7 +288,24 @@ api:
probes:
## @param api.oidc.dex.probes.enabled Whether liveness and readiness probes should be included in the Dex server deployment. It is sometimes advantageous to disable these during local development.
enabled: true

livenessProbe:
httpGet:
path: /healthz/live
port: 5558
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 300
readinessProbe:
httpGet:
path: /healthz/ready
port: 5558
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 300
tls:
## @param api.oidc.dex.tls.selfSignedCert Whether to generate a self-signed certificate for use with Dex. If `true`, `cert-manager` CRDs **must** be present in the cluster. Kargo will create and use its own namespaced issuer. If `false`, a cert secret named `kargo-dex-server-cert` **must** be provided in the same namespace as Kargo. There is no provision for running Dex without TLS.
selfSignedCert: true
Expand Down

0 comments on commit c468b6f

Please sign in to comment.