File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ {{- if .Values.networkPolicy.enabled }}
2
+ apiVersion : networking.k8s.io/v1
3
+ kind : NetworkPolicy
4
+ metadata :
5
+ name : {{ include "nginx-ingress.fullname" . }}-network-policy
6
+ labels :
7
+ {{- include "nginx-ingress.labels" . | nindent 4 }}
8
+ spec :
9
+ podSelector :
10
+ {{- toYaml .Values.networkPolicy.podSelector | nindent 4 }}
11
+ policyTypes :
12
+ {{- toYaml .Values.networkPolicy.policyTypes | nindent 4 }}
13
+
14
+ {{- if has "Ingress" .Values.networkPolicy.policyTypes }}
15
+ ingress :
16
+ {{- toYaml .Values.networkPolicy.ingress | nindent 4 }}
17
+ {{- end }}
18
+
19
+ {{- if has "Egress" .Values.networkPolicy.policyTypes }}
20
+ egress :
21
+ {{- toYaml .Values.networkPolicy.egress | nindent 4 }}
22
+ {{- end }}
23
+ {{- end }}
Original file line number Diff line number Diff line change @@ -724,3 +724,23 @@ nginxAgent:
724
724
processorBufferSize : 50000
725
725
# # The name of a custom ConfigMap to use instead of the one provided by default
726
726
customConfigMap : " "
727
+
728
+ # Default values for nginx-ingress with optional NetworkPolicy
729
+ networkPolicy :
730
+ enabled : false # Set to true to enable the NetworkPolicy
731
+ policyTypes : # Types of policy to create
732
+ - Ingress
733
+ - Egress
734
+ podSelector : {} # Label selector for pods (defaults to ingress controller pods)
735
+ ingress : # Ingress rules
736
+ - from : [] # List of peer selectors (e.g. namespaces, pods)
737
+ ports :
738
+ - protocol : TCP
739
+ port : 80
740
+ - protocol : TCP
741
+ port : 443
742
+ egress : # Egress rules
743
+ - to : [] # List of peer selectors
744
+ ports :
745
+ - protocol : UDP
746
+ port : 53
You can’t perform that action at this time.
0 commit comments