From e848fb56f816aebaae932020a90208d02e41280f Mon Sep 17 00:00:00 2001 From: Frank Kloeker Date: Fri, 10 Jan 2025 10:18:44 +0100 Subject: [PATCH] reorder networkpolicies --- chart/templates/entsoe-deployment.yaml | 20 -------------------- chart/templates/entsoe-networkpolicy.yaml | 22 +++++++++++++++++++++- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/chart/templates/entsoe-deployment.yaml b/chart/templates/entsoe-deployment.yaml index a131079..474d608 100644 --- a/chart/templates/entsoe-deployment.yaml +++ b/chart/templates/entsoe-deployment.yaml @@ -63,24 +63,4 @@ spec: - name: tmp emptyDir: medium: Memory -{{ if .Values.entsoe.proxy.enabled }} ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: entsoe-{{ include "caas-carbon-footprint.fullname" . }} -spec: - egress: - - ports: - - port: {{ .Values.entsoe.proxy.port }} - protocol: TCP - to: - - ipBlock: - cidr: {{ .Values.entsoe.proxy.host }}/32 - podSelector: - matchLabels: - {{- include "caas-carbon-footprint.selectorLabels" . | nindent 6 }} - policyTypes: - - Egress -{{ end }} {{ end }} diff --git a/chart/templates/entsoe-networkpolicy.yaml b/chart/templates/entsoe-networkpolicy.yaml index fb89a95..8bb6b79 100644 --- a/chart/templates/entsoe-networkpolicy.yaml +++ b/chart/templates/entsoe-networkpolicy.yaml @@ -2,7 +2,7 @@ apiVersion: networking.k8s.io/v1 kind: NetworkPolicy metadata: - name: entsoe-{{ include "caas-carbon-footprint.fullname" . }} + name: entsoe-monitor-{{ include "caas-carbon-footprint.fullname" . }} labels: app.kubernetes.io/component: entsoe {{- include "caas-carbon-footprint.labels" . | nindent 4 }} @@ -21,4 +21,24 @@ spec: policyTypes: - Ingress - Egress +{{ if .Values.entsoe.proxy.enabled }} +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: entsoe-proxy-{{ include "caas-carbon-footprint.fullname" . }} +spec: + egress: + - ports: + - port: {{ .Values.entsoe.proxy.port }} + protocol: TCP + to: + - ipBlock: + cidr: {{ .Values.entsoe.proxy.host }}/32 + podSelector: + matchLabels: + {{- include "caas-carbon-footprint.selectorLabels" . | nindent 6 }} + policyTypes: + - Egress +{{ end }} {{ end }}