From 6deb3732ba99799e8073db4de0de8c549b3cd157 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Sat, 30 Dec 2023 00:54:07 +0200 Subject: [PATCH] docs: Add Import Resources from YAML guide Signed-off-by: Stefan Prodan --- docs/cue/module/import-resources.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 docs/cue/module/import-resources.md diff --git a/docs/cue/module/import-resources.md b/docs/cue/module/import-resources.md new file mode 100644 index 00000000..5f1126d5 --- /dev/null +++ b/docs/cue/module/import-resources.md @@ -0,0 +1,20 @@ +# Import Kubernetes Resources from YAML + +!!! info "Work in progress" + + This guide is under construction and will be updated soon. + +The `cue` CLI can import Kubernetes objects from YAML files and convert them to CUE. + +Assuming you have a YAML file named `manifests.yaml` with one or more Kubernetes objects, +run the following command in the module's root directory: + +```shell +cue import /path/to/manifests.yaml \ + -o -f templates/manifests.cue -p templates \ + -l 'strings.ToLower(kind)' -l 'metadata.name' +``` + +The generated CUE definitions will be written to `templates/manifests.cue`, from where you can +modify them to fit with the Timoni's template model. +