{{- if .Values.networkPolicy.enabled }} --- apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: {{- with (include "reposilite.networkPolicy.annotations" . | fromYaml) }} annotations: {{- tpl (toYaml .) $ | nindent 4 }} {{- end }} {{- with (include "reposilite.networkPolicy.labels" . | fromYaml) }} labels: {{- toYaml . | nindent 4 }} {{- end }} name: {{ include "reposilite.fullname" . }} namespace: {{ .Release.Namespace }} spec: podSelector: matchLabels: {{- include "reposilite.pod.selectorLabels" $ | nindent 6 }} {{- with .Values.networkPolicy.policyTypes }} policyTypes: {{- toYaml . | nindent 2 }} {{- end }} {{- with .Values.networkPolicy.egress }} egress: {{- toYaml . | nindent 2 }} {{- end }} {{- with .Values.networkPolicy.ingress }} ingress: {{- toYaml . | nindent 2 }} {{- end }} {{- end }}