k8s-basic/helm-chart/templates/networkpolicy.yaml
Waylon S. Walker 01e146db7c wip
2025-02-23 09:59:38 -06:00

31 lines
No EOL
665 B
YAML

apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ .Values.name }}
namespace: {{ .Values.namespace | default .Values.name }}
labels:
service: {{ .Values.name }}
spec:
podSelector:
matchLabels:
service: {{ .Values.name }}
policyTypes:
- Ingress
- Egress
ingress:
- from:
- namespaceSelector:
matchLabels:
name: ingress-nginx
ports:
- protocol: TCP
port: {{ .Values.port }}
egress:
- to:
- namespaceSelector: {}
podSelector: {}
ports:
- protocol: TCP
port: 53
- protocol: UDP
port: 53