blob: 92f3b71b15c2e0b27c7bbe336288e2f82245b92f [file] [log] [blame]
Dominic Lunanuova50aafc52018-03-30 02:29:23 +00001{{- if .Values.networkPolicy.enabled }}
2kind: NetworkPolicy
3apiVersion: {{ template "postgresql.networkPolicy.apiVersion" . }}
4metadata:
5 name: "{{ template "postgresql.fullname" . }}"
6 labels:
7 app: {{ template "postgresql.fullname" . }}
8 chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
9 release: "{{ .Release.Name }}"
10 heritage: "{{ .Release.Service }}"
11spec:
12 podSelector:
13 matchLabels:
14 app: "{{ template "postgresql.fullname" . }}"
15 ingress:
16 # Allow inbound connections
17 - ports:
18 - port: 5432
19 {{- if not .Values.networkPolicy.allowExternal }}
20 from:
21 - podSelector:
22 matchLabels:
23 {{ template "postgresql.fullname" . }}-client: "true"
24 {{- end }}
25 # Allow prometheus scrapes
26 - ports:
27 - port: 9187
28{{- end }}