DolphinScheduler Start Docker & Kubernetes Config Data Injection Ideas

After DolphinScheduler was deployed succeeded, I was thinking about how to inject the config data into the project. This document is for recording.

中文版

1. Docker

Docker mode’s file is here. The init shell is startup.sh and will init at #L81 config file. The config file is startup-init-conf.sh.

1. Config inject to docker

We can see a lot of config in the startup-init-conf.sh.

LikeDATABASE_HOST and REGISTRY_SERVERS and so on.

1
2
3
4
5
6
7
docker run -d --name dolphinscheduler \
-e DATABASE_HOST="xx.xx.xx.xx" -e DATABASE_PORT="5432" -e DATABASE_DATABASE="dolphinscheduler" \
-e DATABASE_USERNAME="user" -e DATABASE_PASSWORD="password" \
-e ZOOKEEPER_QUORUM="xx.xx.xx.xx:2181" \
-e REGISTRY_SERVERS="xx.xx.xx.xx:2181" \
-p 12345:12345 \
apache/dolphinscheduler:2.0.1 all

The docker run shell’s config will be injected.

2. Config inject to properties

We can see a lot of properties.tpl in /conf/dolphinscheduler. And all properties’s config is parameter name. And will be replaced by inject config at startup-init-conf.sh#L127.

The data flow is below:

2. Kubernetes

Kubernetes mode’s file is here. The config file is values.yaml. And will be injectd by _helper.tpl.

1. Change config in values.yaml

We can see a lot of config in the values.yaml.

LikeDATABASE_HOST and REGISTRY_SERVERS and so on.

2. helm install dolphinscheduler

Config inject to helm though _helper.tpl.

3. Config inject to k8s yaml

Helm inject the config though k8s yaml files.

4. Config inject to container’s environments

The pods will start, and we can see the container’s environments are our config values.

5. Docker container get’s the environments

The docker container is starting, and the inject is the same as docker data flow. Just one different thing is the config values are from the environments not the docker run shell.

The data flow is below:


评论

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×