{{- if .Values.networkPolicy.enabled }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: {{ include "bascule.fullname" . }} spec: podSelector: matchLabels: {{- include "bascule.selectorLabels" . | nindent 6 }} policyTypes: - Ingress - Egress ingress: - ports: - port: 2222 protocol: TCP egress: - ports: - port: 53 protocol: UDP - port: 53 protocol: TCP {{- if .Values.networkPolicy.allowKubeApi }} - ports: - port: 443 protocol: TCP - port: 6443 protocol: TCP {{- end }} {{- end }}