github.com/argoproj/argo-cd@v1.8.7/util/helm/testdata/redis/templates/networkpolicy.yaml (about) 1 {{- if .Values.networkPolicy.enabled }} 2 kind: NetworkPolicy 3 apiVersion: {{ template "networkPolicy.apiVersion" . }} 4 metadata: 5 name: "{{ template "redis.fullname" . }}" 6 labels: 7 app: {{ template "redis.name" . }} 8 chart: {{ template "redis.chart" . }} 9 release: "{{ .Release.Name }}" 10 heritage: "{{ .Release.Service }}" 11 spec: 12 podSelector: 13 matchLabels: 14 app: {{ template "redis.name" . }} 15 ingress: 16 # Allow inbound connections 17 - ports: 18 - port: 6379 19 {{- if not .Values.networkPolicy.allowExternal }} 20 from: 21 - podSelector: 22 matchLabels: 23 {{ template "redis.fullname" . }}-client: "true" 24 {{- end }} 25 {{- if .Values.metrics.enabled }} 26 # Allow prometheus scrapes for metrics 27 - ports: 28 - port: 9121 29 {{- end }} 30 {{- end }}