-
Notifications
You must be signed in to change notification settings - Fork 776
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(helm): Add a network policy for the controller manager (#2514)
Allows communication in network locked down clusters. This is especially useful to allow the init container of the gatekeeper-update-namespace-label job to communicate with the pods behind the gatekeeper-webhook-service service. Signed-off-by: Kyle Michel <[email protected]> Signed-off-by: Kyle Michel <[email protected]> Co-authored-by: Rita Zhang <[email protected]>
- Loading branch information
1 parent
80d6346
commit ac8612d
Showing
6 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
cmd/build/helmify/static/templates/gatekeeper-controller-manager-network-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- if .Values.controllerManager.networkPolicy.enabled -}} | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
labels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
chart: '{{ template "gatekeeper.name" . }}' | ||
heritage: '{{ .Release.Service }}' | ||
release: '{{ .Release.Name }}' | ||
name: gatekeeper-controller-manager | ||
spec: | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
release: '{{ .Release.Name }}' | ||
{{- with .Values.controllerManager.networkPolicy.ingress }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
podSelector: | ||
matchLabels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
chart: '{{ template "gatekeeper.name" . }}' | ||
control-plane: controller-manager | ||
gatekeeper.sh/operation: webhook | ||
gatekeeper.sh/system: "yes" | ||
heritage: '{{ .Release.Service }}' | ||
release: '{{ .Release.Name }}' | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
...est_staging/charts/gatekeeper/templates/gatekeeper-controller-manager-network-policy.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{{- if .Values.controllerManager.networkPolicy.enabled -}} | ||
kind: NetworkPolicy | ||
apiVersion: networking.k8s.io/v1 | ||
metadata: | ||
labels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
chart: '{{ template "gatekeeper.name" . }}' | ||
heritage: '{{ .Release.Service }}' | ||
release: '{{ .Release.Name }}' | ||
name: gatekeeper-controller-manager | ||
spec: | ||
ingress: | ||
- from: | ||
- podSelector: | ||
matchLabels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
release: '{{ .Release.Name }}' | ||
{{- with .Values.controllerManager.networkPolicy.ingress }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
podSelector: | ||
matchLabels: | ||
app: '{{ template "gatekeeper.name" . }}' | ||
chart: '{{ template "gatekeeper.name" . }}' | ||
control-plane: controller-manager | ||
gatekeeper.sh/operation: webhook | ||
gatekeeper.sh/system: "yes" | ||
heritage: '{{ .Release.Service }}' | ||
release: '{{ .Release.Name }}' | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters