helm-charts/jellyfin/templates/networkpolicy.yaml

29 lines
705 B
YAML
Raw Normal View History

{{- if .Values.networkPolicy.enabled }}
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: {{ include "jellyfin.fullname" . }}
labels:
{{- include "jellyfin.labels" . | nindent 4 }}
spec:
podSelector:
matchLabels:
{{- include "jellyfin.selectorLabels" . | nindent 6 }}
policyTypes:
- Ingress
{{- if .Values.networkPolicy.egress.enabled }}
- Egress
{{- end }}
ingress:
- ports:
- port: {{ .Values.service.port }}
protocol: TCP
from:
{{- toYaml .Values.networkPolicy.ingress.http | nindent 8 }}
{{- with .Values.networkPolicy.egress }}
egress:
{{- toYaml .extra | nindent 4 }}
{{- end }}
{{- end }}