From 9f3da2ba4b4062331f37a07ed696ac2f8af55009 Mon Sep 17 00:00:00 2001 From: Quan TRAN Date: Wed, 31 Aug 2022 10:09:40 +0200 Subject: [PATCH] Create networkpolicy.yaml --- helm/akhq/Chart.yaml | 2 +- helm/akhq/templates/networkpolicy.yaml | 25 +++++++++++++++++++++++++ helm/akhq/values.yaml | 3 +++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 helm/akhq/templates/networkpolicy.yaml diff --git a/helm/akhq/Chart.yaml b/helm/akhq/Chart.yaml index 9b2587b91..6fb133466 100644 --- a/helm/akhq/Chart.yaml +++ b/helm/akhq/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "0.22.0" description: Kafka GUI for Apache Kafka to manage topics, topics data, consumers group, schema registry, connect and more... name: akhq -version: 0.2.9 +version: 0.3.0 keywords: - kafka - confluent diff --git a/helm/akhq/templates/networkpolicy.yaml b/helm/akhq/templates/networkpolicy.yaml new file mode 100644 index 000000000..8afff23ab --- /dev/null +++ b/helm/akhq/templates/networkpolicy.yaml @@ -0,0 +1,25 @@ +{{- if .Values.networkPolicy.enabled -}} +apiVersion: {{ template "networkPolicy.apiVersion" . }} +kind: NetworkPolicy +metadata: + name: {{ include "akhq.fullname" . }} + labels: + app.kubernetes.io/name: {{ include "akhq.name" . }} + helm.sh/chart: {{ include "akhq.chart" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + app.kubernetes.io/managed-by: {{ .Release.Service }} + {{- with .Values.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + policyTypes: + - Ingress + podSelector: + matchLabels: + app.kubernetes.io/name: {{ include "akhq.name" . }} + app.kubernetes.io/instance: {{ .Release.Name }} + ingress: + - ports: + - port: http + - port: management +{{- end }} diff --git a/helm/akhq/values.yaml b/helm/akhq/values.yaml index 302cfab46..66578d550 100644 --- a/helm/akhq/values.yaml +++ b/helm/akhq/values.yaml @@ -143,3 +143,6 @@ nodeSelector: {} tolerations: [] affinity: {} + +networkPolicy: + enabled: true