Add postdeleteHook to rancher chart

This commit is contained in:
wbsong111
2024-12-19 15:23:07 +09:00
parent b43b008550
commit cd96e4d7bd
4 changed files with 88 additions and 0 deletions
@@ -0,0 +1,18 @@
{{- if .Values.preinstallHook }}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "rancher.fullname" . }}-cleanup-tls-ca-rolebinding
labels: {{ include "rancher.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": post-delete
"helm.sh/hook-weight": "2"
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
subjects:
- kind: ServiceAccount
name: {{ template "rancher.fullname" . }}-cleanup-tls-ca-sa
namespace: {{ .Release.Namespace }}
roleRef:
kind: Role
name: {{ template "rancher.fullname" . }}-cleanup-tls-ca-role
{{- end }}