From 2f861f19c0efb5e52cf2f4719db10f7818038c5e Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Thu, 3 Sep 2020 19:28:18 +0200 Subject: [PATCH] Update `gotk create helmrelease` examples To better reflect optional fields and highlight specific configuration options. --- cmd/gotk/create_helmrelease.go | 30 ++++++++++++++++------------- docs/cmd/gotk_create_helmrelease.md | 30 ++++++++++++++++------------- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/cmd/gotk/create_helmrelease.go b/cmd/gotk/create_helmrelease.go index c172079e..d99c58c1 100644 --- a/cmd/gotk/create_helmrelease.go +++ b/cmd/gotk/create_helmrelease.go @@ -42,37 +42,41 @@ var createHelmReleaseCmd = &cobra.Command{ Aliases: []string{"hr"}, Short: "Create or update a HelmRelease resource", Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.", - Example: ` # Create a HelmRelease from a HelmRepository source + Example: ` # Create a HelmRelease with a chart from a HelmRepository source gotk create hr podinfo \ --interval=10m \ - --release-name=podinfo \ - --target-namespace=default \ --source=HelmRepository/podinfo \ --chart=podinfo \ --chart-version=">4.0.0" - # Create a HelmRelease from a GitRepository source + # Create a HelmRelease with a chart from a GitRepository source gotk create hr podinfo \ --interval=10m \ - --release-name=podinfo \ - --target-namespace=default \ --source=GitRepository/podinfo \ --chart=./charts/podinfo - # Create a HelmRelease with values for a local YAML file + # Create a HelmRelease with values from a local YAML file gotk create hr podinfo \ - --target-namespace=default \ --source=HelmRepository/podinfo \ --chart=podinfo \ - --chart-version=4.0.5 \ --values=./my-values.yaml - # Create a HelmRelease definition on disk without applying it on the cluster + # Create a HelmRelease with a custom release name + gotk create hr podinfo \ + --release-name=podinfo-dev + --source=HelmRepository/podinfo \ + --chart=podinfo \ + + # Create a HelmRelease targeting another namespace than the resource gotk create hr podinfo \ --target-namespace=default \ + --source=HelmRepository/podinfo \ + --chart=podinfo + + # Create a HelmRelease definition on disk without applying it on the cluster + gotk create hr podinfo \ --source=HelmRepository/podinfo \ --chart=podinfo \ - --chart-version=4.0.5 \ --values=./values.yaml \ --export > podinfo-release.yaml `, @@ -90,10 +94,10 @@ var ( ) func init() { - createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '-'") + createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '[-]'") createHelmReleaseCmd.Flags().StringVar(&hrSource, "source", "", "source that contains the chart (/)") createHelmReleaseCmd.Flags().StringVar(&hrChart, "chart", "", "Helm chart name or path") - createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts semver range (ignored for charts from GitRepository sources)") + createHelmReleaseCmd.Flags().StringVar(&hrChartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)") createHelmReleaseCmd.Flags().StringArrayVar(&hrDependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed") createHelmReleaseCmd.Flags().StringVar(&hrTargetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace") createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file") diff --git a/docs/cmd/gotk_create_helmrelease.md b/docs/cmd/gotk_create_helmrelease.md index ac8d1ebe..6d70401e 100644 --- a/docs/cmd/gotk_create_helmrelease.md +++ b/docs/cmd/gotk_create_helmrelease.md @@ -13,37 +13,41 @@ gotk create helmrelease [name] [flags] ### Examples ``` - # Create a HelmRelease from a HelmRepository source + # Create a HelmRelease with a chart from a HelmRepository source gotk create hr podinfo \ --interval=10m \ - --release-name=podinfo \ - --target-namespace=default \ --source=HelmRepository/podinfo \ --chart=podinfo \ --chart-version=">4.0.0" - # Create a HelmRelease from a GitRepository source + # Create a HelmRelease with a chart from a GitRepository source gotk create hr podinfo \ --interval=10m \ - --release-name=podinfo \ - --target-namespace=default \ --source=GitRepository/podinfo \ --chart=./charts/podinfo - # Create a HelmRelease with values for a local YAML file + # Create a HelmRelease with values from a local YAML file gotk create hr podinfo \ - --target-namespace=default \ --source=HelmRepository/podinfo \ --chart=podinfo \ - --chart-version=4.0.5 \ --values=./my-values.yaml - # Create a HelmRelease definition on disk without applying it on the cluster + # Create a HelmRelease with a custom release name + gotk create hr podinfo \ + --release-name=podinfo-dev + --source=HelmRepository/podinfo \ + --chart=podinfo \ + + # Create a HelmRelease targeting another namespace than the resource gotk create hr podinfo \ --target-namespace=default \ + --source=HelmRepository/podinfo \ + --chart=podinfo + + # Create a HelmRelease definition on disk without applying it on the cluster + gotk create hr podinfo \ --source=HelmRepository/podinfo \ --chart=podinfo \ - --chart-version=4.0.5 \ --values=./values.yaml \ --export > podinfo-release.yaml @@ -53,10 +57,10 @@ gotk create helmrelease [name] [flags] ``` --chart string Helm chart name or path - --chart-version string Helm chart version, accepts semver range (ignored for charts from GitRepository sources) + --chart-version string Helm chart version, accepts a semver range (ignored for charts from GitRepository sources) --depends-on stringArray HelmReleases that must be ready before this release can be installed -h, --help help for helmrelease - --release-name string name used for the Helm release, defaults to a composition of '-' + --release-name string name used for the Helm release, defaults to a composition of '[-]' --source string source that contains the chart (/) --target-namespace string namespace to install this release, defaults to the HelmRelease namespace --values string local path to the values.yaml file