diff --git a/install/helm/agones/templates/hooks/pre_delete_hook.yaml b/install/helm/agones/templates/hooks/pre_delete_hook.yaml index 50fe29dc40..75cb0b43af 100644 --- a/install/helm/agones/templates/hooks/pre_delete_hook.yaml +++ b/install/helm/agones/templates/hooks/pre_delete_hook.yaml @@ -26,6 +26,9 @@ metadata: "helm.sh/hook": pre-delete "helm.sh/hook-delete-policy": before-hook-creation spec: + {{- if gt (int .Values.agones.crds.cleanupJobTTL) 0 }} + ttlSecondsAfterFinished: {{ .Values.agones.crds.cleanupJobTTL }} + {{- end}} template: metadata: name: "{{.Release.Name}}-delete-agones-resources" diff --git a/install/helm/agones/values.yaml b/install/helm/agones/values.yaml index d5b30d1c3a..da36c0b2e7 100644 --- a/install/helm/agones/values.yaml +++ b/install/helm/agones/values.yaml @@ -32,6 +32,7 @@ agones: crds: install: true cleanupOnDelete: true + cleanupJobTTL: 60 serviceaccount: allocator: name: agones-allocator diff --git a/site/content/en/docs/Installation/Install Agones/helm.md b/site/content/en/docs/Installation/Install Agones/helm.md index fb2a1facb9..6fb1482707 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -96,10 +96,20 @@ The following tables lists the configurable parameters of the Agones chart and t ### Custom Resource Definitions +{{% feature expiryVersion="1.36.0" %}} | Parameter | Description | Default | |----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| | `agones.crds.install` | Install the CRDs with this chart. Useful to disable if you want to subchart (since crd-install hook is broken), so you can copy the CRDs into your own chart. | `true` | | `agones.crds.cleanupOnDelete` | Run the pre-delete hook to delete all GameServers and their backing Pods when deleting the helm chart, so that all CRDs can be removed on chart deletion | `true` | +{{% /feature %}} + +{{% feature publishVersion="1.36.0" %}} +| Parameter | Description | Default | +|----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| +| `agones.crds.install` | Install the CRDs with this chart. Useful to disable if you want to subchart (since crd-install hook is broken), so you can copy the CRDs into your own chart. | `true` | +| `agones.crds.cleanupOnDelete` | Run the pre-delete hook to delete all GameServers and their backing Pods when deleting the helm chart, so that all CRDs can be removed on chart deletion | `true` | +| `agones.crds.cleanupJobTTL` | The number of seconds for Kubernetes to delete the associated Job and Pods of the pre-delete hook after it completes, regardless if the Job is successful or not. Set to `0` to disable cleaning up the Job or the associated Pods. | `60` | +{{% /feature %}} ### Metrics