Skip to content

Commit 5f30748

Browse files
committed
docs: update kubernetes tool integration documents
Signed-off-by: peefy <[email protected]>
1 parent 29cc937 commit 5f30748

File tree

8 files changed

+26
-10
lines changed

8 files changed

+26
-10
lines changed

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/1-kubectl-kcl-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ Ingress should be https. The `kubernetes.io/ingress.allow-http: "false"` annotat
195195

196196
Here's what you can do in the KCL code:
197197

198-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
198+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
199199
- Return a KRM list for output resources.
200200
- Return an error using `assert {condition}, {error_message}`.
201+
- Read the PATH variables. e.g. `option("PATH")`.
202+
- Read the environment variables. e.g. `option("env")`.
201203

202204
## More Resources
203205

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/2-helm-kcl-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,11 @@ spec:
9191
9292
Here's what you can do in the KCL code:
9393
94-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
94+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
9595
- Return a KRM list for output resources.
9696
- Return an error using `assert {condition}, {error_message}`.
97+
- Read the PATH variables. e.g. `option("PATH")`.
98+
- Read the environment variables. e.g. `option("env")`.
9799

98100
## More Documents and Examples
99101

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/3-kustomize-kcl-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,11 @@ spec:
9696
9797
Here's what you can do in the KCL code:
9898
99-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
99+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
100100
- Return a KRM list for output resources.
101101
- Return an error using `assert {condition}, {error_message}`.
102+
- Read the PATH variables. e.g. `option("PATH")`.
103+
- Read the environment variables. e.g. `option("env")`.
102104

103105
## More Documents and Examples
104106

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/4-kpt-kcl-sdk.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ It can be seen that we have indeed added the annotation `managed-by=kpt`.
8787

8888
Here's what you can do in the KCL code:
8989

90-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
90+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
9191
- Return a KRM list for output resources.
9292
- Return an error using `assert {condition}, {error_message}`.
93+
- Read the PATH variables. e.g. `option("PATH")`.
94+
- Read the environment variables. e.g. `option("env")`.
9395

9496
## More Documents and Examples
9597

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/5-helmfile-kcl-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,11 @@ Adding repo prometheus-community https://prometheus-community.github.io/helm-cha
104104

105105
Here's what you can do in the KCL code:
106106

107-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
107+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
108108
- Return a KRM list for output resources.
109109
- Return an error using `assert {condition}, {error_message}`.
110+
- Read the PATH variables. e.g. `option("PATH")`.
111+
- Read the environment variables. e.g. `option("env")`.
110112

111113
## More Documents and Examples
112114

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/6-kcl-operator.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,11 @@ The output is
8383

8484
Here's what you can do in the KCL code:
8585

86-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("items")` and the params from `option("params")`.
86+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
8787
- Return a KRM list for output resources.
8888
- Return an error using `assert {condition}, {error_message}`.
89+
- Read the PATH variables. e.g. `option("PATH")`.
90+
- Read the environment variables. e.g. `option("env")`.
8991

9092
## More Documents and Examples
9193

docs/user_docs/guides/working-with-k8s/3-mutate-manifests/7-crossplane-kcl-function.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,20 @@ spec:
221221
222222
Here's what you can do in the KCL script:
223223
224-
- Return an error using `assert {condition}, {error_message}`.
225224
- Read the `ObservedCompositeResource` from `option("params").oxr`.
226225
- Read the `ObservedComposedResources` from `option("params").ocds`.
227226
- Read the `DesiredCompositeResource` from `option("params").dxr`.
228227
- Read the `DesiredComposedResources` from `option("params").dcds`.
229-
- Read the environment variables. e.g. `option("PATH")` (**Not yet implemented**).
228+
- Read the function pipeline's context from `option("params").ctx`.
229+
- Return an error using `assert {condition}, {error_message}`.
230+
- Read the PATH variables. e.g. `option("PATH")`.
231+
- Read the environment variables. e.g. `option("env")`.
230232

231233
## Library
232234

233235
You can directly use [KCL standard libraries](https://kcl-lang.io/docs/reference/model/overview) such as `regex.match`, `math.log`.
234236

235237
## More Documents and Examples
236238

239+
- [Crossplane KCL](https://github.com/crossplane-contrib/function-kcl/)
237240
- [KRM KCL Spec](https://github.com/kcl-lang/krm-kcl)
238-
- [Crossplane KCL](https://github.com/crossplane-contrib/function-kcl/examples)

i18n/zh-CN/docusaurus-plugin-content-docs/current/user_docs/guides/working-with-k8s/3-mutate-manifests/1-kubectl-kcl-plugin.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ Ingress should be https. The `kubernetes.io/ingress.allow-http: "false"` annotat
195195

196196
Here's what you can do in the KCL code:
197197

198-
- Read resources from `option("resource_list")`. The `option("resource_list")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification). You can read the input resources from `option("resource_list")["items"]` and the `functionConfig` from `option("resource_list")["functionConfig"]`.
198+
- Read resources from `option("items")`. The `option("items")` complies with the [KRM Functions Specification](https://kpt.dev/book/05-developing-functions/01-functions-specification).
199199
- Return a KRM list for output resources.
200200
- Return an error using `assert {condition}, {error_message}`.
201+
- Read the PATH variables. e.g. `option("PATH")`.
202+
- Read the environment variables. e.g. `option("env")`.
201203

202204
## More Resources
203205

0 commit comments

Comments
 (0)