From b0134bccc5ea75b501f5325f81a34ea065bfbf41 Mon Sep 17 00:00:00 2001 From: Brodi Elwood Date: Sat, 13 Apr 2024 21:13:29 -0400 Subject: [PATCH] readiness and liveness probes --- chart/palworld-k8s/README.md | 3 +++ chart/palworld-k8s/templates/deployment.yaml | 8 ++++++++ chart/palworld-k8s/values.yaml | 19 +++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/chart/palworld-k8s/README.md b/chart/palworld-k8s/README.md index 3e6d3df..2b26c8b 100644 --- a/chart/palworld-k8s/README.md +++ b/chart/palworld-k8s/README.md @@ -63,6 +63,9 @@ Kubernetes: `>=1.26.0-0` | persistence.storageClassName | string | `""` | Storage class name for the PVC. | | podAnnotations | object | `{}` | Annotations to add to the pod. | | podSecurityContext | object | `{}` | Security context for the pod. | +| probes | object | `{"liveness":{},"readiness":{}}` | Liveness and readiness probes. | +| probes.liveness | object | `{}` | Liveness probe | +| probes.readiness | object | `{}` | Readiness probe. | | rcon.enabled | bool | `true` | Enable or disable RCON. | | rcon.existingSecret | string | `""` | Name of an existing secret for the RCON (admin) password. | | rcon.password | string | `""` | RCON (admin) password. If one is not provided and RCON is enabled, one will be generated. | diff --git a/chart/palworld-k8s/templates/deployment.yaml b/chart/palworld-k8s/templates/deployment.yaml index a97d68c..cbe37dd 100644 --- a/chart/palworld-k8s/templates/deployment.yaml +++ b/chart/palworld-k8s/templates/deployment.yaml @@ -87,6 +87,14 @@ spec: {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- with .Values.probes.liveness }} + livenessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} + {{- with .Values.probes.readiness }} + readinessProbe: + {{- toYaml . | nindent 12 }} + {{- end }} {{- if .Values.persistence.enabled }} volumes: - name: datadir diff --git a/chart/palworld-k8s/values.yaml b/chart/palworld-k8s/values.yaml index e653dc4..6aa51b3 100644 --- a/chart/palworld-k8s/values.yaml +++ b/chart/palworld-k8s/values.yaml @@ -208,6 +208,25 @@ resources: memory: 8Gi cpu: 4 +# -- Liveness and readiness probes. +probes: + # -- Liveness probe + liveness: {} + # exec: + # command: + # - sh + # - -c + # - pgrep PalServer > /dev/null || exit 1 + # initialDelaySeconds: 30 + # -- Readiness probe. + readiness: {} + # exec: + # command: + # - sh + # - -c + # - rcon-cli Info | grep -q "Pal Server" + # initialDelaySeconds: 60 + serviceAccount: # -- Specifies whether a service account should be created. create: false