Add initial KCL deployment configuration for nginx and project setup

This commit is contained in:
suyiiyii 2025-03-14 09:52:55 +08:00
commit 6d793e89b3
Signed by: suyiiyii
GPG Key ID: 044704CB29B8AD85
4 changed files with 39 additions and 0 deletions

22
base/deploy.k Normal file
View File

@ -0,0 +1,22 @@
import k8s.api.apps.v1 as appsv1
a = appsv1.Deployment {
apiVersion = "apps/v1"
kind = "Deployment"
metadata = {
name = "nginx"
labels.app = "nginx"
}
spec = {
replicas = 3
selector.matchLabels = metadata.labels
template.metadata.labels = metadata.labels
template.spec.containers = [
{
name = metadata.name
image = "nginx:1.14.2"
ports = [{ containerPort = 80 }]
}
]
}
}

7
kcl.mod Normal file
View File

@ -0,0 +1,7 @@
[package]
name = "doutok"
edition = "v0.11.1"
version = "0.0.1"
[dependencies]
k8s = "1.31.2"

9
kcl.mod.lock Normal file
View File

@ -0,0 +1,9 @@
[dependencies]
[dependencies.k8s]
name = "k8s"
full_name = "k8s_1.31.2"
version = "1.31.2"
sum = "xBZgPsnpVVyWBpahuPQHReeRx28eUHGFoaPeqbct+vs="
reg = "ghcr.io"
repo = "kcl-lang/k8s"
oci_tag = "1.31.2"

1
main.k Normal file
View File

@ -0,0 +1 @@
The_first_kcl_program = 'Hello World!'