Skip to content

Commit 56f70a6

Browse files
authored
feat: add quickstart demo application (#158)
1 parent 7aa5c92 commit 56f70a6

File tree

4 files changed

+46
-0
lines changed

4 files changed

+46
-0
lines changed

example/quickstart/default/kcl.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
3+
[dependencies]
4+
kam = { git = "https://github.com/KusionStack/kam.git", tag = "0.2.0" }
5+
service = { oci = "oci://ghcr.io/kusionstack/service", tag = "0.1.0" }
6+
mysql = { oci = "oci://ghcr.io/kusionstack/mysql", tag = "0.2.0" }
7+
network = { oci = "oci://ghcr.io/kusionstack/network", tag = "0.2.0" }

example/quickstart/default/main.k

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# The configuration codes in perspective of developers.
2+
import kam.v1.app_configuration as ac
3+
import service
4+
import service.container as c
5+
import network as n
6+
import mysql
7+
8+
# Please replace the ${APPLICATION_NAME} with the name of your application, and complete the
9+
# 'AppConfiguration' instance with your own workload and accessories.
10+
quickstart: ac.AppConfiguration {
11+
workload: service.Service {
12+
containers: {
13+
quickstart: c.Container {
14+
image: "kusionstack/kusion-quickstart:latest"
15+
env: {
16+
"DB_HOST": "$(KUSION_DB_HOST_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
17+
"DB_USERNAME": "$(KUSION_DB_USERNAME_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
18+
"DB_PASSWORD": "$(KUSION_DB_PASSWORD_QUICKSTART_DEFAULT_QUICKSTART_MYSQL)"
19+
}
20+
}
21+
}
22+
}
23+
accessories: {
24+
"network": n.Network {
25+
ports: [
26+
n.Port {
27+
port: 8080
28+
}
29+
]
30+
}
31+
"mysql": mysql.MySQL {
32+
type: "local"
33+
version: "8.0"
34+
}
35+
}
36+
}

example/quickstart/default/stack.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# The metadata information of the stack.
2+
name: default

example/quickstart/project.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
name: quickstart

0 commit comments

Comments
 (0)