apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: {{ include "data-service.fullname" . }}-network-policy labels: {{- include "data-service.labels" . | nindent 4 }} spec: podSelector: matchLabels: {{- include "data-service.selectorLabels" . | nindent 6 }} policyTypes: - Ingress - Egress ingress: - from: - podSelector: matchLabels: app.kubernetes.io/name: api-gateway ports: - port: http protocol: TCP egress: # Allow DNS resolution - to: [] ports: - port: 53 protocol: UDP - port: 53 protocol: TCP