From f355b297be7ec0c8361df5ba575c514e2d978de0 Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Wed, 1 Feb 2023 06:53:59 +0800 Subject: [PATCH] add build-in objects docs (#667) Signed-off-by: yxxhero --- docs/builtin-objects.md | 42 +++++++++++++++++++++++++++++++++++++++++ mkdocs.yml | 1 + 2 files changed, 43 insertions(+) create mode 100644 docs/builtin-objects.md diff --git a/docs/builtin-objects.md b/docs/builtin-objects.md new file mode 100644 index 00000000..fa3f92ce --- /dev/null +++ b/docs/builtin-objects.md @@ -0,0 +1,42 @@ +# helmfile template built-in objects + +- `Environment`: The information about the environment. This is set by the + `--environment` flag. It has several objects inside of it: + - `Environment.Name`: The name of the environment +- `Values`: Values passed into the environment. +- `StateValues`: alias for `Values`. +- `Namespace`: The namespace to be released into + +# release template built-in objects + +it be used for the below case: +``` +apiVersion: v1 +kind: ConfigMap +metadata: + # release template + name: {{`{{ .Release.Name }}`}}-1 + namespace: {{`{{ .Release.Namespace }}`}} +data: + foo: FOO +``` + +- `Release`: This object describes the release itself. It has several objects + inside of it: + - `Release.Name`: The release name + - `Release.Namespace`: The namespace to be released into + - `Release.Labels`: The labels to be applied to the release + - `Release.Chart`: The chart name of the release + - `Release.KubeContext`: The kube context to be used for the release +- `Values`: Values passed into the environment. +- `StateValues`: alias for `Values`. +- `Environment`: The information about the environment. This is set by the + `--environment` flag. It has several objects inside of it: + - `Environment.Name`: The name of the environment +- `Chart`: The chart name for the release. +- `KubeContext`: The kube context to be used for the release +- `Namespace`: The namespace to be released into + +The built-in values always begin with a capital letter. This is in keeping with +Go's naming convention. When you define your own values and template variables, you are free to use a +convention that suits your team. \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 59cfc7c0..6480bfd6 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -18,6 +18,7 @@ nav: - Getting Started: - Paths Overview: paths.md - Templating Funs: templating_funcs.md + - Built-in Objects: builtin-objects.md - Advanced Features: - Best Practices Guide: writing-helmfile.md - Advanced Features: advanced-features.md