Skip to main content

One-Click Installation Guide

📘 Overview

This document describes how to quickly deploy a CSGHUB test environment using the one-click script. This method is mainly for functional verification, development testing, and proof-of-concept (PoC) scenarios.

⚠️ Important Note: This installation method is only suitable for test and development environments. For production, please use the standard deployment process.


🧩 System and Prerequisites

✅ Supported Operating Systems

System TypeNotes
Alpine LinuxLightweight support, some features limited (e.g., GPU)
Ubuntu / DebianRecommended
CentOS / RHEL / Rocky / Alma / FedoraCompatible support

💻 Hardware Requirements

Resource TypeMinimum ConfigurationRecommended Configuration
CPU4 cores8 cores
Memory8 GB16 GB
Storage200 GB500 GB
NetworkInternet accessStatic public IP preferred

🔧 Software Dependencies

  • bash: script execution
  • curl: download installation package
  • root privileges (required)

⚙️ One-Click Installation Command

# Replace example.com with your actual domain
curl -sfL http://quick-install.opencsg.com | bash -s -- --domain example.com

The script will automatically perform the following steps:

  1. Detect system environment
  2. Install lightweight K3s Kubernetes cluster
  3. Automatically install Helm
  4. Deploy the CSGHUB Helm Chart
  5. Configure domain resolution and access entry
  6. Output access information and login credentials

🧭 Installation Flow Overview

1️⃣ Environment Detection and Dependency Installation

The script automatically:

  • Checks the operating system type
  • Updates system package repositories
  • Installs basic dependencies (bash, curl, jq, iproute2, gettext, gnupg2, etc.)
  • Automatically installs Helm if not present

2️⃣ K3s Cluster Deployment

  • Installs K3s using the official script (version v1.30.4+k3s1)
  • Configures local registry and image acceleration
  • Detects network interfaces and sets cluster communication interface
  • Waits until K3s nodes are Ready

3️⃣ NVIDIA GPU Support (Optional)

If --enable-gpu is enabled:

  • Installs NVIDIA Container Toolkit
  • Configures containerd GPU runtime
  • Deploys nvidia-device-plugin automatically
  • Labels nodes with GPU capability and model

⚠️ GPU is not supported on Alpine.

Requirements:

  • NVIDIA driver ≥ 384.81
  • CUDA ≥ 12.1

4️⃣ Deploy CSGHUB Core Components

  • Adds and updates Helm repositories automatically
  • Creates csghub namespace
  • Installs or upgrades csghub Helm Chart
  • Configures Ingress and Kourier service types
  • Automatically generates login info into login.txt

5️⃣ Network and Domain Configuration

  • If --hosts-alias is enabled (default):

    • Automatically register domain in /etc/hosts

      • Updates CoreDNS ConfigMap for local domain resolution

        • Domains include:

          • csghub.{domain}
            • casdoor.{domain}
            • minio.{domain}
            • *.public.{domain}
            • csgship.{domain}
              • if csgship enabled
            • csgship-api.{domain}
              • if csgship enabled

6️⃣ Private Registry Configuration

After installation, the script automatically:

  • Retrieves the csghub-docker-credential Secret
  • Updates /etc/rancher/k3s/registries.yaml
  • Restarts K3s to apply new private image registry configuration

⚡ Optional Parameters and Advanced Configuration

ParameterDescriptionDefault Value
--domain <domain>Target domain for deployment (required)
--enable-gpuEnable NVIDIA GPU supportfalse
–editionSpecify edition typeee
--install-cnUse China mirror sourcesfalse
--hosts-aliasEnable local hosts domain resolutiontrue
--enable-csgshipEnable CSGShip service modulefalse
--enable-nfs-pvEnable NFS PV provisionertrue
--extra-args "<args1> <args2>"Additional Helm Chart arguments
--dry-runPrint commands without executingfalse
--ghproxy <url>Set GitHub proxy URLhttps://ghfast.top
--knative-domain <domain>Set internal Knative domainSame as --domain
--ingress-service-type <type>Set Ingress service typeNodePort
--kourier-service-type <type>Set Kourier service typeNodePort
--interface <iface>Specify network interfaceFirst system network card

🌏 Common Installation Modes

1️⃣ Domestic Network Environment

curl -sfL http://quick-install.opencsg.com | bash -s -- --domain example.com --install-cn
  • Uses Alibaba Cloud mirror for faster downloads

2️⃣ Enable GPU Support

curl -sfL http://quick-install.opencsg.com | bash -s -- --domain example.com --enable-gpu
  • Installs NVIDIA driver dependencies and runtime automatically
  • Launches nvidia-device-plugin
  • Labels nodes with GPU capability

3️⃣ Enable Enterprise Features (CSGShip)

curl -sfL http://quick-install.opencsg.com | bash -s -- --domain example.com --enable-csgship

4️⃣ Expose Services via LoadBalancer

curl -sfL http://quick-install.opencsg.com | bash -s -- --domain example.com --ingress-service-type LoadBalancer

⚠️ Note: LoadBalancer mode will occupy port 22 automatically; change local SSH port to avoid conflict.

5️⃣ Combined Example

curl -sfL http://quick-install.opencsg.com | bash -s -- \
--domain example.com \
--enable-gpu \
--enable-csgship \
--install-cn \
--ingress-service-type LoadBalancer \
--extra-args "--set global.ingress.tls.enabled=true"

📋 Installation Verification and Access

Check Installation Status

kubectl get nodes
kubectl get pods -A
kubectl get svc -n csghub
kubectl get ingress -n csghub

View Installation Logs

cat ./quick-install.log

View Access Information

cat ./login.txt

Includes:

  • CSGHUB login URL
  • Admin account and password
  • Key service endpoints

🧰 Troubleshooting

Issue 1: Script execution fails

curl -sfL http://quick-install.opencsg.com -o quick-install.sh
bash quick-install.sh --domain example.com

Issue 2: Domain cannot resolve

echo "$(hostname -I | awk '{print $1}') csghub.example.com" >> /etc/hosts

Issue 3: Port conflict

netstat -tulpn | grep :22

Issue 4: Error on line 138: Command [bash -c “$cmd”]

If the script shows this error along with [WARN] Retry, just wait the script will retry automatically.

View K3s and Pod Logs

sudo journalctl -u k3s -f
kubectl logs -n csghub -l app=csghub

🧹 Environment Cleanup

# Uninstall CSGHUB
helm uninstall csghub -n csghub

# Uninstall K3s (use with caution)
/usr/local/bin/k3s-uninstall.sh

# Remove residual data
rm -rf /var/lib/rancher /opt/csghub ~/.kube ~/.helm

✅ Recommended Post-Installation Steps

  1. Verify all services are running properly
  2. Backup admin login credentials