Update `gotk create helmrelease` examples

To better reflect optional fields and highlight specific configuration
options.
pull/201/head
Hidde Beydals 4 years ago
parent 6b397cff73
commit 2f861f19c0

@ -42,37 +42,41 @@ var createHelmReleaseCmd = &cobra.Command{
Aliases: []string{"hr"}, Aliases: []string{"hr"},
Short: "Create or update a HelmRelease resource", Short: "Create or update a HelmRelease resource",
Long: "The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.", 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 \ gotk create hr podinfo \
--interval=10m \ --interval=10m \
--release-name=podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=">4.0.0" --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 \ gotk create hr podinfo \
--interval=10m \ --interval=10m \
--release-name=podinfo \
--target-namespace=default \
--source=GitRepository/podinfo \ --source=GitRepository/podinfo \
--chart=./charts/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 \ gotk create hr podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=4.0.5 \
--values=./my-values.yaml --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 \ gotk create hr podinfo \
--target-namespace=default \ --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 \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=4.0.5 \
--values=./values.yaml \ --values=./values.yaml \
--export > podinfo-release.yaml --export > podinfo-release.yaml
`, `,
@ -90,10 +94,10 @@ var (
) )
func init() { func init() {
createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '<target-namespace>-<hr-name>'") createHelmReleaseCmd.Flags().StringVar(&hrName, "release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<hr-name>'")
createHelmReleaseCmd.Flags().StringVar(&hrSource, "source", "", "source that contains the chart (<kind>/<name>)") createHelmReleaseCmd.Flags().StringVar(&hrSource, "source", "", "source that contains the chart (<kind>/<name>)")
createHelmReleaseCmd.Flags().StringVar(&hrChart, "chart", "", "Helm chart name or path") 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().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(&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") createHelmReleaseCmd.Flags().StringVar(&hrValuesFile, "values", "", "local path to the values.yaml file")

@ -13,37 +13,41 @@ gotk create helmrelease [name] [flags]
### Examples ### Examples
``` ```
# Create a HelmRelease from a HelmRepository source # Create a HelmRelease with a chart from a HelmRepository source
gotk create hr podinfo \ gotk create hr podinfo \
--interval=10m \ --interval=10m \
--release-name=podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=">4.0.0" --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 \ gotk create hr podinfo \
--interval=10m \ --interval=10m \
--release-name=podinfo \
--target-namespace=default \
--source=GitRepository/podinfo \ --source=GitRepository/podinfo \
--chart=./charts/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 \ gotk create hr podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=4.0.5 \
--values=./my-values.yaml --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 \ gotk create hr podinfo \
--target-namespace=default \ --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 \ --source=HelmRepository/podinfo \
--chart=podinfo \ --chart=podinfo \
--chart-version=4.0.5 \
--values=./values.yaml \ --values=./values.yaml \
--export > podinfo-release.yaml --export > podinfo-release.yaml
@ -53,10 +57,10 @@ gotk create helmrelease [name] [flags]
``` ```
--chart string Helm chart name or path --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 --depends-on stringArray HelmReleases that must be ready before this release can be installed
-h, --help help for helmrelease -h, --help help for helmrelease
--release-name string name used for the Helm release, defaults to a composition of '<target-namespace>-<hr-name>' --release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<hr-name>'
--source string source that contains the chart (<kind>/<name>) --source string source that contains the chart (<kind>/<name>)
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace --target-namespace string namespace to install this release, defaults to the HelmRelease namespace
--values string local path to the values.yaml file --values string local path to the values.yaml file

Loading…
Cancel
Save