Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make all kyverno policies optional and disabled by default #872

Merged
merged 1 commit into from
Nov 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if has "policy-kubevirt-rolebinding" .Values.kyvernoPolicies }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
Expand All @@ -9,4 +10,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: kyverno-background-controller
namespace: kyverno
namespace: kyverno
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if has "add-labels-to-cm-velero" .Values.kyvernoPolicies }}
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
Expand Down Expand Up @@ -31,3 +32,4 @@ spec:
labels:
velero.io/exclude-from-backup: "true"
skipBackgroundRequests: true
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{{ if has "policy-kubevirt-rolebinding" .Values.kyvernoPolicies }}
apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
Expand Down Expand Up @@ -39,4 +40,5 @@ spec:
kind: ClusterRole
name: kubevirt-datavolume-permission
apiGroup: rbac.authorization.k8s.io
{{- end }}

8 changes: 5 additions & 3 deletions platform-apps/charts/kyverno/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
kyvernoPolicies:
- add-ns-quota
- kargo-project-name-validation-apps-in-any-ns
# per default no kyvernoPolicies get applied, add them in the list in your values files to enable them
kyvernoPolicies: []
# - add-ns-quota
# - kargo-project-name-validation-apps-in-any-ns
# - policy-kubevirt-rolebinding

kyverno:
admissionController:
Expand Down