mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Merge pull request #1922 from bzub/cmd_config_docs
cmd/config: Documentation nits + updates.
This commit is contained in:
@@ -284,8 +284,7 @@ Following is an example of running the ` + "`" + `kustomize config run` + "`" +
|
||||
name: http
|
||||
selector:
|
||||
app: nginx
|
||||
instance: my-instance
|
||||
`
|
||||
instance: my-instance`
|
||||
|
||||
var ConfigIoLong = `# Configuration IO API Semantics
|
||||
|
||||
|
||||
@@ -180,7 +180,7 @@ order they appear in the file).
|
||||
would then write the container stdout back to example/, replacing the directory
|
||||
file contents.
|
||||
|
||||
See ` + "`" + `kustomize config help docs-fn` + "`" + ` for more details on writing functions.
|
||||
See ` + "`" + `kustomize help config docs-fn` + "`" + ` for more details on writing functions.
|
||||
`
|
||||
var RunFnsExamples = `
|
||||
kustomize config run example/`
|
||||
@@ -220,15 +220,15 @@ var TreeExamples = `
|
||||
kustomize config tree my-dir/ --field "metadata.annotations.foo"
|
||||
|
||||
# print the "foo"" annotation
|
||||
kubectl get all -o yaml | kustomize config tree my-dir/ --structure=graph \
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
--field="status.conditions[type=Completed].status"
|
||||
|
||||
# print live Resources from a cluster using graph for structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image --structure=graph
|
||||
# print live Resources from a cluster using owners for graph structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image \
|
||||
--graph-structure=owners
|
||||
|
||||
|
||||
# print live Resources using graph for structure
|
||||
kubectl get all,applications,releasetracks -o yaml | kustomize config tree --structure=graph \
|
||||
# print live Resources with status condition fields
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
--name --image --replicas \
|
||||
--field="status.conditions[type=Completed].status" \
|
||||
--field="status.conditions[type=Complete].status" \
|
||||
|
||||
@@ -146,7 +146,6 @@ var ConfigurationBasicsLong = `
|
||||
- list elements may be indexed by a field value using list[field=value]
|
||||
- '.' as part of a key or value may be escaped as '\.'
|
||||
|
||||
|
||||
$ kustomize config grep "spec.status.spec.containers[name=nginx].image=mysql:5\.6" wordpress/
|
||||
apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1
|
||||
kind: Deployment
|
||||
@@ -166,7 +165,6 @@ var ConfigurationBasicsLong = `
|
||||
tier: mysql
|
||||
...
|
||||
|
||||
|
||||
` + "`" + `grep` + "`" + ` may be used with kubectl to search for Resources in a cluster matching a value.
|
||||
|
||||
kubectl get all -o yaml | kustomize config grep "spec.replicas>0" | kustomize config tree --replicas
|
||||
@@ -323,7 +321,6 @@ var FunctionBasicsLong = `
|
||||
re-run ` + "`" + `run` + "`" + `. this will apply the updated replicas to the generated Resources,
|
||||
but keep the fields that you manually added to the generated Resource configuration.
|
||||
|
||||
|
||||
# run the function
|
||||
kustomize config run local-resource/
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ Tutorials:
|
||||
|
||||
Run 'kustomize help config tutorial-TUTORIAL'
|
||||
|
||||
$ kustomize help config tutorials-basics
|
||||
$ kustomize help config tutorials-command-basics
|
||||
|
||||
Command Documentation:
|
||||
|
||||
|
||||
@@ -279,4 +279,3 @@ Following is an example of running the `kustomize config run` using the precedin
|
||||
selector:
|
||||
app: nginx
|
||||
instance: my-instance
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ metadata:
|
||||
config.kubernetes.io/index: 2
|
||||
```
|
||||
|
||||
This represents the thrid Resource in the file.
|
||||
This represents the third Resource in the file.
|
||||
|
||||
### `config.kubernetes.io/local-config`
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ order they appear in the file).
|
||||
would then write the container stdout back to example/, replacing the directory
|
||||
file contents.
|
||||
|
||||
See `kustomize config help docs-fn` for more details on writing functions.
|
||||
See `kustomize help config docs-fn` for more details on writing functions.
|
||||
|
||||
### Examples
|
||||
|
||||
|
||||
@@ -38,15 +38,15 @@ from the cluster, the Resource graph structure may be used instead.
|
||||
kustomize config tree my-dir/ --field "metadata.annotations.foo"
|
||||
|
||||
# print the "foo"" annotation
|
||||
kubectl get all -o yaml | kustomize config tree my-dir/ --structure=graph \
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
--field="status.conditions[type=Completed].status"
|
||||
|
||||
# print live Resources from a cluster using graph for structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image --structure=graph
|
||||
# print live Resources from a cluster using owners for graph structure
|
||||
kubectl get all -o yaml | kustomize config tree --replicas --name --image \
|
||||
--graph-structure=owners
|
||||
|
||||
|
||||
# print live Resources using graph for structure
|
||||
kubectl get all,applications,releasetracks -o yaml | kustomize config tree --structure=graph \
|
||||
# print live Resources with status condition fields
|
||||
kubectl get all -o yaml | kustomize config tree \
|
||||
--name --image --replicas \
|
||||
--field="status.conditions[type=Completed].status" \
|
||||
--field="status.conditions[type=Complete].status" \
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
- list elements may be indexed by a field value using list[field=value]
|
||||
- '.' as part of a key or value may be escaped as '\.'
|
||||
|
||||
|
||||
$ kustomize config grep "spec.status.spec.containers[name=nginx].image=mysql:5\.6" wordpress/
|
||||
apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1
|
||||
kind: Deployment
|
||||
@@ -162,7 +161,6 @@
|
||||
tier: mysql
|
||||
...
|
||||
|
||||
|
||||
`grep` may be used with kubectl to search for Resources in a cluster matching a value.
|
||||
|
||||
kubectl get all -o yaml | kustomize config grep "spec.replicas>0" | kustomize config tree --replicas
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
re-run `run`. this will apply the updated replicas to the generated Resources,
|
||||
but keep the fields that you manually added to the generated Resource configuration.
|
||||
|
||||
|
||||
# run the function
|
||||
kustomize config run local-resource/
|
||||
|
||||
|
||||
@@ -17,9 +17,9 @@ Resource configuration, and looks for invalid configuration.
|
||||
The function is invoked by authoring a [local Resource](local-resource)
|
||||
with `metadata.configFn` and running:
|
||||
|
||||
kustomize config run local-resources/
|
||||
kustomize config run local-resource/
|
||||
|
||||
This exists non-zero if there is an error.
|
||||
This exits non-zero if there is an error.
|
||||
|
||||
## Running the Example
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ function input, and writing the function output.
|
||||
The function is invoked by authoring a [local Resource](local-resource)
|
||||
with `metadata.configFn` and running:
|
||||
|
||||
kustomize config run local-resources/
|
||||
kustomize config run local-resource/
|
||||
|
||||
This generates the `local-resources/config` directory containing the template output.
|
||||
|
||||
@@ -47,7 +47,7 @@ This will create the directory
|
||||
|
||||
local-resource/config
|
||||
|
||||
Add an annotation to the StatefulSet Resource and change the replica count of the
|
||||
Add an annotation to the Deployment Resource and change the replica count of the
|
||||
`kind: Nginx` Resource in `example-use.yaml`. Rerun the template:
|
||||
|
||||
kustomize config run local-resource/
|
||||
|
||||
@@ -22,7 +22,7 @@ heavy lifting of implementing the function interface.
|
||||
The function is invoked by authoring a [local Resource](local-resource)
|
||||
with `metadata.configFn` and running:
|
||||
|
||||
kustomize config run local-resources/
|
||||
kustomize config run local-resource/
|
||||
|
||||
This generates the `local-resources/config` directory containing the template output.
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ Resource configuration, and looks for invalid configuration.
|
||||
The function is invoked by authoring a [local Resource](local-resource)
|
||||
with `metadata.configFn` and running:
|
||||
|
||||
kustomize config run local-resources/
|
||||
kustomize config run local-resource/
|
||||
|
||||
This exists non-zero if there is an error.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user