From 4b89b9a6dc7dfdab86571328e29c6f336cc165bb Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Wed, 11 Aug 2021 14:59:44 +0200 Subject: [PATCH] feat: add Istio support for NATS mqtt --- charts/kubezero-mq/Chart.yaml | 2 +- .../templates/nats/istio-service.yaml | 22 +++++++++++++++++++ charts/kubezero-mq/values.yaml | 5 +++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 charts/kubezero-mq/templates/nats/istio-service.yaml diff --git a/charts/kubezero-mq/Chart.yaml b/charts/kubezero-mq/Chart.yaml index 0f65f564..c7caea3e 100644 --- a/charts/kubezero-mq/Chart.yaml +++ b/charts/kubezero-mq/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-mq description: KubeZero umbrella chart for MQ systems like NATS, RabbitMQ type: application -version: 0.2.1 +version: 0.2.2 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png keywords: diff --git a/charts/kubezero-mq/templates/nats/istio-service.yaml b/charts/kubezero-mq/templates/nats/istio-service.yaml new file mode 100644 index 00000000..1d867eec --- /dev/null +++ b/charts/kubezero-mq/templates/nats/istio-service.yaml @@ -0,0 +1,22 @@ +{{- if .Values.nats.istio.enabled }} +apiVersion: networking.istio.io/v1beta1 +kind: VirtualService +metadata: + name: {{ .Release.Name }}-nats + namespace: {{ .Release.Namespace }} + labels: +{{ include "kubezero-lib.labels" . | indent 4 }} +spec: + hosts: + - {{ .Values.nats.istio.url }} + gateways: + - {{ .Values.nats.istio.gateway }} + tcp: + - match: + - port: 1883 + route: + - destination: + host: {{ .Release.Name }}-nats + port: + number: 1883 +{{- end }} diff --git a/charts/kubezero-mq/values.yaml b/charts/kubezero-mq/values.yaml index ae0b0fb0..01334255 100644 --- a/charts/kubezero-mq/values.yaml +++ b/charts/kubezero-mq/values.yaml @@ -18,6 +18,11 @@ nats: mqtt: enabled: false + istio: + enabled: false + # url: "mq.example.com" + gateway: istio-ingress/private-ingressgateway + # rabbitmq rabbitmq: enabled: false