Skip to main content
Version: v0.14

Installation

Install with Helmโ€‹

If you have a Kubernetes cluster, Helm is the recommended installation method.

The following tutorial will guide you to install Kusion using Helm, which will install the chart with the release name kusion-release in namespace kusion.

Prerequisitesโ€‹

  • Helm v3+
  • A Kubernetes Cluster (The simplest way is to deploy a Kubernetes cluster locally using kind or minikube)

Installation Optionsโ€‹

Note: A valid kubeconfig configuration is required for Kusion to function properly. You must either use the installation script, provide your own kubeconfig in values.yaml, or set it through the --set parameter

You have several options to install Kusion:

Download the installation script from the KusionStack charts repository

curl -O https://raw.githubusercontent.com/KusionStack/charts/master/scripts/install-kusion.sh
chmod +x install-kusion.sh

Run the installation script with your kubeconfig files:

./install-kusion-server.sh <kubeconfig_key1=kubeconfig_path1> <kubeconfig_key2=kubeconfig_path2> ...

Parameters:

  • kubeconfig_key: The key for the kubeconfig file. It should be unique and not contain spaces.

  • kubeconfig_path: The path to the kubeconfig file.

2. Remote installation with Helmโ€‹

First, add the kusionstack chart repo to your local repository:

helm repo add kusionstack https://kusionstack.github.io/charts
helm repo update

Then install with your encoded kubeconfig:

# Base64 encode your kubeconfig files
KUBECONFIG_CONTENT1=$(base64 -w 0 /path/to/your/kubeconfig1)
KUBECONFIG_CONTENT2=$(base64 -w 0 /path/to/your/kubeconfig2)

# Install with kubeconfig and optional configurations
helm install kusion-release kusionstack/kusion \
--set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \
--set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2"

You may have to set your specific configurations if it is deployed into a production cluster, or you want to customize the chart configuration, such as database, replicas, port etc.

helm install kusion-release kusionstack/kusion \
--set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \
--set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2" \
--set server.port=8080 \
--set server.replicas=3 \
--set mysql.enabled=true \

All configurable parameters of the Kusion chart are detailed here.

Search all available versionsโ€‹

You can use the following command to view all installable chart versions.

helm repo update
helm search repo kusionstack/kusion --versions

Upgrade specified versionโ€‹

You can specify the version to be upgraded through the --version.

# Upgrade to the latest version.
helm upgrade kusion-release kusionstack/kusion

# Upgrade to the specified version.
helm upgrade kusion-release kusionstack/kusion --version 1.2.3

Local Installationโ€‹

If you have problem connecting to https://kusionstack.github.io/charts/ in production, you may need to manually download the chart from here and use it to install or upgrade locally.

git clone https://github.com/KusionStack/charts.git

Edit the default template values file to set your own kubeconfig and other configurations.

For more information about the KubeConfig configuration, please refer to the KubeConfig section.

Then install the chart:

helm install kusion-release charts/kusion

Uninstallโ€‹

To uninstall/delete the kusion-release Helm release in namespace kusion:

helm uninstall kusion-release

Image Registry Proxy for Chinaโ€‹

If you are in China and have problem to pull image from official DockerHub, you can use the registry proxy:

helm install kusion-release kusionstack/kusion --set registryProxy=docker.m.daocloud.io

NOTE: The above is just an example, you can replace the value of registryProxy as needed. You also need to provide your own kubeconfig in values.yaml or set it through the --set parameter.

Chart Parametersโ€‹

The following table lists the configurable parameters of the chart and their default values.

General Parametersโ€‹

KeyTypeDefaultDescription
namespacestring"kusion"Which namespace to be deployed
namespaceEnabledbooltrueWhether to generate namespace
registryProxystring""Image registry proxy will be the prefix as all component images

Global Parametersโ€‹

KeyTypeDefaultDescription

Kusion Serverโ€‹

The Kusion Server Component is the main backend server that provides the core functionality and REST APIs.

KeyTypeDefaultDescription
server.args.authEnabledboolfalseWhether to enable authentication
server.args.authKeyTypestring"RSA"Authentication key type
server.args.authWhitelistlist[]Authentication whitelist
server.args.autoMigratebooltrueWhether to enable automatic migration
server.args.dbHoststring""Database host
server.args.dbNamestring""Database name
server.args.dbPasswordstring""Database password
server.args.dbPortint3306Database port
server.args.dbUserstring""Database user
server.args.defaultSourceRemotestring""Default source URL
server.args.logFilePathstring"/logs/kusion.log"Logging
server.args.maxAsyncBufferint100Maximum number of buffer zones during concurrent async executions including generate, preview, apply and destroy
server.args.maxAsyncConcurrentint1Maximum number of concurrent async executions including generate, preview, apply and destroy
server.args.maxConcurrentint10Maximum number of concurrent executions including preview, apply and destroy
server.args.migrateFilestring""Migration file path
server.envlist[]Additional environment variables for the server
server.image.imagePullPolicystring"IfNotPresent"Image pull policy
server.image.repostring"kusionstack/kusion"Repository for Kusion server image
server.image.tagstring""Tag for Kusion server image. Defaults to the chart's appVersion if not specified
server.namestring"kusion-server"Component name for kusion server
server.portint80Port for kusion server
server.replicasint1The number of kusion server pods to run
server.resourcesobject{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"250m","memory":"256Mi"}}Resource limits and requests for the kusion server pods
server.serviceTypestring"ClusterIP"Service type for the kusion server. The available type values list as ["ClusterIP"ใ€"NodePort"ใ€"LoadBalancer"].

MySQL Databaseโ€‹

The MySQL database is used to store Kusion's persistent data.

KeyTypeDefaultDescription
mysql.databasestring"kusion"MySQL database name
mysql.enabledbooltrueWhether to enable MySQL deployment
mysql.image.imagePullPolicystring"IfNotPresent"Image pull policy
mysql.image.repostring"mysql"Repository for MySQL image
mysql.image.tagstring"8.0"Specific tag for MySQL image
mysql.namestring"mysql"Component name for MySQL
mysql.passwordstring""MySQL password
mysql.persistence.accessModeslist["ReadWriteOnce"]Access modes for MySQL PVC
mysql.persistence.sizestring"10Gi"Size of MySQL persistent volume
mysql.persistence.storageClassstring""Storage class for MySQL PVC
mysql.portint3306Port for MySQL
mysql.replicasint1The number of MySQL pods to run
mysql.resourcesobject{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"250m","memory":"512Mi"}}Resource limits and requests for MySQL pods
mysql.rootPasswordstring""MySQL root password
mysql.userstring"kusion"MySQL user

KubeConfigโ€‹

The KubeConfig is used to store the KubeConfig files for the Kusion Server.

KeyTypeDefaultDescription
kubeconfig.kubeConfigVolumeMountPathstring"/var/run/secrets/kubernetes.io/kubeconfigs/"Volume mount path for KubeConfig files
kubeconfig.kubeConfigsobject{}KubeConfig contents map

NOTE: The KubeConfig contents map is a key-value pair, where the key is the key of the KubeConfig file and the value is the contents of the KubeConfig file.

# Example structure:
kubeConfigs:
kubeconfig0: |
Please fill in your KubeConfig contents here.
kubeconfig1: |
Please fill in your KubeConfig contents here.