From 4fdfd5fb0ea924f9762bd06b7a9a46b9fa81248d Mon Sep 17 00:00:00 2001 From: liuhaoming Date: Thu, 16 Jan 2025 16:26:23 +0800 Subject: [PATCH] feat: update quickstart config codes --- example/quickstart/default/kcl.mod | 9 ++--- example/quickstart/default/main.k | 44 ++++++++++------------- example/quickstart/default/stack.yaml | 2 +- example/quickstart/default/workspace.yaml | 18 ++++++++++ example/quickstart/project.yaml | 3 +- 5 files changed, 42 insertions(+), 34 deletions(-) create mode 100644 example/quickstart/default/workspace.yaml diff --git a/example/quickstart/default/kcl.mod b/example/quickstart/default/kcl.mod index 8af6928f..9c9a0dda 100644 --- a/example/quickstart/default/kcl.mod +++ b/example/quickstart/default/kcl.mod @@ -1,7 +1,4 @@ -[package] - [dependencies] -kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0" } -service = { oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0" } -mysql = { oci = "oci://ghcr.io/kusionstack/mysql", tag = "0.2.0" } -network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.2.0" } +kam = { git = "git://github.com/KusionStack/kam", tag = "0.2.2" } +network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.3.0" } +service = { oci = "oci://ghcr.io/kusionstack/service", tag = "0.2.1" } diff --git a/example/quickstart/default/main.k b/example/quickstart/default/main.k index 02571c96..bdaf9bbd 100644 --- a/example/quickstart/default/main.k +++ b/example/quickstart/default/main.k @@ -3,34 +3,26 @@ import kam.v1.app_configuration as ac import service import service.container as c import network as n -import mysql +# `main.k` declares the customized configuration codes for default stack. +# # Please replace the ${APPLICATION_NAME} with the name of your application, and complete the # 'AppConfiguration' instance with your own workload and accessories. quickstart: ac.AppConfiguration { - workload: service.Service { - containers: { - quickstart: c.Container { - image: "kusionstack/kusion-quickstart:latest" - env: { - "DB_HOST": "$(KUSION_DB_HOST_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)" - "DB_USERNAME": "$(KUSION_DB_USERNAME_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)" - "DB_PASSWORD": "$(KUSION_DB_PASSWORD_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)" - } - } - } - } - accessories: { - "network": n.Network { - ports: [ - n.Port { - port: 8080 - } - ] - } - "mysql": mysql.MySQL { - type: "local" - version: "8.0" - } - } + workload: service.Service { + containers: { + quickstart: c.Container { + image: "kusionstack/kusion-quickstart:latest" + } + } + } + accessories: { + "network": n.Network { + ports: [ + n.Port { + port: 8080 + } + ] + } + } } diff --git a/example/quickstart/default/stack.yaml b/example/quickstart/default/stack.yaml index 905b100c..db3946d0 100644 --- a/example/quickstart/default/stack.yaml +++ b/example/quickstart/default/stack.yaml @@ -1,2 +1,2 @@ # The metadata information of the stack. -name: default \ No newline at end of file +name: default diff --git a/example/quickstart/default/workspace.yaml b/example/quickstart/default/workspace.yaml new file mode 100644 index 00000000..07bbeaff --- /dev/null +++ b/example/quickstart/default/workspace.yaml @@ -0,0 +1,18 @@ +modules: + kam: + path: git://github.com/KusionStack/kam + version: 0.2.2 + configs: + default: {} + network: + path: oci://ghcr.io/kusionstack/network + version: 0.3.0 + configs: + default: {} + service: + path: oci://ghcr.io/kusionstack/service + version: 0.2.1 + configs: + default: {} +context: + KUBECONFIG_PATH: /path/to/kubeconfig diff --git a/example/quickstart/project.yaml b/example/quickstart/project.yaml index 9fc878d3..b7de9ed6 100644 --- a/example/quickstart/project.yaml +++ b/example/quickstart/project.yaml @@ -1 +1,2 @@ -name: quickstart \ No newline at end of file +# The project basic info. +name: quickstart