Files
versitygw/chart/templates/networkpolicy.yaml
2026-03-04 21:02:33 +01:00

25 lines
766 B
YAML

{{- if .Values.networkPolicy.enabled }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "versitygw.fullname" . }}
spec:
podSelector:
matchLabels:
{{- include "versitygw.selectorLabels" . | nindent 6 }}
# Permit ingress traffic only from the specified namespaces and pods
ingress:
- from:
namespaceSelector:
matchLabels: {{- toYaml .Values.networkPolicy.allowIngressFromNamespaces | nindent 10 }}
podSelector: {{- toYaml .Values.networkPolicy.allowIngressFromPods | nindent 10 }}
# By omitting the ports specification we apply this NetworkPolicy to all ports
ports: []
# All egress traffic is allowed
egress:
- {}
policyTypes:
- Ingress
- Egress
{{- end }}