From 865f70551e1abd67148766eccc28f7a4bb43cf44 Mon Sep 17 00:00:00 2001 From: Travis Neely Date: Thu, 18 Jul 2024 07:13:42 -0500 Subject: [PATCH] Add readiness liveness config (#11) --- charts/jellyfin/README.md | 12 ++++++++ charts/jellyfin/templates/deployment.yaml | 34 +++++++++++++++++++++++ charts/jellyfin/values.yaml | 19 ++++++++++++- 3 files changed, 64 insertions(+), 1 deletion(-) diff --git a/charts/jellyfin/README.md b/charts/jellyfin/README.md index e9955e9..0590d79 100644 --- a/charts/jellyfin/README.md +++ b/charts/jellyfin/README.md @@ -47,6 +47,18 @@ The following tables lists the configurable parameters of the Jellyfin chart and | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Affinity settings for pod assignment | `{}` | +| `livenessProbe.enabled` | Enable livenessProbe | `true` | +| `livenessProbe.failureThreshold` | Number of consecutive failures before restarting the pod | `3` | +| `livenessProbe.initialDelaySeconds` | Number of seconds after the container has started before liveness probes begin | `10` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | +| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | +| `livenessProbe.timeoutSeconds` | Number of seconds after which the probe times out | `1` | +| `readinessProbe.enabled` | Enable readinessProbe | `true` | +| `readinessProbe.failureThreshold` | Number of consecutive failures before restarting the pod | `3` | +| `readinessProbe.initialDelaySeconds` | Number of seconds after the container has started before liveness probes begin | `10` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | +| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | `1` | +| `readinessProbe.timeoutSeconds` | Number of seconds after which the probe times out | `1` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. diff --git a/charts/jellyfin/templates/deployment.yaml b/charts/jellyfin/templates/deployment.yaml index 00ee541..9d57d94 100644 --- a/charts/jellyfin/templates/deployment.yaml +++ b/charts/jellyfin/templates/deployment.yaml @@ -49,12 +49,46 @@ spec: hostPort: 1900 protocol: UDP {{- end }} + {{ if .Values.livenessProbe.enabled }} livenessProbe: + {{ if .Values.livenessProbe.initialDelaySeconds }} + initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} + {{- end }} + {{ if .Values.livenessProbe.periodSeconds }} + periodSeconds: {{ .Values.livenessProbe.periodSeconds }} + {{- end }} + {{ if .Values.livenessProbe.timeoutSeconds }} + timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} + {{- end }} + {{ if .Values.livenessProbe.failureThreshold }} + failureThreshold: {{ .Values.livenessProbe.failureThreshold }} + {{- end }} + {{ if .Values.livenessProbe.successThreshold }} + successThreshold: {{ .Values.livenessProbe.successThreshold }} + {{- end }} tcpSocket: port: http + {{- end }} + {{ if .Values.readinessProbe.enabled }} readinessProbe: + {{ if .Values.readinessProbe.initialDelaySeconds }} + initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} + {{- end }} + {{ if .Values.readinessProbe.periodSeconds }} + periodSeconds: {{ .Values.readinessProbe.periodSeconds }} + {{- end }} + {{ if .Values.readinessProbe.timeoutSeconds }} + timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} + {{- end }} + {{ if .Values.readinessProbe.failureThreshold }} + failureThreshold: {{ .Values.readinessProbe.failureThreshold }} + {{- end }} + {{ if .Values.readinessProbe.successThreshold }} + successThreshold: {{ .Values.readinessProbe.successThreshold }} + {{- end }} tcpSocket: port: http + {{- end }} volumeMounts: - mountPath: /config name: config diff --git a/charts/jellyfin/values.yaml b/charts/jellyfin/values.yaml index d6956ff..d3efa39 100644 --- a/charts/jellyfin/values.yaml +++ b/charts/jellyfin/values.yaml @@ -131,4 +131,21 @@ extraEnvVars: [] # additional annotations applied to the pod extraPodAnnotations: {} -extraContainers: {} \ No newline at end of file +extraContainers: {} + +# Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. +livenessProbe: + enabled: true + # failureThreshold: 3 + initialDelaySeconds: 10 + # periodSeconds: 10 + # successThreshold: 1 + # timeoutSeconds: 1 + +readinessProbe: + enabled: true + # failureThreshold: 3 + initialDelaySeconds: 10 + # periodSeconds: 10 + # successThreshold: 1 + # timeoutSeconds: 1 \ No newline at end of file