{{- with .Values.networkPolicy }} apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: name: {{ include "wordpress.fullname" $ }} spec: podSelector: matchLabels: {{- include "wordpress.selectorLabels" $ | nindent 6 }} policyTypes: {{- if .ingress }} - Ingress {{- end }} {{- if .egress }} - Egress {{- end }} {{- with .ingress }} ingress: {{- toYaml . | nindent 4 }} {{- end }} {{- with .egress }} egress: {{- toYaml . | nindent 4 }} {{- end }} {{- end }}