Skip to content

Commit 0f38807

Browse files
authored
Add policy exception so that controller can be deployed in bootstrap mode (uses host network) (#1215)
1 parent d810f44 commit 0f38807

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s
77

88
## [Unreleased]
99

10+
### Fixed
11+
12+
- Add policy exception so that controller can be deployed in bootstrap mode (uses host network)
13+
1014
## [6.10.0] - 2023-11-15
1115

1216
### Added
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{{- if .Values.kyvernoPolicyExceptions.enabled }}
2+
{{- if .Values.bootstrapMode.enabled }}
3+
{{- if .Capabilities.APIVersions.Has "kyverno.io/v2alpha1/PolicyException" -}}
4+
apiVersion: kyverno.io/v2alpha1
5+
kind: PolicyException
6+
metadata:
7+
name: {{ include "resource.default.name" . }}-bootstrap-mode
8+
namespace: {{ include "resource.default.namespace" . }}
9+
labels:
10+
{{- include "labels.common" . | nindent 4 }}
11+
annotations:
12+
"helm.sh/hook": "pre-install,pre-upgrade"
13+
spec:
14+
exceptions:
15+
- policyName: disallow-host-namespaces
16+
ruleNames:
17+
- autogen-host-namespaces
18+
- host-namespaces
19+
match:
20+
any:
21+
- resources:
22+
kinds:
23+
- Deployment
24+
- ReplicaSet
25+
- Pod
26+
namespaces:
27+
- {{ include "resource.default.namespace" . }}
28+
names:
29+
- "{{ include "resource.default.name" . }}*"
30+
{{- end -}}
31+
{{- end -}}
32+
{{- end -}}

helm/app-operator/values.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,6 @@ serviceMonitor:
9999

100100
podSecurityStandards:
101101
enforced: false
102+
103+
kyvernoPolicyExceptions:
104+
enabled: true

0 commit comments

Comments
 (0)