Skip to content

Commit e007787

Browse files
feat(chart): add CiliumNetworkPolicy (#146)
Signed-off-by: Sebastian Gaiser <sebastiangaiser@users.noreply.github.com>
1 parent 9279a09 commit e007787

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{{- if and .Values.networkPolicy.enabled (eq .Values.networkPolicy.flavor "cilium") -}}
2+
---
3+
apiVersion: cilium.io/v2
4+
kind: CiliumNetworkPolicy
5+
metadata:
6+
name: {{ include "ca-controller-for-strimzi.fullname" . }}
7+
spec:
8+
endpointSelector:
9+
matchLabels:
10+
{{- include "ca-controller-for-strimzi.selectorLabels" . | nindent 6 }}
11+
egress:
12+
- toEntities:
13+
- kube-apiserver
14+
{{- if and .Values.networkPolicy.cilium .Values.networkPolicy.cilium.egress }}
15+
{{- toYaml .Values.networkPolicy.cilium.egress | nindent 4 }}
16+
{{- end }}
17+
{{- if and .Values.networkPolicy.cilium .Values.networkPolicy.cilium.ingress }}
18+
ingress:
19+
{{- toYaml .Values.networkPolicy.cilium.ingress | nindent 4 }}
20+
{{- end }}
21+
{{- end -}}

chart/values.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,29 @@ extraContainers: []
4141

4242
env: {}
4343
envFrom: []
44+
45+
networkPolicy:
46+
enabled: false
47+
flavor: cilium
48+
cilium:
49+
egress: []
50+
# - toEndpoints:
51+
# - matchLabels:
52+
# io.kubernetes.pod.namespace: kube-system
53+
# app.kubernetes.io/instance: coredns
54+
# app.kubernetes.io/name: coredns
55+
# toPorts:
56+
# - ports:
57+
# - port: "53"
58+
# protocol: UDP
59+
# - port: "53"
60+
# protocol: TCP
61+
ingress: []
62+
# - fromEndpoints:
63+
# - matchLabels:
64+
# io.kubernetes.pod.namespace: monitoring
65+
# app.kubernetes.io/name: prometheus
66+
# toPorts:
67+
# - ports:
68+
# - port: http
69+
# protocol: TCP

0 commit comments

Comments
 (0)