Skip to content

Commit 82bc0c3

Browse files
committed
chore(postgresql-cluster): Allow all ip when service type is Loadbalancer
1 parent dcf1243 commit 82bc0c3

1 file changed

Lines changed: 11 additions & 5 deletions

File tree

addons/postgresql-cluster/15/chart/postgresql-cluster/templates/networkpolicy.yaml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,33 @@ spec:
1717
podSelector:
1818
matchLabels:
1919
{{- include "common.labels.matchLabels" . | nindent 6 }}
20+
{{- if eq .Values.service.type "ClusterIP" }}
2021
ingress:
2122
# Allow inbound connections
2223
- ports:
2324
- port: 5432
2425
- port: 9000
25-
{{- if and .Values.metrics.enabled }}
26+
{{- if and .Values.metrics.enabled }}
2627
- port: {{ .Values.metrics.containerPort }}
27-
{{ end }}
28-
{{- if or .Values.networkPolicy.allowCurrentNamespace .Values.networkPolicy.allowNamespaces }}
28+
{{ end }}
29+
{{- if or .Values.networkPolicy.allowCurrentNamespace .Values.networkPolicy.allowNamespaces }}
2930
from:
3031
{{- if .Values.networkPolicy.allowCurrentNamespace }}
3132
- namespaceSelector:
3233
matchLabels:
3334
kubernetes.io/metadata.name: {{ .Release.Namespace }}
3435
{{- end }}
3536
{{- range $namespace := .Values.networkPolicy.allowNamespaces }}
36-
{{- if $namespace }}
37+
{{- if $namespace }}
3738
- namespaceSelector:
3839
matchLabels:
3940
kubernetes.io/metadata.name: {{ $namespace }}
41+
{{- end }}
4042
{{- end }}
41-
{{- end }}
43+
{{- end }}
44+
{{- end }}
45+
{{- if eq .Values.service.type "LoadBalancer" }}
46+
ingress:
47+
- {}
4248
{{- end }}
4349
{{- end }}

0 commit comments

Comments
 (0)