-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from kcl-lang/more-example-and-docs
feat: more example and docs
- Loading branch information
Showing
18 changed files
with
92 additions
and
39 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 |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
__pycache__ | ||
__kclcache__ | ||
.kclvm | ||
|
||
kcl.mod.lock | ||
|
||
# test report | ||
report/ | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Examples | ||
|
||
``` | ||
. | ||
├── README.md | ||
├── appops # Some real and simple application examples | ||
│ ├── guestbook | ||
│ ├── http-echo | ||
│ └── nginx-example | ||
├── job # How to use the job schema to render Kubernetes specific resources | ||
│ └── app_main_container | ||
└── server # How to use the server schema to render Kubernetes specific resources | ||
├── app_config_map | ||
├── app_label_selector | ||
├── app_main_container | ||
├── app_need_namespace | ||
├── app_rbac | ||
├── app_scheduling_strategy | ||
├── app_secret | ||
├── app_service | ||
├── app_sidecar | ||
├── app_stateful_set | ||
├── app_volume | ||
└── extra_resources | ||
``` |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import konfig.models.kube.frontend | ||
import konfig.models.kube.frontend.container | ||
|
||
# Application Configuration | ||
appConfiguration: frontend.Job { | ||
# Main Container Configuration | ||
mainContainer = container.Main { | ||
ports = [ | ||
{containerPort = 80} | ||
] | ||
env.MY_ENV: { | ||
value = "MY_VALUE" | ||
} | ||
} | ||
image = "nginx:1.7.8" | ||
} |
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 = "app_main_container_dev" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
konfig = { path = "../../../../../konfig" } | ||
k8s = "1.28" | ||
[profile] | ||
entries = ["../base/base.k", "main.k", "${konfig:KCL_MOD}/models/kube/render/render.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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import konfig.models.kube.frontend | ||
import konfig.models.kube.templates.resource as res_tpl | ||
|
||
# The application configuration in stack will overwrite | ||
# the configuration with the same attribute in base. | ||
appConfiguration: frontend.Job { | ||
schedulingStrategy.resource = res_tpl.tiny | ||
} |
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,7 @@ | ||
[package] | ||
name = "app_main_container" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
konfig = { path = "../../../../konfig" } | ||
k8s = "1.28" |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ppops/extra-resources-example/dev/kcl.mod → examples/server/extra_resources/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 = "nginx-example-dev" | ||
name = "extra_resources_dev" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...es/appops/extra-resources-example/kcl.mod → examples/server/extra_resources/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 = "nginx-example" | ||
name = "extra_resources" | ||
version = "0.0.1" | ||
|
||
[dependencies] | ||
|
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,6 +1,6 @@ | ||
[package] | ||
name = "konfig" | ||
version = "0.7.0" | ||
version = "0.8.0" | ||
|
||
[dependencies] | ||
k8s = "1.28" |
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