Skip to content

Commit b532fe5

Browse files
authored
[Improvement][Registry][Jdbc] Add jdbc registry config in helm charts (#14431)
* k8s support jdbc registryt * fix spotless * fix * update * update * update * update
1 parent d683553 commit b532fe5

8 files changed

Lines changed: 598 additions & 524 deletions

File tree

‎deploy/kubernetes/dolphinscheduler/templates/_helpers.tpl‎

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -252,28 +252,48 @@ Create a registry environment variables.
252252
- name: REGISTRY_TYPE
253253
{{- if .Values.zookeeper.enabled }}
254254
value: "zookeeper"
255-
{{- else if .Values.etcd.enabled }}
255+
{{- else if .Values.registryEtcd.enabled }}
256256
value: "etcd"
257+
{{- else if .Values.registryJdbc.enabled }}
258+
value: "jdbc"
257259
{{- else }}
258260
value: {{ .Values.externalRegistry.registryPluginName }}
259261
{{- end }}
260-
{{- if .Values.etcd.enabled }}
262+
{{- if .Values.registryEtcd.enabled }}
261263
- name: REGISTRY_ENDPOINTS
262-
value: {{ .Values.etcd.endpoints }}
264+
value: {{ .Values.registryEtcd.endpoints }}
263265
- name: REGISTRY_NAMESPACE
264-
value: {{ .Values.etcd.namespace }}
266+
value: {{ .Values.registryEtcd.namespace }}
265267
- name: REGISTRY_USER
266-
value: {{ .Values.etcd.user }}
268+
value: {{ .Values.registryEtcd.user }}
267269
- name: REGISTRY_PASSWORD
268-
value: {{ .Values.etcd.passWord }}
270+
value: {{ .Values.registryEtcd.passWord }}
269271
- name: REGISTRY_AUTHORITY
270-
value: {{ .Values.etcd.authority }}
272+
value: {{ .Values.registryEtcd.authority }}
271273
- name: REGISTRY_CERT_FILE
272-
value: {{ .Values.etcd.ssl.certFile }}
274+
value: {{ .Values.registryEtcd.ssl.certFile }}
273275
- name: REGISTRY_KEY_CERT_CHAIN_FILE
274-
value: {{ .Values.etcd.ssl.keyCertChainFile }}
276+
value: {{ .Values.registryEtcd.ssl.keyCertChainFile }}
275277
- name: REGISTRY_KEY_FILE
276-
value: {{ .Values.etcd.ssl.keyFile }}
278+
value: {{ .Values.registryEtcd.ssl.keyFile }}
279+
{{- else if .Values.registryJdbc.enabled }}
280+
- name: REGISTRY_TERM_REFRESH_INTERVAL
281+
value: {{ .Values.registryJdbc.termRefreshInterval }}
282+
- name: REGISTRY_TERM_EXPIRE_TIMES
283+
value: {{ .Values.registryJdbc.termExpireTimes | quote}}
284+
{{- if .Values.registryJdbc.hikariConfig.enabled }}
285+
- name: REGISTRY_HIKARI_CONFIG_DRIVER_CLASS_NAME
286+
value: {{ .Values.registryJdbc.hikariConfig.driverClassName }}
287+
- name: REGISTRY_HIKARI_CONFIG_JDBC_URL
288+
value: {{ .Values.registryJdbc.hikariConfig.jdbcurl }}
289+
- name: REGISTRY_HIKARI_CONFIG_USERNAME
290+
value: {{ .Values.registryJdbc.hikariConfig.username }}
291+
- name: REGISTRY_HIKARI_CONFIG_PASSWORD
292+
valueFrom:
293+
secretKeyRef:
294+
name: {{ include "dolphinscheduler.fullname" . }}-registry-db
295+
key: registry-password
296+
{{- end }}
277297
{{- else }}
278298
- name: REGISTRY_ZOOKEEPER_CONNECT_STRING
279299
{{- if .Values.zookeeper.enabled }}
@@ -330,7 +350,7 @@ Create a fsFileResourcePersistence volumeMount.
330350
Create a etcd ssl volume.
331351
*/}}
332352
{{- define "dolphinscheduler.etcd.ssl.volume" -}}
333-
{{- if .Values.etcd.ssl.enabled -}}
353+
{{- if .Values.registryEtcd.ssl.enabled -}}
334354
- name: etcd-ssl
335355
secret:
336356
secretName: {{ include "dolphinscheduler.fullname" . }}-etcd-ssl
@@ -341,14 +361,14 @@ Create a etcd ssl volume.
341361
Create a etcd ssl volumeMount.
342362
*/}}
343363
{{- define "dolphinscheduler.etcd.ssl.volumeMount" -}}
344-
{{- if .Values.etcd.ssl.enabled -}}
345-
- mountPath: /opt/dolphinscheduler/{{ .Values.etcd.ssl.certFile }}
364+
{{- if .Values.registryEtcd.ssl.enabled -}}
365+
- mountPath: /opt/dolphinscheduler/{{ .Values.registryEtcd.ssl.certFile }}
346366
name: etcd-ssl
347367
subPath: cert-file
348-
- mountPath: /opt/dolphinscheduler/{{ .Values.etcd.ssl.keyCertChainFile }}
368+
- mountPath: /opt/dolphinscheduler/{{ .Values.registryEtcd.ssl.keyCertChainFile }}
349369
name: etcd-ssl
350370
subPath: key-cert-chain-file
351-
- mountPath: /opt/dolphinscheduler/{{ .Values.etcd.ssl.keyFile }}
371+
- mountPath: /opt/dolphinscheduler/{{ .Values.registryEtcd.ssl.keyFile }}
352372
name: etcd-ssl
353373
subPath: key-file
354374
{{- end -}}

