post-delete-hook-cluster-role.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. {{- if .Values.postDelete.enabled }}
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1
  4. metadata:
  5. name: {{ template "rancher.fullname" . }}-post-delete
  6. labels: {{ include "rancher.labels" . | nindent 4 }}
  7. annotations:
  8. "helm.sh/hook": post-delete
  9. "helm.sh/hook-weight": "1"
  10. "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
  11. rules:
  12. - apiGroups: [ "extensions","apps" ]
  13. resources: [ "deployments" ]
  14. verbs: [ "get", "list", "delete" ]
  15. - apiGroups: [ "batch" ]
  16. resources: [ "jobs" ]
  17. verbs: [ "get", "list", "watch", "delete", "create" ]
  18. - apiGroups: [ "rbac.authorization.k8s.io" ]
  19. resources: [ "clusterroles", "clusterrolebindings", "roles", "rolebindings" ]
  20. verbs: [ "get", "list", "delete", "create" ]
  21. - apiGroups: [ "" ]
  22. resources: [ "pods", "secrets", "services", "configmaps" ]
  23. verbs: [ "get", "list", "delete" ]
  24. - apiGroups: [ "" ]
  25. resources: [ "serviceaccounts" ]
  26. verbs: [ "get", "list", "delete", "create" ]
  27. - apiGroups: [ "networking.k8s.io" ]
  28. resources: [ "networkpolicies" ]
  29. verbs: [ "get", "list", "delete" ]
  30. - apiGroups: [ "admissionregistration.k8s.io" ]
  31. resources: [ "validatingwebhookconfigurations", "mutatingwebhookconfigurations" ]
  32. verbs: [ "get", "list", "delete" ]
  33. - apiGroups: [ "policy" ]
  34. resources: [ "podsecuritypolicies" ]
  35. verbs: [ "use", "delete", "create" ]
  36. - apiGroups: [ "networking.k8s.io" ]
  37. resources: [ "ingresses" ]
  38. verbs: [ "delete" ]
  39. - apiGroups: [ "cert-manager.io" ]
  40. resources: [ "issuers" ]
  41. verbs: [ "delete" ]
  42. {{- end }}