Merge "Fixed override issue"
[it/dep.git] / ric-aux / helm / infrastructure / subcharts / kong / charts / postgresql / templates / networkpolicy.yaml
1 {{- if .Values.networkPolicy.enabled }}
2 kind: NetworkPolicy
3 apiVersion: {{ template "postgresql.networkPolicy.apiVersion" . }}
4 metadata:
5   name: {{ template "postgresql.fullname" . }}
6   labels:
7     app: {{ template "postgresql.name" . }}
8     chart: {{ template "postgresql.chart" . }}
9     release: {{ .Release.Name | quote }}
10     heritage: {{ .Release.Service | quote }}
11 spec:
12   podSelector:
13     matchLabels:
14       app: {{ template "postgresql.name" . }}
15       release: {{ .Release.Name | quote }}
16   ingress:
17     # Allow inbound connections
18     - ports:
19         - port: {{ template "postgresql.port" . }}
20       {{- if not .Values.networkPolicy.allowExternal }}
21       from:
22         - podSelector:
23             matchLabels:
24               {{ template "postgresql.fullname" . }}-client: "true"
25           {{- if .Values.networkPolicy.explicitNamespacesSelector }}
26           namespaceSelector:
27 {{ toYaml .Values.networkPolicy.explicitNamespacesSelector | indent 12 }}
28           {{- end }}
29         - podSelector:
30             matchLabels:
31               app: {{ template "postgresql.name" . }}
32               release: {{ .Release.Name | quote }}
33               role: slave
34       {{- end }}
35     # Allow prometheus scrapes
36     - ports:
37         - port: 9187
38 {{- end }}