-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update base example applications
- Loading branch information
Showing
29 changed files
with
85 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,6 @@ report/ | |
|
||
kusion_state.json | ||
|
||
changed_list.txt | ||
changed_list.txt | ||
|
||
*.lock |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
# Konfig | ||
# konfig | ||
[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://github.com/codespaces/new?hide_repo_select=true&ref=main&repo=488867056&machine=standardLinux32gb&devcontainer_path=.devcontainer.json) | ||
|
||
[English](README.md) | [Chinese](README-zh.md) | ||
|
||
This is a example repository for [Kusion](https://github.com/KusionStack/kusion), where you can use the examples provided to quickly learn how to use Kusion. | ||
konfig repository contains various example applications code, you can use these example applications to quickly try out and learn how to use [Kusion](https://github.com/KusionStack/kusion). | ||
|
||
## Getting Started | ||
|
||
If you are new to Kusion, please visit [Getting Started](https://kusionstack.io/docs/user_docs/getting-started/) to learn about Kusion. It includes installation instructions, quick start guide, and some basic concepts. | ||
If you're new to Kusion, start by reviewing the [Getting Started](https://www.kusionstack.io/docs/user_docs/getting-started/) page, which includes quickstart installation, guided tutorials and deployment instructions. | ||
|
||
All the examples are located in the `example`` directory, and you can find corresponding tutorials in the [User Guide](https://kusionstack.io/docs/user_docs/guides/). | ||
All guided tutorials use applications in this repository, located in the `example` directory. | ||
|
||
## Deploying Examples | ||
|
||
You can execute the `kusion apply` command in different example directories to deploy different examples. Some examples have prerequisites, such as an accessible Kubernetes cluster or an account of a specific cloud provider. Please refer to the tutorials in the [User Guide](https://kusionstack.io/docs/user_docs/guides/) for specific prerequisites. | ||
You can experiment with the different examples by entering each directory and running `kusion apply`. Some examples have prerequisites, e.g. accessible Kubernetes cluster or account for cloud provider. Please refer to guided tutorials in the [User Guide](https://www.kusionstack.io/docs/user_docs/guides/) for specific prerequisites. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "nginx" | ||
name = "samplejob" | ||
edition = "0.1.0" | ||
version = "0.1.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import catalog.models.schema.v1 as ac | ||
import catalog.models.schema.v1.workload as wl | ||
import catalog.models.schema.v1.workload.container as c | ||
|
||
samplejob: ac.AppConfiguration { | ||
workload: wl.Job { | ||
containers: { | ||
"busybox": c.Container { | ||
# The target image | ||
image: "busybox:1.28" | ||
# Run the following command as defined | ||
command: ["/bin/sh", "-c", "echo hello"] | ||
} | ||
} | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# The project basic info | ||
name: nginx | ||
name: samplejob | ||
generator: | ||
type: AppConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
example/multi-stack/prod/kcl.mod → example/service-multistack/dev/kcl.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "multi-stack" | ||
name = "service-multistack" | ||
edition = "0.5.0" | ||
version = "0.1.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import catalog.models.schema.v1 as ac | ||
|
||
# main.k declares customized configurations for dev stack. | ||
echoserver: ac.AppConfiguration { | ||
workload.containers.server: { | ||
# dev stack use latest echoserver image | ||
image = "cilium/echoserver" | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
example/multi-stack/dev/kcl.mod → example/service-multistack/prod/kcl.mod
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[package] | ||
name = "multi-stack" | ||
name = "service-multistack" | ||
edition = "0.5.0" | ||
version = "0.1.0" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import catalog.models.schema.v1 as ac | ||
|
||
# main.k declares customized configurations for prod stack. | ||
helloworld: ac.AppConfiguration { | ||
# replicas is 2 for prod | ||
workload.replicas = 2 | ||
workload.containers.server: { | ||
# prod stack use older stable echoserver image | ||
image = "cilium/echoserver:1.10.3" | ||
# also prod stack require more resources | ||
resources = { | ||
"cpu": "500m" | ||
"memory": "512Mi" | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
example/nginx/dev/stack.yaml → example/service-multistack/prod/stack.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# The stack basic info | ||
name: dev | ||
name: prod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# The project basic info | ||
name: service-multistack | ||
generator: | ||
type: AppConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "simpleservice" | ||
edition = "0.1.0" | ||
version = "0.1.0" | ||
|
||
[dependencies] | ||
catalog = { git = "https://github.com/KusionStack/catalog.git", tag = "0.1.1" } | ||
[profile] | ||
entries = ["main.k"] | ||
|
16 changes: 5 additions & 11 deletions
16
example/nginx/dev/main.k → example/simpleservice/prod/main.k
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,21 @@ | ||
import catalog.models.schema.v1 as ac | ||
import catalog.models.schema.v1.workload as wl | ||
import catalog.models.schema.v1.workload.container as c | ||
import catalog.models.schema.v1.workload.network as n | ||
|
||
nginx: ac.AppConfiguration { | ||
# main.k declares desired configurations for prod stack. | ||
simplesvc: ac.AppConfiguration { | ||
workload: wl.Service { | ||
containers: { | ||
nginx: c.Container { | ||
"nginx": c.Container { | ||
# use nginx:1.25.2 as target image | ||
image = "nginx:1.25.2" | ||
# resource requirements for nginx container | ||
resources: { | ||
"cpu": "500m" | ||
"memory": "512Mi" | ||
} | ||
} | ||
} | ||
replicas: 1 | ||
ports: [ | ||
n.Port { | ||
type: "aliyun" | ||
port: 80 | ||
protocol: "TCP" | ||
public: True | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# The stack basic info | ||
name: prod |
2 changes: 1 addition & 1 deletion
2
example/multi-stack/project.yaml → example/simpleservice/project.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# The project basic info | ||
name: multi-stack | ||
name: simpleservice | ||
generator: | ||
type: AppConfiguration |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters