diff --git a/example/quickstart/default/kcl.mod b/example/quickstart/default/kcl.mod new file mode 100644 index 00000000..8af6928f --- /dev/null +++ b/example/quickstart/default/kcl.mod @@ -0,0 +1,7 @@ +[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" } diff --git a/example/quickstart/default/main.k b/example/quickstart/default/main.k new file mode 100644 index 00000000..02571c96 --- /dev/null +++ b/example/quickstart/default/main.k @@ -0,0 +1,36 @@ +# The configuration codes in perspective of developers. +import kam.v1.app_configuration as ac +import service +import service.container as c +import network as n +import mysql + +# 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" + } + } +} diff --git a/example/quickstart/default/stack.yaml b/example/quickstart/default/stack.yaml new file mode 100644 index 00000000..905b100c --- /dev/null +++ b/example/quickstart/default/stack.yaml @@ -0,0 +1,2 @@ +# The metadata information of the stack. +name: default \ No newline at end of file diff --git a/example/quickstart/project.yaml b/example/quickstart/project.yaml new file mode 100644 index 00000000..9fc878d3 --- /dev/null +++ b/example/quickstart/project.yaml @@ -0,0 +1 @@ +name: quickstart \ No newline at end of file