From 7c70658b53671184b52e7990adaceebf6203a53b Mon Sep 17 00:00:00 2001 From: Mike Seese Date: Thu, 19 Oct 2023 15:06:57 -0700 Subject: [PATCH 1/2] add opt-out ttlSecondsAfterFinished setting for the pre-delete hook --- install/helm/agones/templates/hooks/pre_delete_hook.yaml | 3 +++ install/helm/agones/values.yaml | 1 + site/content/en/docs/Installation/Install Agones/helm.md | 1 + 3 files changed, 5 insertions(+) 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..ec4ea68973 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -100,6 +100,7 @@ The following tables lists the configurable parameters of the Agones chart and t |----------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------| | `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` | ### Metrics From c83682c7aab537ebf000d323f6984774cf4afbad Mon Sep 17 00:00:00 2001 From: Mike Seese Date: Thu, 19 Oct 2023 15:32:38 -0700 Subject: [PATCH 2/2] add `feature` tags for new helm reference doc table --- site/content/en/docs/Installation/Install Agones/helm.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/site/content/en/docs/Installation/Install Agones/helm.md b/site/content/en/docs/Installation/Install Agones/helm.md index ec4ea68973..6fb1482707 100644 --- a/site/content/en/docs/Installation/Install Agones/helm.md +++ b/site/content/en/docs/Installation/Install Agones/helm.md @@ -96,11 +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