‎deploy/kubernetes/dolphinscheduler/templates/secret-external-database.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ metadata:
2525
type: Opaque
2626
data:
2727
database-password: {{ .Values.externalDatabase.password | b64enc | quote }}
28-
{{- end }}
28+
{{- end }}

‎deploy/kubernetes/dolphinscheduler/templates/secret-external-etcd-ssl.yaml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
{{- if .Values.etcd.ssl.enabled }}
17+
{{- if .Values.registryEtcd.ssl.enabled }}
1818
apiVersion: v1
1919
kind: Secret
2020
metadata:
@@ -24,7 +24,7 @@ metadata:
2424
{{- include "dolphinscheduler.common.labels" . | nindent 4 }}
2525
type: Opaque
2626
data:
27-
cert-file: {{ .Files.Get .Values.etcd.ssl.certFile | b64enc | quote }}
28-
key-cert-chain-file: {{ .Files.Get .Values.etcd.ssl.keyCertChainFile | b64enc | quote }}
29-
key-file: {{ .Files.Get .Values.etcd.ssl.keyFile | b64enc | quote }}
27+
cert-file: {{ .Files.Get .Values.registryEtcd.ssl.certFile | b64enc | quote }}
28+
key-cert-chain-file: {{ .Files.Get .Values.registryEtcd.ssl.keyCertChainFile | b64enc | quote }}
29+
key-file: {{ .Files.Get .Values.registryEtcd.ssl.keyFile | b64enc | quote }}
3030
{{- end }}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one or more
3+
# contributor license agreements. See the NOTICE file distributed with
4+
# this work for additional information regarding copyright ownership.
5+
# The ASF licenses this file to You under the Apache License, Version 2.0
6+
# (the "License"); you may not use this file except in compliance with
7+
# the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
{{- if .Values.registryJdbc.hikariConfig.enabled }}
18+
apiVersion: v1
19+
kind: Secret
20+
metadata:
21+
name: {{ include "dolphinscheduler.fullname" . }}-registry-db
22+
labels:
23+
app.kubernetes.io/name: {{ include "dolphinscheduler.fullname" . }}-registry-db
24+
{{- include "dolphinscheduler.common.labels" . | nindent 4 }}
25+
type: Opaque
26+
data:
27+
registry-password: {{ .Values.registryJdbc.hikariConfig.password | b64enc | quote }}
28+
{{- end }}

‎deploy/kubernetes/dolphinscheduler/values.yaml‎

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ zookeeper:
9797
size: "20Gi"
9898
storageClass: "-"
9999

100-
etcd:
100+
registryEtcd:
101101
enabled: false
102102
endpoints: ""
103103
namespace: "dolphinscheduler"
@@ -111,14 +111,28 @@ etcd:
111111
keyCertChainFile: "etcd-certs/client.crt"
112112
keyFile: "etcd-certs/client.pem"
113113

114+
registryJdbc:
115+
enabled: false
116+
termRefreshInterval: 2s
117+
termExpireTimes: 3
118+
hikariConfig:
119+
# Default use same Dolphinscheduler's database, if you want to use other database please change `enabled` to `true` and change other configs
120+
enabled: false
121+
driverClassName: com.mysql.cj.jdbc.Driver
122+
jdbcurl: jdbc:mysql://
123+
username: ""
124+
password: ""
125+
114126
## If exists external registry and set zookeeper.enable value to false, the external registry will be used.
115127
externalRegistry:
116128
registryPluginName: "zookeeper"
117129
registryServers: "127.0.0.1:2181"
118130

119131
security:
120132
authentication:
133+
# Authentication types (supported types: PASSWORD,LDAP,CASDOOR_SSO)
121134
type: PASSWORD
135+
# IF you set type `LDAP`, below config will be effective
122136
ldap:
123137
urls: ldap://ldap.forumsys.com:389/
124138
basedn: dc=example,dc=com

‎docs/docs/en/architecture/configuration.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ Location: `api-server/conf/application.yaml`
258258
|security.authentication.ldap.user.identity-attribute|uid|LDAP user identity attribute|
259259
|security.authentication.ldap.user.email-attribute|mail|LDAP user email attribute|
260260
|security.authentication.ldap.user.not-exist-action|CREATE|action when ldap user is not exist,default value: CREATE. Optional values include(CREATE,DENY)|
261-
|security.authentication.ldap.ssl.enable|false|LDAP switch|
261+
|security.authentication.ldap.ssl.enable|false|LDAP ssl switch|
262262
|security.authentication.ldap.ssl.trust-store|ldapkeystore.jks|LDAP jks file absolute path|
263263
|security.authentication.ldap.ssl.trust-store-password|password|LDAP jks password|
264264
|security.authentication.casdoor.user.admin||admin user account when you log-in with Casdoor|

0 commit comments

Comments
 (0)