Dominic Lunanuova | 50aafc5 | 2018-03-30 02:29:23 +0000 | [diff] [blame^] | 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.fullname" . }} |
| 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" |
| 9 | release: "{{ .Release.Name }}" |
| 10 | heritage: "{{ .Release.Service }}" |
| 11 | spec: |
| 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 }} |