How to Deploy and Manage Applications with Zadig: A Step‑by‑Step Guide
This comprehensive guide walks you through installing, configuring, and upgrading the cloud‑native continuous delivery platform Zadig—including MySQL setup, Helm chart deployment, GitLab integration, environment and pipeline management, and optional SonarQube code scanning—providing practical commands and screenshots for end‑to‑end implementation.
What is Zadig
Zadig is a cloud‑native continuous delivery platform that combines CI, CD, and automated testing to help developers focus on business logic while operations focus on stability.
Deployment
The following sections describe how to install Zadig and its dependencies.
Environment
<code>Kubernetes: v1.18.8
Helm: v3.5.4
Linux: CentOS 7.9</code>Install MySQL
Because the default MySQL version (8+) sometimes fails to start, the guide uses MySQL 5.7.
<code># Add Helm repo for stable charts
helm repo add stable https://charts.helm.sh/stable
# Pull MySQL chart version 1.6.9
helm pull stable/mysql --version 1.6.9
# Create custom values.yaml (excerpt)
mysqlUser: root@'%'
mysqlPassword: Joker@Zadig123
persistence:
enabled: true
storageClass: "rbd"
accessMode: ReadWriteOnce
size: 50Gi
configurationFiles:
mysql.cnf: |-
[mysql]
default-character-set=utf8
...
sql_mode=NO_UNSIGNED_SUBTRACTION,NO_ENGINE_SUBSTITUTION
lower_case_table_names=1
# Create namespace and install MySQL
kubectl create ns zadig
helm install mysql -n zadig -f my-value.yaml .
# Verify installation
kubectl get all -n zadig | grep mysql</code>Install Zadig
<code># Add Zadig Helm repo
helm repo add koderover-chart https://koderover.tencentcloudcr.com/chartrepo/chart
# Pull specific version (v1.11.0)
helm pull koderover-chart/zadig --version 1.11.0
# Customize values.yaml (excerpt)
tags:
mysql: false
connections:
mysql:
host: mysql:3306
auth:
user: root
password: Joker@Zadig123
dex:
config:
storage:
type: mysql
config:
host: mysql
port: 3306
database: dex
user: root
password: Joker@Zadig123
ssl:
mode: "false"
# Install Zadig (example domain)
export NAMESPACE=zadig
export DOMAIN=zadig.jokerbai.com
helm upgrade --install zadig . -f my-value.yaml \
--namespace $NAMESPACE \
--version=1.10.0 \
--set endpoint.FQDN=$DOMAIN \
--set global.extensions.extAuth.extauthzServerRef.namespace=$NAMESPACE \
--set "dex.config.staticClients[0].redirectURIs[0]=http://$DOMAIN/api/v1/callback,dex.config.staticClients[0].id=zadig,dex.config.staticClients[0].name=zadig,dex.config.staticClients[0].secret=ZXhhbXBsZS1hcHAtc2VjcmV0"
# Verify pods are running
kubectl get pod -n zadig</code>After installation, access the UI at
http://zadig.jokerbai.comusing the default credentials
admin:zadig.
Upgrade
Upgrading Zadig follows a similar process. It is recommended not to skip major versions.
<code># Pull new version (e.g., 1.12.0)
helm pull koderover-chart/zadig --version 1.12.0
# Export current values
helm get values zadig -n zadig > zadig.yaml
# Edit zadig.yaml to adjust MySQL settings if needed (same block as above)
# Upgrade
helm upgrade zadig -n zadig -f zadig.yaml .
# Verify pods
kubectl get pod -n zadig</code>System Integration
Code Source Integration (GitLab)
Create a GitLab OAuth application (organization type) with the callback URL
http://[zadig.yours.com]/api/directory/codehosts/callbackand grant
api, read_user, read_repositoryscopes. Record the Application ID and Secret.
In Zadig, add a new code host of type GitLab and fill in the URL, Application ID, and Secret, then authorize.
Account System Integration (GitLab OAuth via Dex)
Configure Dex to use GitLab as an OAuth connector:
<code>baseURL: http://gitlab.jokerbai.com
clientID: xxxxx
clientSecret: xxxxx
groups:
- xxxx
redirectURI: http://zadig.jokerbai.com/dex/callback
useLoginAsID: false</code>Save the configuration in Zadig; users can now log in with GitLab credentials.
Template Library Management
Helm Chart Templates
Import Helm charts stored in GitLab into Zadig's template library.
Build Templates
Examples for Java (Gradle), Frontend, and Go are provided.
Java Dockerfile
<code>FROM registry.cn-huhehaote.aliyuncs.com/jokerbai/openjdk8-openj9:alpine-slim
ARG NAME=gateway
ARG VERSION=0.0.1
ENV JVM_OPTS=""
ENV JVM_ARGS=""
ENV TZ=Asia/Shanghai
RUN echo 'http://mirrors.aliyun.com/alpine/v3.11/main' > /etc/apk/repositories && \
echo 'http://mirrors.aliyun.com/alpine/v3.11/community' >> /etc/apk/repositories && \
apk add --no-cache fontconfig ttf-dejavu && \
apk add --no-cache tzdata && \
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
echo $TZ > /etc/timezone
COPY --from=registry.cn-huhehaote.aliyuncs.com/jokerbai/arthas:latest /opt/arthas /opt/arthas
COPY --from=registry.cn-huhehaote.aliyuncs.com/jokerbai/skywalking-agent-sidecar:8.1.0-es7 /usr/skywalking/agent /opt/skywalking/agent
VOLUME ["/opt"]
ADD build/libs/${NAME}-${VERSION}-SNAPSHOT.jar /opt/app.jar
ENTRYPOINT ["sh", "-c", "java $JVM_OPTS $JVM_ARGS -jar /opt/app.jar"]
EXPOSE 80</code>Go Dockerfile
<code>FROM golang:1.17.5 AS build-env
ENV GOPROXY https://goproxy.cn
ADD . /go/src/app
WORKDIR /go/src/app
RUN go mod tidy
RUN cd cmd && GOOS=linux GOARCH=amd64 go build -v -o /go/src/app/app-server /go/src/app/cmd/main.go
FROM registry.cn-zhangjiakou.aliyuncs.com/jokerbai/ubuntu:22.04
ENV TZ=Asia/Shanghai
COPY --from=build-env /go/src/app/app-server /opt/app-server
WORKDIR /opt
EXPOSE 80
CMD ["./app-server"]</code>Frontend Dockerfile
<code>FROM nginx:alpine
ADD nginx.conf /etc/nginx/conf.d/default.conf
ADD dist/ /usr/share/nginx/html</code>Service Management
Create a project, then add services from the template library, customize
values.yaml, and attach builds.
Environment Management
Add Cluster
Register Kubernetes clusters in Zadig. After saving, an Agent command is generated; run it on the target cluster to establish connectivity.
<code>kubectl get po -n koderover-agent</code>Add Application
Select an environment (DEV/QA), add services, and configure their values. The services appear in the environment view.
Other Functions
Restart pods
View logs
Enter pod shells
Pipeline Management
Create a workflow, bind it to an environment, and configure steps (build and deploy). Run the workflow, select target services, and monitor progress.
Message Notification
Integrate DingTalk robot notifications by creating a robot with the keyword "工作流" and adding the robot configuration to the workflow notification settings.
Code Scanning
Install SonarQube
<code># Add Bitnami repo
helm repo add bitnami https://charts.bitnami.com/bitnami
# Pull chart
helm pull bitnami/sonarqube
# Install in Zadig namespace
helm install sonarqube -n zadig .
# Verify
kubectl get all -n zadig | grep sonar</code>Integrate SonarQube
Create a token in SonarQube, then configure the Sonar integration in Zadig with the server URL and token.
Run Code Scan
In a project, add a code‑scan step, configure the SonarQube parameters, and execute. Results are viewable in SonarQube.
Conclusion
The article demonstrates end‑to‑end usage of Zadig for continuous delivery, covering installation, upgrades, integrations, template management, environment handling, pipelines, notifications, and code quality scanning, illustrating how Zadig can close the development‑testing‑operations loop.
Ops Development Stories
Maintained by a like‑minded team, covering both operations and development. Topics span Linux ops, DevOps toolchain, Kubernetes containerization, monitoring, log collection, network security, and Python or Go development. Team members: Qiao Ke, wanger, Dong Ge, Su Xin, Hua Zai, Zheng Ge, Teacher Xia.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.