artifactory-networkpolicy.yaml 807 Bytes
Newer Older
Joe Mayer's avatar
Joe Mayer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
{{- range .Values.networkpolicy }}
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: {{ template "artifactory-ha.fullname" $ }}-{{ .name }}-networkpolicy
  labels:
    app: {{ template "artifactory-ha.name" $ }}
    chart: {{ template "artifactory-ha.chart" $ }}
    release: {{ $.Release.Name }}
    heritage: {{ $.Release.Service }}  
spec:
{{- if .podSelector }}
  podSelector:
{{ .podSelector | toYaml | trimSuffix "\n" | indent 4 -}}
{{ else }}
  podSelector: {}
{{- end }}
  policyTypes:
  {{- if .ingress }}
  - Ingress
  {{- end }}
  {{- if .egress }}
  - Egress
  {{- end }}
{{- if .ingress }}
  ingress:
{{ .ingress | toYaml | trimSuffix "\n" | indent 2 -}}
{{- end }}
{{- if .egress }}
  egress:
{{ .egress | toYaml | trimSuffix "\n" | indent 2 -}}
{{- end }}
---
{{- end -}}