argo-cd/util/helm/testdata/redis/templates/networkpolicy.yaml
Jesse Suen a7c7523a8c
Support helm charts and yaml directories as an application source (#432)
* Support helm charts and yaml directories as an application source
* Run e2e test in parallel and increase timeout
2018-07-24 16:37:12 -07:00

30 lines
824 B
YAML

{{- if .Values.networkPolicy.enabled }}
kind: NetworkPolicy
apiVersion: {{ template "networkPolicy.apiVersion" . }}
metadata:
name: "{{ template "redis.fullname" . }}"
labels:
app: {{ template "redis.name" . }}
chart: {{ template "redis.chart" . }}
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
podSelector:
matchLabels:
app: {{ template "redis.name" . }}
ingress:
# Allow inbound connections
- ports:
- port: 6379
{{- if not .Values.networkPolicy.allowExternal }}
from:
- podSelector:
matchLabels:
{{ template "redis.fullname" . }}-client: "true"
{{- end }}
{{- if .Values.metrics.enabled }}
# Allow prometheus scrapes for metrics
- ports:
- port: 9121
{{- end }}
{{- end }}