WeDa Private Deployment Built-in CI/CD Service Configuration Guide
This document will guide you through configuring and enabling the built-in CI/CD service in WeDa private deployment cluster edition.
Feature Overview
WeDa private deployment provides a built-in CI/CD service that supports automated application build, test, and deployment processes.
Version Support
- v1.4.10 and above: CI/CD service supports automatic installation without separate deployment
- Below v1.4.10: Need to obtain new version upgrade package or command-line tool
wedaClifor manual installation
WeDa provides two CI/CD deployment methods:
- Built-in CI/CD (internalBuild): Deployed inside the Kubernetes cluster (storage path disk space requirement at least: 100G)
- External CI/CD (build): Deployed on independent servers outside the cluster
At least one of these two methods must be enabled. When both are enabled, the built-in CI/CD service takes priority.
Prerequisites and Requirements
Node Planning
To ensure stable operation of the CI/CD service, it is recommended to:
- Dedicated Node Deployment: Allocate dedicated Kubernetes nodes for CI/CD service
- Resource Isolation: Avoid deploying on the same nodes as other WeDa services
- Data Persistence: Configure dedicated data storage directories
Key Configuration Requirements
The following configurations must be set correctly, otherwise data loss will occur:
- Node selector (nodeSelector) and data directory (hostPath) must be on the same node
- If node selector and data directory are not set, CI/CD data cannot be persisted and build history will be lost
- Data directory should use independent large-capacity disk to avoid system disk space shortage
Configuration Steps
Step 1: Set Node Labels
First, you need to set labels for dedicated CI/CD nodes for node selector identification.
kubectl label nodes <node-name> weda-gitness=service
Parameter Description:
<node-name>: Replace with actual Kubernetes node nameweda-gitness=service: Node selector label for CI/CD service
View Node Names:
kubectl get nodes
Step 2: Create Data Persistence Directory
Create CI/CD data storage directory on the labeled node:
mkdir -p /data1/gitness
Directory Planning Recommendations:
- Example directory
/data1/gitnesscan be adjusted according to actual situation - Strongly recommended to place data directory on independent large-capacity disk (at least 100G)
- Avoid using system disk to prevent service exceptions due to insufficient disk space
- Ensure directory has appropriate read/write permissions
Recommended Directory Structure:
# Production environment recommended configuration
/data/cicd/gitness # Use independent data disk
/opt/weda/cicd/data # Or use dedicated partition (storage path disk space requirement at least: 100G)
Step 3: Configure CI/CD Service
Add the following CI/CD service configuration to WeDa's configuration file:
internalBuild:
# Enable built-in CI/CD service
# true: Enable and automatically deploy built-in CI/CD service
# false: Do not enable built-in CI/CD service
enabled: true
# Node selector configuration
# Specify target nodes for CI/CD service deployment
nodeSelector:
weda-gitness: service
# Data persistence directory
# Must match the actual directory path on the node specified by nodeSelector
hostPath: "/data1/gitness"
Configuration Parameter Details
| Configuration Item | Type | Required | Description | Example Value |
|---|---|---|---|---|
enabled | boolean | Yes | Whether to enable built-in CI/CD service | true / false |
nodeSelector | object | Recommended | Node selector labels for specifying deployment nodes | weda-gitness: service |
hostPath | string | Recommended | Absolute path of data persistence directory | /data1/gitness |
Configuration Strategy Description
Required Services:
- At least one of
internalBuild(built-in CI/CD) andbuild(external CI/CD) must be enabled - When both are enabled, the system prioritizes built-in CI/CD service
Node Selector Strategy:
- Set
nodeSelector: CI/CD service will be deployed to nodes with specified labels - Do not set
nodeSelector: System automatically selects appropriate nodes based on resources
Data Persistence Strategy:
- Set
hostPath: CI/CD data will be persistently saved, build history can be viewed - Do not set
hostPath: Data is not persisted, build history is lost after restart
Deployment and Startup
Step 4: Apply Configuration and Start Service
After completing the above configuration, perform the following operations to start the CI/CD service:
- Save Configuration File: Ensure all configuration items are correctly filled
- Apply Configuration: Execute deployment operations according to Install or Restart Service documentation
Verify Deployment Results
After deployment is complete, you can verify CI/CD service status with the following commands:
# Check CI/CD related Pod status
kubectl get pods -n software | grep gitness
# View service logs
kubectl logs -f <gitness-pod-name> -n software -c gitness
# Verify data directory
ls -la /data1/gitness
Common Issue Troubleshooting
Service Cannot Start
Possible Causes:
- Incorrect node label settings
- Insufficient data directory permissions
- Insufficient disk space
Troubleshooting Steps:
# 1. Check node labels
kubectl get nodes --show-labels | grep weda-gitness
# 2. Check directory permissions
ls -ld /data1/gitness
# 3. Check disk space
df -h /data1
Data Cannot Be Persisted
Possible Causes:
nodeSelectorandhostPathare not on the same node- Incorrect directory path configuration
Solutions:
- Confirm node labels and data directory are on the same node
- Verify if the path configured in
hostPathis correct
Best Practice Recommendations
- Resource Planning: Allocate sufficient CPU and memory resources for CI/CD service
- Storage Planning: Use high-performance SSD disks for data storage
- Backup Strategy: Regularly backup CI/CD data directories
- Monitoring and Alerting: Configure service status and resource usage monitoring
- Security Configuration: Restrict network access permissions for CI/CD service
Summary
Through the above steps, you have successfully:
- ✅ Understood the features and version requirements of built-in CI/CD service
- ✅ Completed configuration of node labels and data directories
- ✅ Mastered CI/CD service configuration parameters and deployment methods
- ✅ Learned troubleshooting and resolution methods for common issues
Now you can fully utilize the powerful features of the built-in CI/CD service in WeDa private deployment environment to achieve automated application building and deployment.