From 9cb6da3dbdc36b6b88b38e462e948bd13a48edfc Mon Sep 17 00:00:00 2001 From: Yang Yang Date: Wed, 22 Jan 2025 19:13:26 +0800 Subject: [PATCH] chore: update kusion chart --- charts/kusion/Chart.yaml | 2 +- charts/kusion/README.md | 26 ++++++---- charts/kusion/README.md.gotmpl | 24 +++++---- charts/kusion/templates/post-run-job.yaml | 59 +++++------------------ charts/kusion/values.yaml | 4 +- scripts/install-kusion.sh | 2 +- 6 files changed, 46 insertions(+), 71 deletions(-) mode change 100644 => 100755 scripts/install-kusion.sh diff --git a/charts/kusion/Chart.yaml b/charts/kusion/Chart.yaml index bd44c18..99c4724 100644 --- a/charts/kusion/Chart.yaml +++ b/charts/kusion/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: kusion -version: 0.14.1 +version: 0.14.2 type: application appVersion: 0.14.0 description: Kusion - An Intent-Driven Platform Orchestrator diff --git a/charts/kusion/README.md b/charts/kusion/README.md index f810321..0ff2d77 100644 --- a/charts/kusion/README.md +++ b/charts/kusion/README.md @@ -1,6 +1,6 @@ # Kusion Chart -![Version: 0.14.0](https://img.shields.io/badge/Version-0.14.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.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) +![Version: 0.14.2](https://img.shields.io/badge/Version-0.14.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.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) Kusion - An Intent-Driven Platform Orchestrator @@ -22,7 +22,13 @@ Kusion - An Intent-Driven Platform Orchestrator ## Installing the Chart -> 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 +> **Important:** Kusion requires a valid kubeconfig configuration to function properly. You can provide it via: +> - Installation script (recommended) +> - Custom values.yaml file +> - Helm --set parameter + +> **Note:** Default kubeconfig path is `/var/run/secrets/kubernetes.io/kubeconfigs/` +> To use a different path, set `kubeconfig.kubeConfigVolumeMountPath` to your desired path. To install Kusion, you have the following options: @@ -46,9 +52,9 @@ Edit the [values file](values.yaml) to add your kubeconfig content # Replace the content below with your actual kubeconfig kubeconfig: kubeConfigs: - kubeconfig0: | + kubeconfig-0: | Please fill in your KubeConfig contents here. - kubeconfig1: | + kubeconfig-1: | Please fill in your KubeConfig contents here. ``` @@ -63,16 +69,16 @@ helm install kusion-release ./kusion First, you need to base64 encode your kubeconfig files. ```shell -KUBECONFIG_CONTENT1=$(base64 -w 0 /path/to/your/kubeconfig1) -KUBECONFIG_CONTENT2=$(base64 -w 0 /path/to/your/kubeconfig2) +KUBECONFIG_CONTENT1=$(cat /path/to/your/kubeconfig-1 | base64 | tr -d '\n') +KUBECONFIG_CONTENT2=$(cat /path/to/your/kubeconfig-2 | base64 | tr -d '\n') ``` Then you can use the following command to install the latest version of Kusion. ```shell helm install kusion-release kusionstack/kusion \ ---set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \ ---set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2" +--set kubeconfig.kubeConfigs.kubeconfig-0="$KUBECONFIG_CONTENT1" \ +--set kubeconfig.kubeConfigs.kubeconfig-1="$KUBECONFIG_CONTENT2" ``` You may also have to set your specific configurations if it is deployed into a production cluster, or you want to customize the chart configuration, such as `port`, `replicas`, `database` etc. @@ -85,8 +91,8 @@ helm install kusion-release kusionstack/kusion \ --set server.replicas=3 \ --set mysql.enabled=true \ --set mysql.database=kusion \ ---set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \ ---set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2" +--set kubeconfig.kubeConfigs.kubeconfig-0="$KUBECONFIG_CONTENT1" \ +--set kubeconfig.kubeConfigs.kubeconfig-1="$KUBECONFIG_CONTENT2" ``` ## Chart Parameters diff --git a/charts/kusion/README.md.gotmpl b/charts/kusion/README.md.gotmpl index ee1ab88..995287e 100644 --- a/charts/kusion/README.md.gotmpl +++ b/charts/kusion/README.md.gotmpl @@ -16,7 +16,13 @@ ## Installing the Chart -> 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 +> **Important:** Kusion requires a valid kubeconfig configuration to function properly. You can provide it via: +> - Installation script (recommended) +> - Custom values.yaml file +> - Helm --set parameter + +> **Note:** Default kubeconfig path is `/var/run/secrets/kubernetes.io/kubeconfigs/` +> To use a different path, set `kubeconfig.kubeConfigVolumeMountPath` to your desired path. To install Kusion, you have the following options: @@ -40,9 +46,9 @@ Edit the [values file](values.yaml) to add your kubeconfig content # Replace the content below with your actual kubeconfig kubeconfig: kubeConfigs: - kubeconfig0: | + kubeconfig-0: | Please fill in your KubeConfig contents here. - kubeconfig1: | + kubeconfig-1: | Please fill in your KubeConfig contents here. ``` @@ -57,16 +63,16 @@ helm install kusion-release ./kusion First, you need to base64 encode your kubeconfig files. ```shell -KUBECONFIG_CONTENT1=$(base64 -w 0 /path/to/your/kubeconfig1) -KUBECONFIG_CONTENT2=$(base64 -w 0 /path/to/your/kubeconfig2) +KUBECONFIG_CONTENT1=$(cat /path/to/your/kubeconfig-1 | base64 | tr -d '\n') +KUBECONFIG_CONTENT2=$(cat /path/to/your/kubeconfig-2 | base64 | tr -d '\n') ``` Then you can use the following command to install the latest version of Kusion. ```shell helm install kusion-release kusionstack/kusion \ ---set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \ ---set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2" +--set kubeconfig.kubeConfigs.kubeconfig-0="$KUBECONFIG_CONTENT1" \ +--set kubeconfig.kubeConfigs.kubeconfig-1="$KUBECONFIG_CONTENT2" ``` You may also have to set your specific configurations if it is deployed into a production cluster, or you want to customize the chart configuration, such as `port`, `replicas`, `database` etc. @@ -79,8 +85,8 @@ helm install kusion-release kusionstack/kusion \ --set server.replicas=3 \ --set mysql.enabled=true \ --set mysql.database=kusion \ ---set kubeconfig.kubeConfigs.kubeconfig0="$KUBECONFIG_CONTENT1" \ ---set kubeconfig.kubeConfigs.kubeconfig1="$KUBECONFIG_CONTENT2" +--set kubeconfig.kubeConfigs.kubeconfig-0="$KUBECONFIG_CONTENT1" \ +--set kubeconfig.kubeConfigs.kubeconfig-1="$KUBECONFIG_CONTENT2" ``` ## Chart Parameters diff --git a/charts/kusion/templates/post-run-job.yaml b/charts/kusion/templates/post-run-job.yaml index c6834ac..9305ed0 100644 --- a/charts/kusion/templates/post-run-job.yaml +++ b/charts/kusion/templates/post-run-job.yaml @@ -30,57 +30,20 @@ spec: command: - /bin/sh - -c - - > - echo "Calling Kusion API for Module Registration..."; + - | + echo "Calling Kusion API for Module Registration..." - echo "Registering kam module..."; - curl -X POST "${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ + echo "Registering kam module..." + curl -X POST "http://${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ -H "Content-Type: application/json" \ - -d '{"name":"kam","url":"oci://ghcr.io/kusionstack/kam"}'; + -d '{"name":"kam","url":"oci://ghcr.io/kusionstack/kam","description":"The kam module represents a Kusion opinionated abstraction of the core concepts during application delivery.","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/app-configuration"}' - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/kam" \ + echo "Registering service module..." + curl -X POST "http://${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ -H "Content-Type: application/json" \ - -d '{"name":"kam","description":"The kam module represents a Kusion opinionated abstraction of the core concepts during application delivery."}'; + -d '{"name":"service","url":"oci://ghcr.io/kusionstack/service","description":"The service module represents a kind of workload profile that describes how to run your application code.","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/workload/service"}' - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/kam" \ + echo "Registering network module..." + curl -X POST "http://${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ -H "Content-Type: application/json" \ - -d '{"name":"kam","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/app-configuration"}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/kam" \ - -H "Content-Type: application/json" \ - -d '{"name":"kam","url":"git://github.com/KusionStack/kam"}'; - - echo "Registering service module..."; - curl -X POST "${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ - -H "Content-Type: application/json" \ - -d '{"name":"service","url":"oci://ghcr.io/kusionstack/service"}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/service" \ - -H "Content-Type: application/json" \ - -d '{"name":"service","description":"The service module represents a kind of workload profile that describes how to run your application code."}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/service" \ - -H "Content-Type: application/json" \ - -d '{"name":"service","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/workload/service"}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/service" \ - -H "Content-Type: application/json" \ - -d '{"name":"service","url":"oci://ghcr.io/kusionstack/service"}'; - - echo "Registering network module..."; - curl -X POST "${KUSION_SERVER_ENDPOINT}/api/v1/modules" \ - -H "Content-Type: application/json" \ - -d '{"name":"network","url":"oci://ghcr.io/kusionstack/network"}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/network" \ - -H "Content-Type: application/json" \ - -d '{"name":"network","description":"The network module represents a network accessory of workload, typically containing exposed ports and a load balancer."}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/network" \ - -H "Content-Type: application/json" \ - -d '{"name":"network","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/network"}'; - - curl -X PUT "${KUSION_SERVER_ENDPOINT}/api/v1/modules/network" \ - -H "Content-Type: application/json" \ - -d '{"name":"network","url":"oci://ghcr.io/kusionstack/network"}'; - backoffLimit: 10 + -d '{"name":"network","url":"oci://ghcr.io/kusionstack/network","description":"The network module represents a network accessory of workload, typically containing exposed ports and a load balancer.","doc":"https://www.kusionstack.io/docs/reference/modules/developer-schemas/network"}' diff --git a/charts/kusion/values.yaml b/charts/kusion/values.yaml index 97abf20..f5710e2 100644 --- a/charts/kusion/values.yaml +++ b/charts/kusion/values.yaml @@ -122,7 +122,7 @@ kubeconfig: kubeConfigs: {} # Example structure: # kubeConfigs: - # kubeconfig0: | + # kubeconfig-0: | # Please fill in your KubeConfig contents here. - # kubeconfig1: | + # kubeconfig-1: | # Please fill in your KubeConfig contents here. diff --git a/scripts/install-kusion.sh b/scripts/install-kusion.sh old mode 100644 new mode 100755 index db9bcda..d59ecf4 --- a/scripts/install-kusion.sh +++ b/scripts/install-kusion.sh @@ -22,7 +22,7 @@ for arg in "$@"; do fi # base64 encode - content=$(base64 -w 0 "$path") + content=$(cat "$path" | base64 | tr -d '\n') # Build helm --set argument KUBECONFIG_ARGS="${KUBECONFIG_ARGS} --set kubeconfig.kubeConfigs.${key}=${content}"