Skip to content

Commit 12b46df

Browse files
authored
Adjust Helm Chart templates in dev branch (#7353)
1 parent bacb7c1 commit 12b46df

13 files changed

Lines changed: 165 additions & 217 deletions

deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,22 @@ If release name contains chart name it will be used as a full name.
2727
{{- end -}}
2828

2929
{{/*
30-
Create a default docker image fullname.
30+
Create default docker images' fullname.
3131
*/}}
32-
{{- define "dolphinscheduler.image.fullname" -}}
33-
{{- .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion -}}
32+
{{- define "dolphinscheduler.image.fullname.master" -}}
33+
{{- .Values.image.registry }}/dolphinscheduler-master:{{ .Values.image.tag | default .Chart.AppVersion -}}
34+
{{- end -}}
35+
{{- define "dolphinscheduler.image.fullname.worker" -}}
36+
{{- .Values.image.registry }}/dolphinscheduler-worker:{{ .Values.image.tag | default .Chart.AppVersion -}}
37+
{{- end -}}
38+
{{- define "dolphinscheduler.image.fullname.api" -}}
39+
{{- .Values.image.registry }}/dolphinscheduler-api:{{ .Values.image.tag | default .Chart.AppVersion -}}
40+
{{- end -}}
41+
{{- define "dolphinscheduler.image.fullname.alert" -}}
42+
{{- .Values.image.registry }}/dolphinscheduler-alert-server:{{ .Values.image.tag | default .Chart.AppVersion -}}
43+
{{- end -}}
44+
{{- define "dolphinscheduler.image.fullname.tools" -}}
45+
{{- .Values.image.registry }}/dolphinscheduler-tools:{{ .Values.image.tag | default .Chart.AppVersion -}}
3446
{{- end -}}
3547

3648
{{/*
@@ -108,37 +120,25 @@ Create a default fully qualified zookkeeper quorum.
108120
Create a database environment variables.
109121
*/}}
110122
{{- define "dolphinscheduler.database.env_vars" -}}
111-
- name: DATABASE_TYPE
123+
- name: DATABASE
112124
{{- if .Values.postgresql.enabled }}
113125
value: "postgresql"
114126
{{- else }}
115127
value: {{ .Values.externalDatabase.type | quote }}
116128
{{- end }}
117-
- name: DATABASE_DRIVER
118-
{{- if .Values.postgresql.enabled }}
119-
value: "org.postgresql.Driver"
120-
{{- else }}
121-
value: {{ .Values.externalDatabase.driver | quote }}
122-
{{- end }}
123-
- name: DATABASE_HOST
124-
{{- if .Values.postgresql.enabled }}
125-
value: {{ template "dolphinscheduler.postgresql.fullname" . }}
126-
{{- else }}
127-
value: {{ .Values.externalDatabase.host | quote }}
128-
{{- end }}
129-
- name: DATABASE_PORT
129+
- name: SPRING_DATASOURCE_URL
130130
{{- if .Values.postgresql.enabled }}
131-
value: "5432"
131+
value: jdbc:postgresql://{{ template "dolphinscheduler.postgresql.fullname" . }}:5432/{{ .Values.postgresql.postgresqlDatabase }}?characterEncoding=utf8
132132
{{- else }}
133-
value: {{ .Values.externalDatabase.port | quote }}
133+
value: jdbc:{{ .Values.externalDatabase.type }}://{{ .Values.externalDatabase.host }}:{{ .Values.externalDatabase.port }}/{{ .Values.externalDatabase.database }}?{{ .Values.externalDatabase.params }}
134134
{{- end }}
135-
- name: DATABASE_USERNAME
135+
- name: SPRING_DATASOURCE_USERNAME
136136
{{- if .Values.postgresql.enabled }}
137137
value: {{ .Values.postgresql.postgresqlUsername }}
138138
{{- else }}
139139
value: {{ .Values.externalDatabase.username | quote }}
140140
{{- end }}
141-
- name: DATABASE_PASSWORD
141+
- name: SPRING_DATASOURCE_PASSWORD
142142
valueFrom:
143143
secretKeyRef:
144144
{{- if .Values.postgresql.enabled }}
@@ -148,31 +148,33 @@ Create a database environment variables.
148148
name: {{ include "dolphinscheduler.fullname" . }}-externaldb
149149
key: database-password
150150
{{- end }}
151-
- name: DATABASE_DATABASE
152-
{{- if .Values.postgresql.enabled }}
153-
value: {{ .Values.postgresql.postgresqlDatabase }}
154-
{{- else }}
155-
value: {{ .Values.externalDatabase.database | quote }}
156-
{{- end }}
157-
- name: DATABASE_PARAMS
158-
{{- if .Values.postgresql.enabled }}
159-
value: "characterEncoding=utf8"
160-
{{- else }}
161-
value: {{ .Values.externalDatabase.params | quote }}
162-
{{- end }}
151+
{{- end -}}
152+
153+
{{/*
154+
Wait for database to be ready.
155+
*/}}
156+
{{- define "dolphinscheduler.database.wait-for-ready" -}}
157+
- name: wait-for-database
158+
image: busybox:1.30
159+
imagePullPolicy: IfNotPresent
160+
{{- if .Values.postgresql.enabled }}
161+
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']
162+
{{- else }}
163+
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']
164+
{{- end }}
163165
{{- end -}}
164166

165167
{{/*
166168
Create a registry environment variables.
167169
*/}}
168170
{{- define "dolphinscheduler.registry.env_vars" -}}
169-
- name: REGISTRY_PLUGIN_NAME
171+
- name: REGISTRY_TYPE
170172
{{- if .Values.zookeeper.enabled }}
171173
value: "zookeeper"
172174
{{- else }}
173175
value: {{ .Values.externalRegistry.registryPluginName }}
174176
{{- end }}
175-
- name: REGISTRY_SERVERS
177+
- name: REGISTRY_ZOOKEEPER_CONNECT_STRING
176178
{{- if .Values.zookeeper.enabled }}
177179
value: {{ template "dolphinscheduler.zookeeper.quorum" . }}
178180
{{- else }}

deploy/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-alert.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

deploy/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-api.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

deploy/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-master.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

deploy/kubernetes/dolphinscheduler/templates/configmap-dolphinscheduler-worker.yaml

Lines changed: 0 additions & 29 deletions
This file was deleted.

deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-alert.yaml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,30 +57,32 @@ spec:
5757
{{- end }}
5858
containers:
5959
- name: {{ include "dolphinscheduler.fullname" . }}-alert
60-
image: {{ include "dolphinscheduler.image.fullname" . }}
60+
image: {{ include "dolphinscheduler.image.fullname.alert" . }}
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
62-
args:
63-
- "alert-server"
6462
ports:
6563
- containerPort: 50052
6664
name: "alert-port"
65+
- containerPort: 50053
66+
name: "actuator-port"
6767
env:
6868
- name: TZ
6969
value: {{ .Values.timezone }}
7070
{{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
71+
{{ range $key, $value := .Values.alert.env }}
72+
- name: {{ $key }}
73+
value: {{ $value | quote }}
74+
{{ end }}
7175
envFrom:
7276
- configMapRef:
7377
name: {{ include "dolphinscheduler.fullname" . }}-common
74-
- configMapRef:
75-
name: {{ include "dolphinscheduler.fullname" . }}-alert
7678
{{- if .Values.alert.resources }}
7779
resources:
7880
{{- toYaml .Values.alert.resources | nindent 12 }}
7981
{{- end }}
8082
{{- if .Values.alert.livenessProbe.enabled }}
8183
livenessProbe:
8284
exec:
83-
command: ["bash", "/root/checkpoint.sh", "AlertServer"]
85+
command: ["curl", "-s", "http://localhost:50053/actuator/health/liveness"]
8486
initialDelaySeconds: {{ .Values.alert.livenessProbe.initialDelaySeconds }}
8587
periodSeconds: {{ .Values.alert.livenessProbe.periodSeconds }}
8688
timeoutSeconds: {{ .Values.alert.livenessProbe.timeoutSeconds }}
@@ -90,7 +92,7 @@ spec:
9092
{{- if .Values.alert.readinessProbe.enabled }}
9193
readinessProbe:
9294
exec:
93-
command: ["bash", "/root/checkpoint.sh", "AlertServer"]
95+
command: ["curl", "-s", "http://localhost:50053/actuator/health/readiness"]
9496
initialDelaySeconds: {{ .Values.alert.readinessProbe.initialDelaySeconds }}
9597
periodSeconds: {{ .Values.alert.readinessProbe.periodSeconds }}
9698
timeoutSeconds: {{ .Values.alert.readinessProbe.timeoutSeconds }}
@@ -107,4 +109,4 @@ spec:
107109
claimName: {{ include "dolphinscheduler.fullname" . }}-alert
108110
{{- else }}
109111
emptyDir: {}
110-
{{- end }}
112+
{{- end }}

deploy/kubernetes/dolphinscheduler/templates/deployment-dolphinscheduler-api.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,8 @@ spec:
5757
{{- end }}
5858
containers:
5959
- name: {{ include "dolphinscheduler.fullname" . }}-api
60-
image: {{ include "dolphinscheduler.image.fullname" . }}
60+
image: {{ include "dolphinscheduler.image.fullname.api" . }}
6161
imagePullPolicy: {{ .Values.image.pullPolicy }}
62-
args:
63-
- "api-server"
6462
ports:
6563
- containerPort: 12345
6664
name: "api-port"
@@ -70,19 +68,21 @@ spec:
7068
{{- include "dolphinscheduler.database.env_vars" . | nindent 12 }}
7169
{{- include "dolphinscheduler.registry.env_vars" . | nindent 12 }}
7270
{{- include "dolphinscheduler.fs_s3a.env_vars" . | nindent 12 }}
71+
{{ range $key, $value := .Values.api.env }}
72+
- name: {{ $key }}
73+
value: {{ $value | quote }}
74+
{{ end }}
7375
envFrom:
7476
- configMapRef:
7577
name: {{ include "dolphinscheduler.fullname" . }}-common
76-
- configMapRef:
77-
name: {{ include "dolphinscheduler.fullname" . }}-api
7878
{{- if .Values.api.resources }}
7979
resources:
8080
{{- toYaml .Values.api.resources | nindent 12 }}
8181
{{- end }}
8282
{{- if .Values.api.livenessProbe.enabled }}
8383
livenessProbe:
8484
exec:
85-
command: ["bash", "/root/checkpoint.sh", "ApiApplicationServer"]
85+
command: ["curl", "-s", "http://localhost:12345/actuator/health/liveness"]
8686
initialDelaySeconds: {{ .Values.api.livenessProbe.initialDelaySeconds }}
8787
periodSeconds: {{ .Values.api.livenessProbe.periodSeconds }}
8888
timeoutSeconds: {{ .Values.api.livenessProbe.timeoutSeconds }}
@@ -92,7 +92,7 @@ spec:
9292
{{- if .Values.api.readinessProbe.enabled }}
9393
readinessProbe:
9494
exec:
95-
command: ["bash", "/root/checkpoint.sh", "ApiApplicationServer"]
95+
command: ["curl", "-s", "http://localhost:12345/actuator/health/readiness"]
9696
initialDelaySeconds: {{ .Values.api.readinessProbe.initialDelaySeconds }}
9797
periodSeconds: {{ .Values.api.readinessProbe.periodSeconds }}
9898
timeoutSeconds: {{ .Values.api.readinessProbe.timeoutSeconds }}
@@ -113,4 +113,4 @@ spec:
113113
emptyDir: {}
114114
{{- end }}
115115
{{- include "dolphinscheduler.sharedStorage.volume" . | nindent 8 }}
116-
{{- include "dolphinscheduler.fsFileResource.volume" . | nindent 8 }}
116+
{{- include "dolphinscheduler.fsFileResource.volume" . | nindent 8 }}

0 commit comments

Comments
 (0)