Deploying DolphinScheduler 3.2.2 on Kubernetes with Rancher: A Step-by-Step Production Guide

C

Chen Debra

Guest

TL;DR​


This guide walks you through spinning up a production-ready Apache DolphinScheduler 3.2.2 cluster on Kubernetes + Rancher in under 30 minutes. We focus on three pain points every ops team meets in mainland China:

  1. Image acceleration (no more DockerHub timeouts)
  2. Dependency localization (charts & binaries cached inside the firewall)
  3. Persistent storage (NFS-backed PVCs that survive pod restarts)

1. Prerequisites & Planning​

ComponentVersionPurpose
Kubernetes1.25+Orchestration
Rancher2.7+GUI & helm chart repository
Helm3.12+Package manager
NFS ServeranyShared storage for artifacts
Sequence NumberIPHostNameOperating SystemK8s RoleDescription
1192.168.255.140harborAnolis OS 8.9 x86 64-bitHarbor ServiceKubernetes Management Platform
1192.168.255.141rancherAnolis OS 8.9 x86 64-bitRancher ServiceKubernetes Management Platform
2192.168.255.142masterAnolis OS 8.9 x86 64-bitControl NodeKubernetes Master
3192.168.255.143worker01Anolis OS 8.9 x86 64-bitWorker NodeKubernetes Master High Availability Node, if high availability is not needed, this server can be not deployed
4192.168.255.144worker02Anolis OS 8.9 x86 64-bitWorker NodeKubernetes Worker
5192.168.255.145worker03Anolis OS 8.9 x86 64-bitWorker NodeKubernetes Worker
6192.168.255.146worker04Anolis OS 8.9 x86 64-bitWorker NodeKubernetes Worker
7192.168.255.147worker05Anolis OS 8.9 x86 64-bitWorker NodeKubernetes Worker

Environment Overview

2. Download & Patch the Helm Chart​

All commands are run from the Rancher local cluster shell.

Code:
# 1. Fetch the source
mkdir -p /opt/dolphinscheduler && cd /opt/dolphinscheduler
curl -Lo apache-dolphinscheduler-3.2.2-src.tar.gz \
  https://dlcdn.apache.org/dolphinscheduler/3.2.2/apache-dolphinscheduler-3.2.2-src.tar.gz
tar -xzf apache-dolphinscheduler-3.2.2-src.tar.gz

# 2. Enter the chart dir
cd apache-dolphinscheduler-3.2.2-src/deploy/kubernetes/dolphinscheduler

2.1 Mirror Bitnami Charts (inside GFW)​


Edit Chart.yaml and replace GitHub raw URLs with fast mirrors:


Code:
-repository: https://raw.githubusercontent.com/bitnami/charts/archive-full-index/bitnami
+repository: https://raw.gitmirror.com/bitnami/charts/archive-full-index/bitnami

Then refresh dependencies:


Code:
helm repo add bitnami-full-index \
  https://raw.gitmirror.com/bitnami/charts/archive-full-index/bitnami
helm dependency update .
tar -xzf charts/*.tgz   # unzip postgresql, minio, zookeeper

3. Localize Container Images​


Create or edit values.yaml (only deltas shown):


Code:
# Global registry mirror for China
image:
  registry: registry.cn-hangzhou.aliyuncs.com/docker_image-ljx
  tag: 3.2.2

initImage:
  busybox: registry.cn-hangzhou.aliyuncs.com/docker_image-ljx/busybox:1.30.1

# Point each sub-chart to the same mirror
postgresql:
  image:
    registry: docker.io            # still needed for bitnami/postgresql
    repository: bitnami/postgresql
    tag: 11.11.0-debian-10-r71

minio:
  image:
    registry: docker.io
    repository: bitnami/minio
    tag: 2022.10.29-debian-11-r0

zookeeper:
  image:
    registry: docker.io
    repository: bitnami/zookeeper
    tag: 3.6.2-debian-10-r185

4. Configure NFS-backed Storage Class​


Save as sc.yaml:


Code:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: nfs-storage
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
provisioner: k8s-sigs.io/nfs-subdir-external-provisioner
parameters:
  archiveOnDelete: "true"
---
# ... (full RBAC & Deployment omitted for brevity)

Apply it:


Code:
kubectl apply -f sc.yaml

5. Tweak Resource & JVM Settings​


Keep requests low for CI, limits high for prod bursts:


Code:
master:
  replicas: 1
  resources:
    limits:   { cpu: "4",  memory: "4Gi" }
    requests: { cpu: "500m", memory: "2Gi" }
  env:
    JAVA_OPTS: "-Xms1g -Xmx1g -Xmn512m"

worker:
  replicas: 3
  persistentVolumeClaim:
    enabled: true
    storageClassName: "nfs-storage"
    storage: "20Gi"
  resources:
    limits:   { cpu: "2",  memory: "4Gi" }
    requests: { cpu: "500m", memory: "2Gi" }

6. Deploy & Verify​


Code:
kubectl create ns dolphinscheduler
helm -n dolphinscheduler install ds -f values.yaml .

Watch the rollout:


Code:
kubectl -n dolphinscheduler get pods -w

All pods should be Running within 2-3 minutes.

7. Ingress & Custom Domain​


Expose the UI via Rancher’s Ingress:


Code:
ingress:
  enabled: true
  host: dolphinscheduler.tyzwkj.cn
  path: /dolphinscheduler

Add a local DNS entry:


Code:
# /etc/hosts (Linux/Mac) or C:\Windows\System32\drivers\etc\hosts (Win)
<K8S_NODE_IP> dolphinscheduler.tyzwkj.cn

Open http://dolphinscheduler.tyzwkj.cn/dolphinscheduler/ui/ and log in:

  • User: admin
  • Password: dolphinscheduler123

Login Screen

8. Where to Go Next​

  • Scale workers horizontally using kubectl -n dolphinscheduler scale sts ds-dolphinscheduler-worker --replicas=5
  • Enable Prometheus by flipping serviceMonitor.enabled: true
  • Switch to external PostgreSQL/MySQL for real production workloads

Wrap-up​


By mirroring images, caching dependencies, and wiring NFS-backed volumes, we turned a flaky internet install into a repeatable, offline-capable deployment. Clone this repo, tweak values.yaml, and you’ll have a brand-new DolphinScheduler cluster in minutesβ€”no matter how hostile the network.

If this saved you a few gray hairs, smash the πŸ‘ button and share your own tweaks in the comments!

Continue reading...
 


Join 𝕋𝕄𝕋 on Telegram
Channel PREVIEW:
Back
Top