Public Information
This commit is contained in:
39
charts/envdav/templates/networkpolicy.tpl
Normal file
39
charts/envdav/templates/networkpolicy.tpl
Normal file
@@ -0,0 +1,39 @@
|
||||
{{- include "nplus.init" $ -}}
|
||||
{{- if ((.this.security).cni).createNetworkPolicy }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: NetworkPolicy
|
||||
metadata:
|
||||
name: {{ .component.fullName }}
|
||||
{{- if .this.utils.includeNamespace }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels:
|
||||
{{- include "nplus.selectorLabels" . | nindent 6 }}
|
||||
ingress:
|
||||
|
||||
{{- if ( include "nplus.ingressEnabled" . ) }}
|
||||
{{- include "nplus.networkpolicy.allowFromIngress" . | nindent 2 }}
|
||||
{{- end }}
|
||||
|
||||
- from:
|
||||
- ipBlock:
|
||||
cidr: {{ ((.this.security).cni).adminIpRange | quote }}
|
||||
{{- if ((.this.security).cni).excludeUnusedPorts }}
|
||||
ports:
|
||||
{{- include "nplus.defaultPolicyPorts" . | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
policyTypes:
|
||||
- Egress
|
||||
- Ingress
|
||||
|
||||
egress:
|
||||
# -- Access DNS
|
||||
- ports:
|
||||
- protocol: TCP
|
||||
port: 53
|
||||
- protocol: UDP
|
||||
port: 53
|
||||
{{- end }}
|
||||
Reference in New Issue
Block a user