You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by ke...@apache.org on 2022/10/24 13:55:59 UTC

[dolphinscheduler] branch helm created (now e1410fc616)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a change to branch helm
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git


      at e1410fc616 Add mysql support to helm chart

This branch includes the following new commits:

     new e1410fc616 Add mysql support to helm chart

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[dolphinscheduler] 01/01: Add mysql support to helm chart

Posted by ke...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch helm
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit e1410fc61621300904a88e764c59ffca438fa062
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Mon Oct 24 21:55:48 2022 +0800

    Add mysql support to helm chart
---
 deploy/kubernetes/dolphinscheduler/Chart.yaml      |  6 +++-
 .../dolphinscheduler/templates/_helpers.tpl        | 32 ++++++++++++++++++----
 .../deployment-dolphinscheduler-alert.yaml         |  3 +-
 .../dolphinscheduler/templates/ingress.yaml        |  2 +-
 deploy/kubernetes/dolphinscheduler/values.yaml     | 19 ++++++++++++-
 5 files changed, 52 insertions(+), 10 deletions(-)

diff --git a/deploy/kubernetes/dolphinscheduler/Chart.yaml b/deploy/kubernetes/dolphinscheduler/Chart.yaml
index 6ad2f989de..f143f059e3 100644
--- a/deploy/kubernetes/dolphinscheduler/Chart.yaml
+++ b/deploy/kubernetes/dolphinscheduler/Chart.yaml
@@ -35,7 +35,7 @@ type: application
 
 # This is the chart version. This version number should be incremented each time you make changes
 # to the chart and its templates, including the app version.
-version: 2.0.0
+version: 3.1.0
 
 # This is the version number of the application being deployed. This version number should be
 # incremented each time you make changes to the application.
@@ -56,3 +56,7 @@ dependencies:
   # Same as above.
   repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
   condition: zookeeper.enabled
+- name: mysql
+  version: 9.4.1
+  repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
+  condition: mysql.enabled
diff --git a/deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl b/deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl
index 20d9a464be..a3eb2f37ba 100644
--- a/deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl
+++ b/deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl
@@ -30,19 +30,19 @@ If release name contains chart name it will be used as a full name.
 Create default docker images' fullname.
 */}}
 {{- define "dolphinscheduler.image.fullname.master" -}}
