mirror of
https://github.com/kyverno/kyverno.git
synced 2025-04-13 15:57:31 +00:00
* feat: add cluster role aggregation to cleanup controller Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * codegen Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> * convention Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com> Signed-off-by: Charles-Edouard Brétéché <charles.edouard@nirmata.com>
87 lines
1.9 KiB
YAML
87 lines
1.9 KiB
YAML
{{- if .Values.cleanupController.enabled -}}
|
|
{{- if .Values.cleanupController.rbac.create -}}
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ template "kyverno.cleanup-controller.roleName" . }}
|
|
labels:
|
|
{{- include "kyverno.cleanup-controller.labels" . | nindent 4 }}
|
|
aggregationRule:
|
|
clusterRoleSelectors:
|
|
- matchLabels:
|
|
{{- include "kyverno.cleanup-controller.matchLabels" . | nindent 8 }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ template "kyverno.cleanup-controller.roleName" . }}:core
|
|
labels:
|
|
{{- include "kyverno.cleanup-controller.labels" . | nindent 4 }}
|
|
rules:
|
|
- apiGroups:
|
|
- admissionregistration.k8s.io
|
|
resources:
|
|
- validatingwebhookconfigurations
|
|
verbs:
|
|
- create
|
|
- delete
|
|
- get
|
|
- list
|
|
- update
|
|
- watch
|
|
- apiGroups:
|
|
- ''
|
|
resources:
|
|
- namespaces
|
|
verbs:
|
|
- get
|
|
- list
|
|
- watch
|
|
- apiGroups:
|
|
- kyverno.io
|
|
resources:
|
|
- clustercleanuppolicies
|
|
- cleanuppolicies
|
|
- clustercleanuppolicies/*
|
|
- cleanuppolicies/*
|
|
verbs:
|
|
- create
|
|
- delete
|
|
- get
|
|
- list
|
|
- patch
|
|
- update
|
|
- watch
|
|
- deletecollection
|
|
- apiGroups:
|
|
- batch
|
|
resources:
|
|
- cronjobs
|
|
verbs:
|
|
- create
|
|
- delete
|
|
- get
|
|
- list
|
|
- update
|
|
- watch
|
|
{{- with .Values.cleanupController.rbac.clusterRole.extraResources }}
|
|
---
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
kind: ClusterRole
|
|
metadata:
|
|
name: {{ template "kyverno.cleanup-controller.roleName" $ }}:additional
|
|
labels:
|
|
{{- include "kyverno.cleanup-controller.labels" $ | nindent 4 }}
|
|
rules:
|
|
{{- range . }}
|
|
- apiGroups:
|
|
{{- toYaml .apiGroups | nindent 6 }}
|
|
resources:
|
|
{{- toYaml .resources | nindent 6 }}
|
|
verbs:
|
|
- delete
|
|
- list
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|