Skip to main content

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 wedaCli for manual installation
Service Type Description

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:

  1. Dedicated Node Deployment: Allocate dedicated Kubernetes nodes for CI/CD service
  2. Resource Isolation: Avoid deploying on the same nodes as other WeDa services
  3. Data Persistence: Configure dedicated data storage directories

Key Configuration Requirements

Important Notice

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 name
  • weda-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:

Production Environment Notes
  • Example directory /data1/gitness can 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 ItemTypeRequiredDescriptionExample Value
enabledbooleanYesWhether to enable built-in CI/CD servicetrue / false
nodeSelectorobjectRecommendedNode selector labels for specifying deployment nodesweda-gitness: service
hostPathstringRecommendedAbsolute path of data persistence directory/data1/gitness

Configuration Strategy Description

Deployment Strategy

Required Services:

  • At least one of internalBuild (built-in CI/CD) and build (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:

  1. Save Configuration File: Ensure all configuration items are correctly filled
  2. 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:

  1. Incorrect node label settings
  2. Insufficient data directory permissions
  3. 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:

  1. nodeSelector and hostPath are not on the same node
  2. Incorrect directory path configuration

Solutions:

  1. Confirm node labels and data directory are on the same node
  2. Verify if the path configured in hostPath is correct

Best Practice Recommendations

Production Environment Recommendations
  1. Resource Planning: Allocate sufficient CPU and memory resources for CI/CD service
  2. Storage Planning: Use high-performance SSD disks for data storage
  3. Backup Strategy: Regularly backup CI/CD data directories
  4. Monitoring and Alerting: Configure service status and resource usage monitoring
  5. Security Configuration: Restrict network access permissions for CI/CD service

Summary

Through the above steps, you have successfully:

  1. ✅ Understood the features and version requirements of built-in CI/CD service
  2. ✅ Completed configuration of node labels and data directories
  3. ✅ Mastered CI/CD service configuration parameters and deployment methods
  4. ✅ 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.