diff --git a/helm-chart/renku/templates/network-policies.yaml b/helm-chart/renku/templates/network-policies.yaml index 42c10a653..8651251be 100644 --- a/helm-chart/renku/templates/network-policies.yaml +++ b/helm-chart/renku/templates/network-policies.yaml @@ -94,13 +94,15 @@ spec: namespaceSelector: matchLabels: kubernetes.io/metadata.name: {{ .Release.Namespace }} + - podSelector: + matchLabels: + app: postgres-setup + namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: {{ .Release.Namespace }} ports: - protocol: TCP port: 5432 - - from: - - podSelector: {} - namespaceSelector: {} - ports: - protocol: TCP port: 9187 {{- end }} diff --git a/helm-chart/renku/templates/setup-job-network-policy.yaml b/helm-chart/renku/templates/setup-job-network-policy.yaml deleted file mode 100644 index 736a0713d..000000000 --- a/helm-chart/renku/templates/setup-job-network-policy.yaml +++ /dev/null @@ -1,35 +0,0 @@ -{{- if not .Values.global.externalServices.postgresql.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: {{ template "renku.fullname" . }}-setup-job - labels: - app: {{ template "renku.name" . }} - chart: {{ template "renku.chart" . }} - release: {{ .Release.Name }} - heritage: {{ .Release.Service }} -spec: - podSelector: - matchLabels: - app.kubernetes.io/name: postgresql - policyTypes: - - Ingress - ingress: - - from: - - podSelector: - matchLabels: - app: postgres-setup - namespaceSelector: - matchLabels: - kubernetes.io/metadata.name: {{ .Release.Namespace }} - ports: - - protocol: TCP - port: 5432 - - from: - - podSelector: {} - namespaceSelector: {} - ports: - - protocol: TCP - port: 9187 -{{- end }}