-{{- .Values.image.registry }}/dolphinscheduler-master:{{ .Values.image.tag | default .Chart.AppVersion -}}
+{{- .Values.image.registry }}/{{ .Values.image.master }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
 {{- end -}}
 {{- define "dolphinscheduler.image.fullname.worker" -}}
-{{- .Values.image.registry }}/dolphinscheduler-worker:{{ .Values.image.tag | default .Chart.AppVersion -}}
+{{- .Values.image.registry }}/{{ .Values.image.worker }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
 {{- end -}}
 {{- define "dolphinscheduler.image.fullname.api" -}}
-{{- .Values.image.registry }}/dolphinscheduler-api:{{ .Values.image.tag | default .Chart.AppVersion -}}
+{{- .Values.image.registry }}/{{ .Values.image.api }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
 {{- end -}}
 {{- define "dolphinscheduler.image.fullname.alert" -}}
-{{- .Values.image.registry }}/dolphinscheduler-alert-server:{{ .Values.image.tag | default .Chart.AppVersion -}}
+{{- .Values.image.registry }}/{{ .Values.image.alert }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
 {{- end -}}
 {{- define "dolphinscheduler.image.fullname.tools" -}}
-{{- .Values.image.registry }}/dolphinscheduler-tools:{{ .Values.image.tag | default .Chart.AppVersion -}}
+{{- .Values.image.registry }}/{{ .Values.image.tools }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
 {{- end -}}
 
 {{/*
@@ -100,7 +100,16 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
 {{- end -}}
 
 {{/*
-Create a default fully qualified zookkeeper name.
+Create a default fully qualified mysql name.
+We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
+*/}}
+{{- define "dolphinscheduler.mysql.fullname" -}}
+{{- $name := default "mysql" .Values.mysql.nameOverride -}}
+{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
+{{- end -}}
+
+{{/*
+Create a default fully qualified zookeeper name.
 We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
 */}}
 {{- define "dolphinscheduler.zookeeper.fullname" -}}
@@ -123,18 +132,24 @@ Create a database environment variables.
 - name: DATABASE
   {{- if .Values.postgresql.enabled }}
   value: "postgresql"
+  {{- else if .Values.mysql.enabled }}
+  value: "mysql"
   {{- else }}
   value: {{ .Values.externalDatabase.type | quote }}
   {{- end }}
 - name: SPRING_DATASOURCE_URL
   {{- if .Values.postgresql.enabled }}
   value: jdbc:postgresql://{{ template "dolphinscheduler.postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresqlDatabase }}?characterEncoding=utf8
+  {{- else if .Values.mysql.enabled }}
+  value: jdbc:mysql://{{ template "dolphinscheduler.mysql.fullname" . }}:3306/{{ .Values.postgresql.postgresqlDatabase }}?characterEncoding=utf8
   {{- else }}
   value: jdbc:{{ .Values.externalDatabase.type }}://{{ .Values.externalDatabase.host }}:{{ .Values.externalDatabase.port }}/{{ .Values.externalDatabase.database }}?{{ .Values.externalDatabase.params }}
   {{- end }}
 - name: SPRING_DATASOURCE_USERNAME
   {{- if .Values.postgresql.enabled }}
   value: {{ .Values.postgresql.postgresqlUsername }}
+  {{- else if .Values.mysql.enabled }}
+  value: {{ .Values.mysql.auth.username }}
   {{- else }}
   value: {{ .Values.externalDatabase.username | quote }}
   {{- end }}
@@ -144,6 +159,9 @@ Create a database environment variables.
       {{- if .Values.postgresql.enabled }}
       name: {{ template "dolphinscheduler.postgresql.fullname" . }}
       key: postgresql-password
+      {{- else if .Values.mysql.enabled }}
+      name: {{ template "dolphinscheduler.mysql.fullname" . }}
+      key: mysql-password
       {{- else }}
       name: {{ include "dolphinscheduler.fullname" . }}-externaldb
       key: database-password
@@ -159,6 +177,8 @@ Wait for database to be ready.
   imagePullPolicy: IfNotPresent
 {{- if .Values.postgresql.enabled }}
   command: ['sh', '-xc', 'for i in $(seq 1 180); do nc -z -w3 {{ template "dolphinscheduler.postgresql.fullname" . }} 5432 && exit 0 || sleep 5; done; exit 1']
+{{- else if .Values.mysql.enabled }}
+  command: ['sh', '-xc', 'for i in $(seq 1 180); do nc -z -w3 {{ template "dolphinscheduler.mysql.fullname" . }} 3306 && exit 0 || sleep 5; done; exit 1']
 {{- else }}
   command: ['sh', '-xc', 'for i in $(seq 1 180); do nc -z -w3 {{ .Values.externalDatabase.host }} {{ .Values.externalDatabase.port }} && exit 0 || sleep 5; done; exit 1']
 {{- end }}
diff --git a/deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml b/deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
index 3f7f2796d7..e2ee9f64d1 100644
--- a/deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
+++ b/deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml
@@ -70,6 +70,7 @@ spec:
             - name: SPRING_JACKSON_TIME_ZONE
               value: {{ .Values.timezone }}
             {{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
+            {{- include "dolphinscheduler.registry.env_vars" . | nindent 12 }}
             {{ range $key, $value :=  .Values.alert.env }}
             - name: {{ $key }}
               value: {{ $value | quote }}
@@ -117,4 +118,4 @@ spec:
           {{- end }}
         - name: config-volume
           configMap:
-            name: {{ include "dolphinscheduler.fullname" . }}-configs
\ No newline at end of file
+            name: {{ include "dolphinscheduler.fullname" . }}-configs
diff --git a/deploy/kubernetes/dolphinscheduler/templates/ingress.yaml b/deploy/kubernetes/dolphinscheduler/templates/ingress.yaml
index e4b2ec337f..2cbe4183f9 100644
--- a/deploy/kubernetes/dolphinscheduler/templates/ingress.yaml
+++ b/deploy/kubernetes/dolphinscheduler/templates/ingress.yaml
@@ -34,7 +34,7 @@ metadata:
   {{- end }}
 spec:
   rules:
-  - host: {{ .Values.ingress.host }}
+  - host: "{{ .Values.ingress.host }}"
     http:
       paths:
         - path: {{ .Values.ingress.path }}
diff --git a/deploy/kubernetes/dolphinscheduler/values.yaml b/deploy/kubernetes/dolphinscheduler/values.yaml
index 440cda1f2f..2d00f31707 100644
--- a/deploy/kubernetes/dolphinscheduler/values.yaml
+++ b/deploy/kubernetes/dolphinscheduler/values.yaml
@@ -26,6 +26,11 @@ image:
   tag: "dev-SNAPSHOT"
   pullPolicy: "IfNotPresent"
   pullSecret: ""
+  master: dolphinscheduler-master
+  worker: dolphinscheduler-worker
+  api: dolphinscheduler-api
+  alert: dolphinscheduler-alert-server
+  tools: dolphinscheduler-tools
 
 ## If not exists external database, by default, Dolphinscheduler's database will use it.
 postgresql:
@@ -38,6 +43,18 @@ postgresql:
     size: "20Gi"
     storageClass: "-"
 
+mysql:
+  enabled: false
+  auth:
+    username: "ds"
+    password: "ds"
+    database: "dolphinscheduler"
+  primary:
+    persistence:
+      enabled: false
+      size: "20Gi"
+      storageClass: "-"
+
 ## If exists external database, and set postgresql.enable value to false.
 ## external database will be used, otherwise Dolphinscheduler's database will be used.
 externalDatabase:
@@ -53,7 +70,7 @@ externalDatabase:
 zookeeper:
   enabled: true
   service:
-    port: 2181 
+    port: 2181
   fourlwCommandsWhitelist: "srvr,ruok,wchs,cons"
   persistence:
     enabled: false