From b640f234ed6951d65c1964aa5c729ea603b5a5c3 Mon Sep 17 00:00:00 2001 From: Nick Capps Date: Wed, 30 Aug 2023 20:47:20 -0700 Subject: [PATCH 1/2] Add CLI page Start operations section Refine operations section Add common operations Address comments --- .../en/docs/Reference/kustomize_cli.md | 80 +++++++++++++++++-- 1 file changed, 75 insertions(+), 5 deletions(-) diff --git a/site/content/en/docs/Reference/kustomize_cli.md b/site/content/en/docs/Reference/kustomize_cli.md index 8af75a1bbe..4dc850b7a9 100644 --- a/site/content/en/docs/Reference/kustomize_cli.md +++ b/site/content/en/docs/Reference/kustomize_cli.md @@ -1,8 +1,78 @@ --- -title: "kustomize CLI" -linkTitle: "kustomize CLI" -weight: 2 +title: "Command Line Interface" +linkTitle: "Command Line Interface" +weight: 0 date: 2017-01-05 description: > - Reference for the kustomize CLI ---- \ No newline at end of file + Reference for the Command Line Interface. +--- + +This overview covers `kustomize` syntax, describes the command operations, and provides common examples. + +## Syntax +Use the following syntax to run `kustomize` commands from your terminal window: + +```bash +kustomize [command] +``` + +The `command` flag specifies the operation that you want to perform, for example `create`, `build`, `cfg`. + +If you need help, run `kustomize help` from the terminal window. + +## Operations +The following table includes short descriptions and the general syntax for all the `kustomize` operations. + +Operation | Syntax | Description +--- | --- | --- +build | `kustomize build DIR [flags]` | Build a kustomization target from a directory or URL. +cfg | `kustomize cfg [command]` | Commands for reading and writing configuration. +completion | `kustomize completion` [bash\|zsh\|fish\|powershell] | Generate shell completion script. +create | `kustomize create [flags]` | Create a new kustomization in the current directory. +edit | `kustomize edit [command]` | Edits a kustomization file. +fn | `kustomize fn [command]` | Commands for running functions against configuration. +localize | `kustomize localize [target [destination]] [flags]` | [Alpha] Creates localized copy of target kustomization root at destination. +version | `kustomize version [flags]` | Prints the kustomize version. + +## Examples: Common Operations +Use the following set of examples to help you familiarize yourself with running the commonly used `kustomize` operations: + +`kustomize build` - Build a kustomization target from a directory or URL. + +```bash +# Build the current working directory +kustomize build + +# Build some shared configuration directory +kustomize build /home/config/production + +# Build from github +kustomize build https://github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6 +``` + +`kustomize create` - Create a new kustomization in the current directory. +```bash +# Create an empty kustomization.yaml file +kustomize create + +# Create a new overlay from the base '../base". +kustomize create --resources ../base + +# Create a new kustomization detecting resources in the current directory. +kustomize create --autodetect + +# Create a new kustomization with multiple resources and fields set. +kustomize create --resources deployment.yaml,service.yaml,../base --namespace staging --nameprefix acme- +``` + +`kustomize edit` - Edits a kustomization file. +```bash +# Adds a configmap to the kustomization file +kustomize edit add configmap NAME --from-literal=k=v + +# Sets the nameprefix field +kustomize edit set nameprefix + +# Sets the namesuffix field +kustomize edit set namesuffix +``` From 7cb2eb520f370dc9522000ac602c4c0af258993f Mon Sep 17 00:00:00 2001 From: Nick Capps Date: Fri, 15 Sep 2023 07:35:27 -0700 Subject: [PATCH 2/2] Move the cli content to the CLI section Update the CLI description --- site/content/en/docs/Reference/CLI/_index.md | 74 +++++++++++++++++- .../en/docs/Reference/kustomize_cli.md | 78 ------------------- 2 files changed, 72 insertions(+), 80 deletions(-) delete mode 100644 site/content/en/docs/Reference/kustomize_cli.md diff --git a/site/content/en/docs/Reference/CLI/_index.md b/site/content/en/docs/Reference/CLI/_index.md index e0355fa3fc..8826b072cf 100644 --- a/site/content/en/docs/Reference/CLI/_index.md +++ b/site/content/en/docs/Reference/CLI/_index.md @@ -4,5 +4,75 @@ linkTitle: "CLI" weight: 3 date: 2023-07-28 description: > - The command line tools to interact with Kustomize. ---- \ No newline at end of file + Reference for the Command Line Interface. +--- + +This overview covers `kustomize` syntax, describes the command operations, and provides common examples. + +## Syntax +Use the following syntax to run `kustomize` commands from your terminal window: + +```bash +kustomize [command] +``` + +The `command` flag specifies the operation that you want to perform, for example `create`, `build`, `cfg`. + +If you need help, run `kustomize help` from the terminal window. + +## Operations +The following table includes short descriptions and the general syntax for all the `kustomize` operations. + +Operation | Syntax | Description +--- | --- | --- +build | `kustomize build DIR [flags]` | Build a kustomization target from a directory or URL. +cfg | `kustomize cfg [command]` | Commands for reading and writing configuration. +completion | `kustomize completion` [bash\|zsh\|fish\|powershell] | Generate shell completion script. +create | `kustomize create [flags]` | Create a new kustomization in the current directory. +edit | `kustomize edit [command]` | Edits a kustomization file. +fn | `kustomize fn [command]` | Commands for running functions against configuration. +localize | `kustomize localize [target [destination]] [flags]` | [Alpha] Creates localized copy of target kustomization root at destination. +version | `kustomize version [flags]` | Prints the kustomize version. + +## Examples: Common Operations +Use the following set of examples to help you familiarize yourself with running the commonly used `kustomize` operations: + +`kustomize build` - Build a kustomization target from a directory or URL. + +```bash +# Build the current working directory +kustomize build + +# Build some shared configuration directory +kustomize build /home/config/production + +# Build from github +kustomize build https://github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6 +``` + +`kustomize create` - Create a new kustomization in the current directory. +```bash +# Create an empty kustomization.yaml file +kustomize create + +# Create a new overlay from the base '../base". +kustomize create --resources ../base + +# Create a new kustomization detecting resources in the current directory. +kustomize create --autodetect + +# Create a new kustomization with multiple resources and fields set. +kustomize create --resources deployment.yaml,service.yaml,../base --namespace staging --nameprefix acme- +``` + +`kustomize edit` - Edits a kustomization file. +```bash +# Adds a configmap to the kustomization file +kustomize edit add configmap NAME --from-literal=k=v + +# Sets the nameprefix field +kustomize edit set nameprefix + +# Sets the namesuffix field +kustomize edit set namesuffix +``` diff --git a/site/content/en/docs/Reference/kustomize_cli.md b/site/content/en/docs/Reference/kustomize_cli.md deleted file mode 100644 index 4dc850b7a9..0000000000 --- a/site/content/en/docs/Reference/kustomize_cli.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -title: "Command Line Interface" -linkTitle: "Command Line Interface" -weight: 0 -date: 2017-01-05 -description: > - Reference for the Command Line Interface. ---- - -This overview covers `kustomize` syntax, describes the command operations, and provides common examples. - -## Syntax -Use the following syntax to run `kustomize` commands from your terminal window: - -```bash -kustomize [command] -``` - -The `command` flag specifies the operation that you want to perform, for example `create`, `build`, `cfg`. - -If you need help, run `kustomize help` from the terminal window. - -## Operations -The following table includes short descriptions and the general syntax for all the `kustomize` operations. - -Operation | Syntax | Description ---- | --- | --- -build | `kustomize build DIR [flags]` | Build a kustomization target from a directory or URL. -cfg | `kustomize cfg [command]` | Commands for reading and writing configuration. -completion | `kustomize completion` [bash\|zsh\|fish\|powershell] | Generate shell completion script. -create | `kustomize create [flags]` | Create a new kustomization in the current directory. -edit | `kustomize edit [command]` | Edits a kustomization file. -fn | `kustomize fn [command]` | Commands for running functions against configuration. -localize | `kustomize localize [target [destination]] [flags]` | [Alpha] Creates localized copy of target kustomization root at destination. -version | `kustomize version [flags]` | Prints the kustomize version. - -## Examples: Common Operations -Use the following set of examples to help you familiarize yourself with running the commonly used `kustomize` operations: - -`kustomize build` - Build a kustomization target from a directory or URL. - -```bash -# Build the current working directory -kustomize build - -# Build some shared configuration directory -kustomize build /home/config/production - -# Build from github -kustomize build https://github.com/kubernetes-sigs/kustomize.git/examples/helloWorld?ref=v1.0.6 -``` - -`kustomize create` - Create a new kustomization in the current directory. -```bash -# Create an empty kustomization.yaml file -kustomize create - -# Create a new overlay from the base '../base". -kustomize create --resources ../base - -# Create a new kustomization detecting resources in the current directory. -kustomize create --autodetect - -# Create a new kustomization with multiple resources and fields set. -kustomize create --resources deployment.yaml,service.yaml,../base --namespace staging --nameprefix acme- -``` - -`kustomize edit` - Edits a kustomization file. -```bash -# Adds a configmap to the kustomization file -kustomize edit add configmap NAME --from-literal=k=v - -# Sets the nameprefix field -kustomize edit set nameprefix - -# Sets the namesuffix field -kustomize edit set namesuffix -```