Skip to content

Commit

Permalink
fix kyverno policy and ref name (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
eumel8 authored Dec 9, 2024
1 parent 2b30b40 commit d08291c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions chart/templates/policyexception.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
apiVersion: kyverno.io/v2
kind: PolicyException
metadata:
annotations:
"helm.sh/hook": pre-install
name: kepler-{{ include "caas-carbon-footprint.fullname" . }}
labels:
app.kubernetes.io/component: kepler
Expand All @@ -14,39 +16,49 @@ spec:
- policyName: disallow-host-namespaces
ruleNames:
- autogen-host-namespaces
- host-namespaces
- policyName: disallow-host-path
ruleNames:
- autogen-host-path
- host-path
- policyName: disallow-host-ports
ruleNames:
- autogen-host-ports-none
- host-ports-none
- policyName: disallow-privilege-escalation
ruleNames:
- autogen-privilege-escalation
- privilege-escalation
- policyName: disallow-privileged-containers
ruleNames:
- autogen-privileged-containers
- privileged-containers
- policyName: drop-all-capabilities
ruleNames:
- autogen-require-drop-all
- autogen-validate-readOnlyRootFilesystem
- require-drop-all
- validate-readOnlyRootFilesystem
- policyName: require-run-as-nonroot
ruleNames:
- autogen-run-as-non-root
- run-as-non-root
- policyName: restrict-controlplane-scheduling
ruleNames:
- autogen-restrict-controlplane-scheduling-control-plane
- restrict-controlplane-scheduling-control-plane
- policyName: require-ro-rootfs
ruleNames:
- autogen-validate-readOnlyRootFilesystem
- validate-readOnlyRootFilesystem
match:
any:
- resources:
kinds:
- Pod
- DaemonSet
names:
- {{ include "caas-carbon-footprint.fullname" . }}*
- {{ .Release.Name }}*
namespaces:
- {{ .Release.Namespace }}
{{- end }}
Expand All @@ -62,7 +74,6 @@ metadata:
{{- if .Values.kyverno.namespace }}
namespace: {{ .Values.kyverno.namespace }}
{{- end }}

spec:
exceptions:
- policyName: restrict-clusterrole-nodesproxy
Expand All @@ -71,5 +82,5 @@ spec:
match:
any:
- clusterRoles:
- {{ include "caas-carbon-footprint.fullname" . }}-kepler-clusterrole
- {{ .Release.Name }}-kepler-clusterrole
{{- end }}

0 comments on commit d08291c

Please sign in to comment.