Skip to content

Commit 26d8106

Browse files
authored
feat: create kusion helm chart (#82)
1 parent 60c7964 commit 26d8106

File tree

12 files changed

+737
-0
lines changed

12 files changed

+737
-0
lines changed

charts/kusion/.helmignore

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/

charts/kusion/Chart.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: v2
2+
name: kusion
3+
version: 0.1.0
4+
type: application
5+
appVersion: "1.0.0"
6+
description: A Helm chart for deploying Kusion - An Intent-Driven Platform Orchestrator
7+
home: https://github.com/KusionStack/kusion
8+
icon: https://github.com/KusionStack/kusion/docs/logo.png
9+
maintainers:
10+
- name: kusionstack
11+
email: kusionstack@gmail.com
12+
url: https://kusionstack.io/docs
13+
sources:
14+
- https://github.com/KusionStack/kusion
15+
keywords:
16+
- KusionStack
17+
- kusion

charts/kusion/Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# To generate help information
2+
.DEFAULT_GOAL := help
3+
.PHONY: help
4+
help: ## This help message :)
5+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
6+
7+
.PHONY: lint
8+
lint: ## Lint, will not fix but sets exit code on error
9+
@which yamllint > /dev/null || (echo "Installing yamllint@latest ..."; brew install yamllint && echo -e "Installation complete!\n")
10+
@yamllint --config-file ../../.github/configs/lintconf.yaml *.yaml
11+
12+
.PHONY: doc
13+
doc: ## Auto Generate README with helm-docs and README.md.gotmpl
14+
@which helm-docs > /dev/null || (echo "Installing helm-docs@latest ..."; go install github.com/norwoodj/helm-docs/cmd/helm-docs@latest && echo -e "Installation complete!\n")
15+
@helm-docs

charts/kusion/README.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# Kusion Chart
2+
3+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square) [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kusion)](https://artifacthub.io/packages/helm/kusionstack/kusion)
4+
5+
A Helm chart for deploying Kusion - An Intent-Driven Platform Orchestrator
6+
7+
**Homepage:** <https://github.com/KusionStack/kusion>
8+
9+
## Maintainers
10+
11+
| Name | Email | Url |
12+
| ---- | ------ | --- |
13+
| kusionstack | <kusionstack@gmail.com> | <https://kusionstack.io/docs> |
14+
15+
## Source Code
16+
17+
* <https://github.com/KusionStack/kusion>
18+
19+
## Prerequisites
20+
21+
- Helm v3+
22+
23+
## Installing the Chart
24+
25+
First, add the Kusion chart repo to your local repository.
26+
27+
```shell
28+
helm repo add kusionstack https://kusionstack.github.io/charts
29+
helm repo update
30+
```
31+
32+
Then you can use the following command to install the latest version of Kusion.
33+
34+
```shell
35+
helm install kusion-release kusionstack/kusion
36+
```
37+
38+
> Note that installing this chart directly means it will use the [default template values](./values.yaml) for Kusion.
39+
40+
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 `resources`, `replicas`, `port` etc.
41+
42+
All configurable parameters of the Kusion chart are detailed [here](#chart-parameters).
43+
44+
```shell
45+
helm install kusion-release kusionstack/kusion --set server.port=8080 --set mysql.enabled=true --set mysql.database=kusionDB
46+
```
47+
48+
## Chart Parameters
49+
50+
The following table lists the configurable parameters of the chart and their default values.
51+
52+
### General Parameters
53+
54+
| Key | Type | Default | Description |
55+
|-----|------|---------|-------------|
56+
| namespace | string | `"kusion"` | Which namespace to be deployed |
57+
| namespaceEnabled | bool | `true` | Whether to generate namespace |
58+
| registryProxy | string | `""` | Image registry proxy will be the prefix as all component images |
59+
60+
### Global Parameters
61+
62+
| Key | Type | Default | Description |
63+
|-----|------|---------|-------------|
64+
65+
### Kusion Server
66+
67+
The Kusion Server Component is the main backend server that provides the core functionality and REST APIs.
68+
69+
| Key | Type | Default | Description |
70+
|-----|------|---------|-------------|
71+
| server.args.authEnabled | bool | `false` | Whether to enable authentication |
72+
| server.args.authKeyType | string | `"RSA"` | Authentication key type |
73+
| server.args.authWhitelist | list | `[]` | Authentication whitelist |
74+
| server.args.autoMigrate | bool | `true` | Whether to enable automatic migration |
75+
| server.args.dbHost | string | `""` | Database host |
76+
| server.args.dbName | string | `""` | Database name |
77+
| server.args.dbPassword | string | `""` | Database password |
78+
| server.args.dbPort | int | `3306` | Database port |
79+
| server.args.dbUser | string | `""` | Database user |
80+
| server.args.defaultSourceRemote | string | `""` | Default source URL |
81+
| server.args.logFilePath | string | `"/logs/kusion.log"` | Logging |
82+
| server.args.maxAsyncBuffer | int | `100` | Maximum number of buffer zones during concurrent async executions including generate, preview, apply and destroy |
83+
| server.args.maxAsyncConcurrent | int | `1` | Maximum number of concurrent async executions including generate, preview, apply and destroy |
84+
| server.args.maxConcurrent | int | `10` | Maximum number of concurrent executions including preview, apply and destroy |
85+
| server.args.migrateFile | string | `""` | Migration file path |
86+
| server.env | list | `[]` | Additional environment variables for the server |
87+
| server.image.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy |
88+
| server.image.repo | string | `"kusionstack/kusion"` | Repository for Kusion server image |
89+
| server.image.tag | string | `"latest"` | Tag for Kusion server image. Defaults to the chart's appVersion if not specified |
90+
| server.name | string | `"kusion-server"` | Component name for kusion server |
91+
| server.port | int | `80` | Port for kusion server |
92+
| server.replicas | int | `1` | The number of kusion server pods to run |
93+
| server.resources | object | `{"limits":{"cpu":"500m","memory":"1Gi"},"requests":{"cpu":"250m","memory":"256Mi"}}` | Resource limits and requests for the kusion server pods |
94+
| server.serviceType | string | `"ClusterIP"` | Service type for the kusion server. The available type values list as ["ClusterIP"、"NodePort"、"LoadBalancer"]. |
95+
96+
### MySQL Database
97+
98+
The MySQL database is used to store Kusion's persistent data.
99+
100+
| Key | Type | Default | Description |
101+
|-----|------|---------|-------------|
102+
| mysql.database | string | `"kusionDB"` | MySQL database name |
103+
| mysql.enabled | bool | `true` | Whether to enable MySQL deployment |
104+
| mysql.image.imagePullPolicy | string | `"IfNotPresent"` | Image pull policy |
105+
| mysql.image.repo | string | `"mysql"` | Repository for MySQL image |
106+
| mysql.image.tag | string | `"8.0"` | Specific tag for MySQL image |
107+
| mysql.name | string | `"mysql"` | Component name for MySQL |
108+
| mysql.password | string | `""` | MySQL password |
109+
| mysql.persistence.accessModes | list | `["ReadWriteOnce"]` | Access modes for MySQL PVC |
110+
| mysql.persistence.size | string | `"10Gi"` | Size of MySQL persistent volume |
111+
| mysql.persistence.storageClass | string | `""` | Storage class for MySQL PVC |
112+
| mysql.port | int | `3306` | Port for MySQL |
113+
| mysql.replicas | int | `1` | The number of MySQL pods to run |
114+
| mysql.resources | object | `{"limits":{"cpu":"1000m","memory":"1Gi"},"requests":{"cpu":"250m","memory":"512Mi"}}` | Resource limits and requests for MySQL pods |
115+
| mysql.rootPassword | string | `""` | MySQL root password |
116+
| mysql.user | string | `"kusion"` | MySQL user |
117+
118+
----------------------------------------------
119+
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)

charts/kusion/README.md.gotmpl

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Kusion Chart
2+
3+
{{ template "chart.badgesSection" . }} [![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/kusion)](https://artifacthub.io/packages/helm/kusionstack/kusion)
4+
5+
{{ template "chart.description" . }}
6+
7+
{{ template "chart.homepageLine" . }}
8+
9+
{{ template "chart.maintainersSection" . }}
10+
11+
{{ template "chart.sourcesSection" . }}
12+
13+
## Prerequisites
14+
15+
- Helm v3+
16+
17+
## Installing the Chart
18+
19+
First, add the Kusion chart repo to your local repository.
20+
21+
```shell
22+
helm repo add kusionstack https://kusionstack.github.io/charts
23+
helm repo update
24+
```
25+
26+
Then you can use the following command to install the latest version of Kusion.
27+
28+
```shell
29+
helm install kusion-release kusionstack/kusion
30+
```
31+
32+
> Note that installing this chart directly means it will use the [default template values](./values.yaml) for Kusion.
33+
34+
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 `resources`, `replicas`, `port` etc.
35+
36+
All configurable parameters of the Kusion chart are detailed [here](#chart-parameters).
37+
38+
```shell
39+
helm install kusion-release kusionstack/kusion --set server.port=8080 --set mysql.enabled=true --set mysql.database=kusionDB
40+
```
41+
42+
## Chart Parameters
43+
44+
The following table lists the configurable parameters of the chart and their default values.
45+
46+
### General Parameters
47+
48+
| Key | Type | Default | Description |
49+
|-----|------|---------|-------------|
50+
{{- range .Values }}
51+
{{- if not (or (hasPrefix "global" .Key) (hasPrefix "server" .Key) (hasPrefix "mysql" .Key)) }}
52+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
53+
{{- end }}
54+
{{- end }}
55+
56+
### Global Parameters
57+
58+
| Key | Type | Default | Description |
59+
|-----|------|---------|-------------|
60+
{{- range .Values }}
61+
{{- if hasPrefix "global" .Key }}
62+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
63+
{{- end }}
64+
{{- end }}
65+
66+
### Kusion Server
67+
68+
The Kusion Server Component is the main backend server that provides the core functionality and REST APIs.
69+
70+
| Key | Type | Default | Description |
71+
|-----|------|---------|-------------|
72+
{{- range .Values }}
73+
{{- if hasPrefix "server" .Key }}
74+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
75+
{{- end }}
76+
{{- end }}
77+
78+
### MySQL Database
79+
80+
The MySQL database is used to store Kusion's persistent data.
81+
82+
| Key | Type | Default | Description |
83+
|-----|------|---------|-------------|
84+
{{- range .Values }}
85+
{{- if hasPrefix "mysql" .Key }}
86+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
87+
{{- end }}
88+
{{- end }}
89+
90+
----------------------------------------------
91+
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)

charts/kusion/templates/NOTES.txt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Thank you for installing {{ .Chart.Name }}.
2+
3+
Your release is named {{ .Release.Name }}.
4+
5+
To learn more about the release, try:
6+
7+
$ helm status {{ .Release.Name }}
8+
$ helm get all {{ .Release.Name }}
9+
10+
{{- if .Values.mysql.enabled }}
11+
12+
MySQL is enabled. The following credentials were configured:
13+
- Database: {{ .Values.mysql.database }}
14+
- User: {{ .Values.mysql.user }}
15+
Please retrieve the passwords from the secret: {{ .Values.mysql.name }}-secret
16+
{{- end }}
17+
18+
The Kusion server can be accessed:
19+
- Within cluster: {{ .Values.server.name }}.{{ .Values.namespace }}.svc:{{ .Values.server.port }}
20+
{{- if eq .Values.server.serviceType "NodePort" }}
21+
- From outside: <node-ip>:<node-port>
22+
You can get the node port by running:
23+
kubectl get svc {{ .Values.server.name }} -n {{ .Values.namespace }} -o jsonpath='{.spec.ports[0].nodePort}'
24+
{{- else if eq .Values.server.serviceType "LoadBalancer" }}
25+
- From outside: <external-ip>:{{ .Values.server.port }}
26+
You can get the external IP by running:
27+
kubectl get svc {{ .Values.server.name }} -n {{ .Values.namespace }}
28+
{{- end }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{{/*
2+
Create chart name and version as used by the chart label.
3+
*/}}
4+
{{- define "kusion.chart" -}}
5+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
6+
{{- end -}}
7+
8+
{{/*
9+
Common labels
10+
*/}}
11+
{{- define "kusion.labels" -}}
12+
helm.sh/chart: {{ include "kusion.chart" .context }}
13+
{{ include "kusion.selectorLabels" (dict "context" .context "component" .component) }}
14+
app.kubernetes.io/managed-by: {{ .context.Release.Service }}
15+
app.kubernetes.io/version: {{ .context.Chart.AppVersion }}
16+
{{- end }}
17+
18+
{{/*
19+
Selector labels
20+
*/}}
21+
{{- define "kusion.selectorLabels" -}}
22+
app.kubernetes.io/name: {{ .context.Chart.Name }}
23+
{{- if .component }}
24+
app.kubernetes.io/component: {{ .component }}
25+
{{- end }}
26+
app.kubernetes.io/instance: {{ .context.Release.Name }}
27+
{{- end }}
28+
29+
{{/*
30+
Real image
31+
*/}}
32+
{{- define "kusion.realImage" -}}
33+
{{- trimPrefix "/" (list (trimAll "/" .context.Values.registryProxy)
34+
.repo | join "/") }}:{{ if .needV }}v{{ end }}{{ default .context.Chart.AppVersion .tag }}
35+
{{- end -}}

0 commit comments

Comments
 (0)