From ff3b62c21c3f100aa5e9695faa02c2917db02918 Mon Sep 17 00:00:00 2001 From: Ihor Sychevskyi Date: Tue, 12 Mar 2024 14:50:21 +0200 Subject: [PATCH] update blog & cli folder docs for MDX3 (#1315) Signed-off-by: Arhell --- ...esources-of-aws-using-100-lines-of-code.md | 4 +-- blog/2022-05-30-abstraction-kubevela.md | 32 +++++++++++++++++-- docs/cli/vela_addon_push.md | 6 ++-- docs/cli/vela_completion_bash.md | 2 +- docs/cli/vela_completion_zsh.md | 4 +-- docs/cli/vela_ql.md | 2 +- docs/cli/vela_uischema.md | 2 +- docs/cli/vela_uischema_apply.md | 2 +- 8 files changed, 40 insertions(+), 14 deletions(-) diff --git a/blog/2022-03-01-kubevela-generate-top-50-popular-resources-of-aws-using-100-lines-of-code.md b/blog/2022-03-01-kubevela-generate-top-50-popular-resources-of-aws-using-100-lines-of-code.md index c549480bdf8..9cb354f4a68 100644 --- a/blog/2022-03-01-kubevela-generate-top-50-popular-resources-of-aws-using-100-lines-of-code.md +++ b/blog/2022-03-01-kubevela-generate-top-50-popular-resources-of-aws-using-100-lines-of-code.md @@ -287,9 +287,9 @@ vela def init {ModuleName} --type component --provider {providerName} --git {git Several items to be filled in the instruction are passed in from the parsed Module structure. -* gitURL: {Module.Attributes.Source}.git +* gitURL: \{Module.Attributes.Source\}.git * description: If there are elements in `Included` which have the same ID with relationship.latest-version.ID, set the description as the corresponding description in `Included` elements, otherwise set the description as providerName+ModuleName. -* yamlFileName:terraform-{providerName}-{Module.Attributes.Name}.yaml +* yamlFileName:terraform-\{providerName\}-\{Module.Attributes.Name\}.yaml diff --git a/blog/2022-05-30-abstraction-kubevela.md b/blog/2022-05-30-abstraction-kubevela.md index 170debc24f5..cd2ceca9d16 100644 --- a/blog/2022-05-30-abstraction-kubevela.md +++ b/blog/2022-05-30-abstraction-kubevela.md @@ -20,10 +20,13 @@ Let's start the journey by using the [Kubernetes StatefulSet](https://kubernetes Save the YAML example of StatefulSet in the official document locally and name it as `my-stateful.yaml`, then execute command as below: +``` vela def init my-stateful -t component --desc "My StatefulSet component." --template-yaml ./my-stateful.yaml -o my-stateful.cue +``` View the generated "my-stateful.cue" file: +``` $ cat my-stateful.cue "my-stateful": { annotations: {} @@ -50,6 +53,8 @@ View the generated "my-stateful.cue" file: parameter: {} } +``` + Modify the generated file as follows: 1. The example of the official StatefulSet website is a composite component composed of two objects `StatefulSet` and `Service`. According to KubeVela [Rules for customize component](https://kubevela.io/docs/platform-engineers/components/custom-component), in composite components, one of the resources such (StatefulSet in our example) need to be represented by the `template.output` field as a core workload, and other auxiliary objects are represented by `template.outputs`, so we make some adjustments and all the automatically generated output and outputs are switched. @@ -57,11 +62,14 @@ Modify the generated file as follows: After modification, you can use `vela def vet` to do format check and verification. +``` $ vela def vet my-stateful.cue Validation succeed. +``` The file after two steps of changes is as follows: +``` $ cat my-stateful.cue "my-stateful": { annotations: {} @@ -129,22 +137,28 @@ The file after two steps of changes is as follows: } parameter: {} } +``` Install ComponentDefinition into the Kubernetes cluster: +``` $ vela def apply my-stateful.cue ComponentDefinition my-stateful created in namespace vela-system. +``` You can see that a `my-stateful` component via `vela components` command: +``` $ vela components NAME NAMESPACE WORKLOAD DESCRIPTION ... my-stateful vela-system statefulsets.apps My StatefulSet component. ... +``` When you put this customized component into `Application`, it looks like: +``` cat < and . +Two arguments are needed \ and \. -The first argument can be: +The first argument \ can be: - your conventional addon directory (containing metadata.yaml). We will package it for you. - packaged addon (.tgz) generated by 'vela addon package' command -The second argument can be: +The second argument \ can be: - registry name (helm type). You can add your ChartMuseum registry using 'vela addon registry add'. - ChartMuseum URL, e.g. http://localhost:8080 diff --git a/docs/cli/vela_completion_bash.md b/docs/cli/vela_completion_bash.md index ac9410288a8..058dbe662d2 100644 --- a/docs/cli/vela_completion_bash.md +++ b/docs/cli/vela_completion_bash.md @@ -9,7 +9,7 @@ generate autocompletions script for bash Generate the autocompletion script for Vela for the bash shell. To load completions in your current shell session: -$ source <(vela completion bash) +$ source \<(vela completion bash) To load completions for every new session, execute once: Linux: diff --git a/docs/cli/vela_completion_zsh.md b/docs/cli/vela_completion_zsh.md index 73ad8100697..90bf6e8592f 100644 --- a/docs/cli/vela_completion_zsh.md +++ b/docs/cli/vela_completion_zsh.md @@ -9,10 +9,10 @@ generate autocompletions script for zsh Generate the autocompletion script for Vela for the zsh shell. To load completions in your current shell session: -$ source <(vela completion zsh) +$ source \<(vela completion zsh) To load completions for every new session, execute once: -$ vela completion zsh > "${fpath[1]}/_vela" +$ vela completion zsh > "$\{fpath[1]\}/_vela" ``` diff --git a/docs/cli/vela_ql.md b/docs/cli/vela_ql.md index 369c4a3f8c6..4475ea34ea1 100644 --- a/docs/cli/vela_ql.md +++ b/docs/cli/vela_ql.md @@ -7,7 +7,7 @@ Show result of executing velaQL. ### Synopsis Show result of executing velaQL, use it like: - vela ql --query "inner-view-name{param1=value1,param2=value2}" + vela ql --query "inner-view-name\{param1=value1,param2=value2\}" vela ql --file ./ql.cue ``` diff --git a/docs/cli/vela_uischema.md b/docs/cli/vela_uischema.md index b2edca7db48..6daab81c913 100644 --- a/docs/cli/vela_uischema.md +++ b/docs/cli/vela_uischema.md @@ -24,7 +24,7 @@ Manage UI schema for addons. ### SEE ALSO -* [vela uischema apply](vela_uischema_apply.md) - apply +* [vela uischema apply](vela_uischema_apply.md) - apply \ #### Go Back to [CLI Commands](vela.md) Homepage. diff --git a/docs/cli/vela_uischema_apply.md b/docs/cli/vela_uischema_apply.md index 3e166377c75..ac20ca1fc51 100644 --- a/docs/cli/vela_uischema_apply.md +++ b/docs/cli/vela_uischema_apply.md @@ -2,7 +2,7 @@ title: vela uischema apply --- -apply +apply \ ### Synopsis