From 09d1f389e6317e3683b323a338d8686df658332d Mon Sep 17 00:00:00 2001 From: Liu Ziming Date: Thu, 13 Apr 2023 19:14:18 +0800 Subject: [PATCH] feat: add helm support for governance module (#3256) --- .../governance-example/helm-chart/Chart.yaml | 5 ++ .../helm-chart/templates/auth-mvc-cm.yaml | 10 ++++ .../helm-chart/templates/auth-mvc.yaml | 39 +++++++++++++++ .../helm-chart/templates/auth-webflux-cm.yaml | 10 ++++ .../helm-chart/templates/auth-webflux.yaml | 39 +++++++++++++++ .../templates/default-provider-version.yaml | 22 +++++++++ .../templates/istio-consumer-cm.yaml | 10 ++++ .../helm-chart/templates/istio-consumer.yaml | 25 ++++++++++ .../helm-chart/templates/nacos-server-cm.yaml | 11 +++++ .../helm-chart/templates/nacos-server.yaml | 47 +++++++++++++++++++ .../templates/provider-version.yaml | 22 +++++++++ .../governance-example/helm-chart/values.yaml | 21 +++++++++ 12 files changed, 261 insertions(+) create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/Chart.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc-cm.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux-cm.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/default-provider-version.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer-cm.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server-cm.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/templates/provider-version.yaml create mode 100644 spring-cloud-alibaba-examples/governance-example/helm-chart/values.yaml diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/Chart.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/Chart.yaml new file mode 100644 index 0000000000..089392b72f --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v1 +appVersion: '1.0' +description: Spring Cloud Alibaba Governance Example +name: governance-example +version: 1.0.0 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc-cm.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc-cm.yaml new file mode 100644 index 0000000000..7614470266 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc-cm.yaml @@ -0,0 +1,10 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + app: auth-mvc + name: auth-mvc-env +data: + NAMESPACE_NAME: {{ .Release.Namespace | quote }} + ISTIOD_ADDR: {{ .Values.istiodAddr | quote }} + POLLING_TIME: {{ .Values.defaultPollingTime | quote }} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc.yaml new file mode 100644 index 0000000000..f2b733b487 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-mvc.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: auth-mvc +spec: + replicas: 1 + selector: + matchLabels: + app: auth-mvc + template: + metadata: + labels: + appName: auth-mvc + app: auth-mvc + spec: + containers: + - name: auth-mvc + image: '{{ .Values.image.authMvc.repository }}:{{ .Values.image.authMvc.tag }}' + imagePullPolicy: Always + ports: + - name: http-port + containerPort: 80 + envFrom: + - configMapRef: + name: auth-mvc-env +--- +apiVersion: v1 +kind: Service +metadata: + name: auth-mvc + labels: + app: auth-mvc +spec: + type: ClusterIP + ports: + - port: 80 + name: http-server + selector: + app: auth-mvc \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux-cm.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux-cm.yaml new file mode 100644 index 0000000000..059d66b22c --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux-cm.yaml @@ -0,0 +1,10 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + app: auth-webflux + name: auth-webflux-env +data: + NAMESPACE_NAME: {{ .Release.Namespace | quote }} + ISTIOD_ADDR: {{ .Values.istiodAddr | quote }} + POLLING_TIME: {{ .Values.defaultPollingTime | quote }} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux.yaml new file mode 100644 index 0000000000..2c90c7bde9 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/auth-webflux.yaml @@ -0,0 +1,39 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: auth-webflux +spec: + replicas: 1 + selector: + matchLabels: + app: auth-webflux + template: + metadata: + labels: + appName: auth-webflux + app: auth-webflux + spec: + containers: + - name: auth-webflux + image: '{{ .Values.image.authWebflux.repository }}:{{ .Values.image.authWebflux.tag }}' + imagePullPolicy: Always + ports: + - name: http-port + containerPort: 80 + envFrom: + - configMapRef: + name: auth-webflux-env +--- +apiVersion: v1 +kind: Service +metadata: + name: auth-webflux + labels: + app: auth-webflux +spec: + type: ClusterIP + ports: + - port: 80 + name: http-server + selector: + app: auth-webflux \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/default-provider-version.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/default-provider-version.yaml new file mode 100644 index 0000000000..a9a55ed83d --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/default-provider-version.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: default-provider-version +spec: + replicas: 1 + selector: + matchLabels: + app: default-provider-version + template: + metadata: + labels: + appName: default-provider-version + app: default-provider-version + spec: + containers: + - name: default-provider-version + image: '{{ .Values.image.defaultProviderVersion.repository }}:{{ .Values.image.defaultProviderVersion.tag }}' + imagePullPolicy: Always + ports: + - name: feign-port + containerPort: 18081 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer-cm.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer-cm.yaml new file mode 100644 index 0000000000..b08b4b17a8 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer-cm.yaml @@ -0,0 +1,10 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + app: istio-consumer + name: istio-consumer-env +data: + NAMESPACE_NAME: {{ .Release.Namespace | quote }} + ISTIOD_ADDR: {{ .Values.istiodAddr | quote }} + POLLING_TIME: {{ .Values.defaultPollingTime | quote }} \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer.yaml new file mode 100644 index 0000000000..7b4a68a643 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/istio-consumer.yaml @@ -0,0 +1,25 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: istio-consumer +spec: + replicas: 1 + selector: + matchLabels: + app: istio-consumer + template: + metadata: + labels: + appName: istio-consumer + app: istio-consumer + spec: + containers: + - name: istio-consumer + image: '{{ .Values.image.istioConsumer.repository }}:{{ .Values.image.istioConsumer.tag }}' + imagePullPolicy: Always + ports: + - name: feign-port + containerPort: 18084 + envFrom: + - configMapRef: + name: istio-consumer-env \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server-cm.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server-cm.yaml new file mode 100644 index 0000000000..4a00ca803e --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server-cm.yaml @@ -0,0 +1,11 @@ +kind: ConfigMap +apiVersion: v1 +metadata: + labels: + app: nacos-server + name: nacos-server-env +data: + NAMESPACE_NAME: {{ .Release.Namespace | quote }} + ISTIOD_ADDR: {{ .Values.istiodAddr | quote }} + POLLING_TIME: {{ .Values.defaultPollingTime | quote }} + MODE: "standalone" \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server.yaml new file mode 100644 index 0000000000..182881f142 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/nacos-server.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nacos-server +spec: + replicas: 1 + selector: + matchLabels: + app: nacos-server + template: + metadata: + labels: + appName: nacos-server + app: nacos-server + spec: + containers: + - name: nacos-server + image: '{{ .Values.image.nacosServer.repository }}:{{ .Values.image.nacosServer.tag }}' + imagePullPolicy: Always + ports: + - containerPort: 8848 + name: "nacos-8848" + - containerPort: 9848 + name: "nacos-9848" + - containerPort: 9849 + name: "nacos-9849" + envFrom: + - configMapRef: + name: nacos-server-env +--- +apiVersion: v1 +kind: Service +metadata: + name: nacos-server + labels: + app: nacos-server +spec: + type: ClusterIP + ports: + - port: 8848 + name: "nacos-8848" + - port: 9848 + name: "nacos-9848" + - port: 9849 + name: "nacos-9849" + selector: + app: nacos-server \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/provider-version.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/provider-version.yaml new file mode 100644 index 0000000000..7b4cd98999 --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/templates/provider-version.yaml @@ -0,0 +1,22 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: provider-version +spec: + replicas: 1 + selector: + matchLabels: + app: provider-version + template: + metadata: + labels: + appName: provider-version + app: provider-version + spec: + containers: + - name: provider-version + image: '{{ .Values.image.providerVersion.repository }}:{{ .Values.image.providerVersion.tag }}' + imagePullPolicy: Always + ports: + - name: feign-port + containerPort: 18082 \ No newline at end of file diff --git a/spring-cloud-alibaba-examples/governance-example/helm-chart/values.yaml b/spring-cloud-alibaba-examples/governance-example/helm-chart/values.yaml new file mode 100644 index 0000000000..8af3d1c1dc --- /dev/null +++ b/spring-cloud-alibaba-examples/governance-example/helm-chart/values.yaml @@ -0,0 +1,21 @@ +image: + authMvc: + repository: registry.cn-shenzhen.aliyuncs.com/sca-demo/auth-demo-mvc + tag: develop + authWebflux: + repository: registry.cn-shenzhen.aliyuncs.com/sca-demo/auth-demo-webflux + tag: develop + defaultProviderVersion: + repository: registry.cn-shenzhen.aliyuncs.com/sca-demo/default-provider-version-example + tag: develop + providerVersion: + repository: registry.cn-shenzhen.aliyuncs.com/sca-demo/provider-version-example + tag: develop + istioConsumer: + repository: registry.cn-shenzhen.aliyuncs.com/sca-demo/istio-consumer-example + tag: develop + nacosServer: + repository: nacos/nacos-server + tag: v2.1.0 +istiodAddr: istiod.istio-system.svc.cluster.local +defaultPollingTime: 60 \ No newline at end of file