helm-charts/ocrserver/templates/networkpolicy.yaml

48 lines
1 KiB
YAML
Raw Normal View History

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