agones.dev/agones@v1.53.0/install/helm/agones/templates/hooks/pre_delete_hook.yaml (about) 1 {{- if .Values.agones.crds.cleanupOnDelete }} 2 # Copyright 2018 Google LLC All Rights Reserved. 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15 16 apiVersion: batch/v1 17 kind: Job 18 metadata: 19 name: "{{.Release.Name}}-delete-agones-resources" 20 namespace: {{ .Release.Namespace }} 21 labels: 22 app.kubernetes.io/managed-by: {{.Release.Service | quote }} 23 app.kubernetes.io/instance: {{.Release.Name | quote }} 24 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" 25 annotations: 26 "helm.sh/hook": pre-delete 27 "helm.sh/hook-delete-policy": before-hook-creation 28 spec: 29 {{- if gt (int .Values.agones.crds.cleanupJobTTL) 0 }} 30 ttlSecondsAfterFinished: {{ .Values.agones.crds.cleanupJobTTL }} 31 {{- end}} 32 template: 33 metadata: 34 name: "{{.Release.Name}}-delete-agones-resources" 35 labels: 36 app.kubernetes.io/managed-by: {{.Release.Service | quote }} 37 app.kubernetes.io/instance: {{.Release.Name | quote }} 38 helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" 39 spec: 40 serviceAccountName: helm-hook-cleanup 41 restartPolicy: Never 42 containers: 43 - name: pre-delete-delete-agones-resources 44 image: "alpine/kubectl:1.33.3" 45 command: 46 - "/bin/sh" 47 - "/scripts/delete_agones_resources.sh" 48 {{- range .Values.gameservers.namespaces }} 49 - "{{ . }}" 50 {{- end }} 51 volumeMounts: 52 - name: script 53 mountPath: /scripts/ 54 {{- if .Values.agones.controller.tolerations }} 55 tolerations: 56 {{ toYaml .Values.agones.controller.tolerations | indent 8 }} 57 {{- end }} 58 volumes: 59 - name: script 60 configMap: 61 name: delete-agones-resources 62 {{- end }}