Skip to content

Commit

Permalink
add opt-out ttlSecondsAfterFinished setting for the pre-delete hook (#…
Browse files Browse the repository at this point in the history
…3442)

* add opt-out ttlSecondsAfterFinished setting for the pre-delete hook

* add `feature` tags for new helm reference doc table
  • Loading branch information
mikeseese committed Oct 20, 2023
1 parent 94410d3 commit f77482f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions install/helm/agones/templates/hooks/pre_delete_hook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions install/helm/agones/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ agones:
crds:
install: true
cleanupOnDelete: true
cleanupJobTTL: 60
serviceaccount:
allocator:
name: agones-allocator
Expand Down
10 changes: 10 additions & 0 deletions site/content/en/docs/Installation/Install Agones/helm.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f77482f

Please sign in to comment.