@@ -57,15 +57,15 @@ $ vim deployment.yaml
57
57
58
58
### Automating One-time Edits with Functions
59
59
60
- The ` kpt fn ` set of commands enable you to execute programs called _ kpt functions_ . These
61
- programs are packaged as containers and take in YAML files, modify or validate them, and then
60
+ The ` kpt fn ` set of commands enable you to execute programs called _ kpt functions_ . These
61
+ programs are packaged as containers and take in YAML files, mutate or validate them, and then
62
62
output YAML.
63
63
64
- For instance, you can use a function (` gcr.io/kpt-fn/search-replace:v0.1 ` )to search and replace all
64
+ For instance, you can use a function (` gcr.io/kpt-fn/search-replace:v0.1 ` ) to search and replace all
65
65
the occurrences of the ` app ` key in the ` spec ` section of the YAML document (` spec.**.app ` ) and
66
66
set the value to ` my-nginx ` .
67
67
68
- You can use the ` kpt fn eval ` command to run this mutation on your local files a single time.
68
+ You can use the ` kpt fn eval ` command to run this mutation on your local files a single time:
69
69
70
70
``` shell
71
71
$ kpt fn eval --image gcr.io/kpt-fn/search-replace:v0.1 -- by-path=' spec.**.app' put-value=my-nginx
@@ -123,28 +123,17 @@ cluster.
123
123
` kpt live` commands provide the functionality for deploying packages to a
124
124
Kubernetes cluster.
125
125
126
- Install the Resource Group CRD. The Resource Group CRD
127
- allows you Kpt to group resources so that they can be applied, udpated, pruned, and
128
- deleted together.
129
-
130
- ` ` ` shell
131
- $ kpt live install-resource-group
132
- ` ` `
133
126
134
- Now, initialize the Kpt package. This adds some metadata to the `Kptfile` required to keep track of changes made
135
- to the state of the cluster. For example, if a resource is deleted from the package in the future,
136
- it will be pruned from the cluster.
127
+ First, initialize the kpt package :
137
128
138
129
` ` ` shell
139
130
$ kpt live init
140
131
` ` `
141
132
142
- You can validate the resources and verify that the expected changes will be made
143
- to the cluster :
144
-
145
- ` ` ` shell
146
- $ kpt live apply --dry-run
147
- ` ` `
133
+ This adds metadata to the `Kptfile` required to keep track of changes made
134
+ to the state of the cluster. This
135
+ allows kpt to group resources so that they can be applied, updated, pruned, and
136
+ deleted together.
148
137
149
138
Apply the resources to the cluster :
150
139
0 commit comments