Skip to content

Commit 18679a6

Browse files
authored
Merge pull request #1 from ahmad-hussain/feature/network-policy-ipblock
feat: allow ipBlocks to be specified in helmchart network policy
2 parents 89d2e11 + 2f08378 commit 18679a6

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

helm/templates/networkpolicy.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@ spec:
4646
port: {{ .Values.networkPolicy.egress.dnsPort | default 53 }}
4747

4848
# Allow Egress to other required services
49-
- to: []
49+
- to:
50+
{{- if .Values.networkPolicy.egress.allowedIpBlocks }}
51+
{{- range .Values.networkPolicy.egress.allowedIpBlocks }}
52+
- ipBlock:
53+
cidr: {{ .cidr }}
54+
{{- end }}
55+
{{- else }}
56+
[]
57+
{{- end }}
5058
ports:
5159
{{- range .Values.networkPolicy.egress.allowedPorts }}
5260
- protocol: {{ .protocol | default "TCP" }}

helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ networkPolicy:
106106
protocol: TCP
107107
- port: 9440
108108
protocol: TCP
109+
allowedIpBlocks: # Define IP blocks for egress

0 commit comments

Comments
 (0)