1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl  apply  set-last-applied  -  Set the last-applied-configuration
7       annotation on a live object to match the contents of a file.
8
9
10

SYNOPSIS

12       kubectl apply set-last-applied [OPTIONS]
13
14
15

DESCRIPTION

17       Set the latest last-applied-configuration annotations by setting it  to
18       match the contents of a file. This results in the last-applied-configu‐
19       ration being updated as though 'kubectl apply -f<file> ' was run, with‐
20       out updating any other parts of the object.
21
22
23

OPTIONS

25       --allow-missing-template-keys=true
26           If  true, ignore any errors in templates when a field or map key is
27       missing in the template. Only applies to  golang  and  jsonpath  output
28       formats.
29
30
31       --create-annotation=false
32           Will  create  'last-applied-configuration'  annotations  if current
33       objects doesn't have one
34
35
36       --dry-run=false
37           If true, only print the object that would be sent, without  sending
38       it.
39
40
41       -f, --filename=[]
42           Filename,   directory,   or   URL   to   files  that  contains  the
43       last-applied-configuration annotations
44
45
46       -o, --output=""
47           Output   format.   One    of:    json|yaml|name|go-template|go-tem‐
48       plate-file|template|templatefile|jsonpath|jsonpath-file.
49
50
51       --template=""
52           Template  string  or  path  to template file to use when -o=go-tem‐
53       plate, -o=go-template-file. The template format is golang  templates  [
54http://golang.org/pkg/text/template/#pkg-overview⟩].
55
56
57

OPTIONS INHERITED FROM PARENT COMMANDS

59       --alsologtostderr=false
60           log to standard error as well as files
61
62
63       --application-metrics-count-limit=100
64           Max number of application metrics to store (per container)
65
66
67       --as=""
68           Username to impersonate for the operation
69
70
71       --as-group=[]
72           Group  to  impersonate for the operation, this flag can be repeated
73       to specify multiple groups.
74
75
76       --azure-container-registry-config=""
77           Path to the file containing Azure container registry  configuration
78       information.
79
80
81       --boot-id-file="/proc/sys/kernel/random/boot_id"
82           Comma-separated  list  of files to check for boot-id. Use the first
83       one that exists.
84
85
86       --cache-dir="/builddir/.kube/http-cache"
87           Default HTTP cache directory
88
89
90       --certificate-authority=""
91           Path to a cert file for the certificate authority
92
93
94       --client-certificate=""
95           Path to a client certificate file for TLS
96
97
98       --client-key=""
99           Path to a client key file for TLS
100
101
102       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
103           CIDRs opened in GCE firewall for LB traffic proxy  health checks
104
105
106       --cluster=""
107           The name of the kubeconfig cluster to use
108
109
110       --container-hints="/etc/cadvisor/container_hints.json"
111           location of the container hints file
112
113
114       --containerd="/run/containerd/containerd.sock"
115           containerd endpoint
116
117
118       --containerd-namespace="k8s.io"
119           containerd namespace
120
121
122       --context=""
123           The name of the kubeconfig context to use
124
125
126       --default-not-ready-toleration-seconds=300
127           Indicates    the    tolerationSeconds   of   the   toleration   for
128       notReady:NoExecute that is added by default to every pod that does  not
129       already have such a toleration.
130
131
132       --default-unreachable-toleration-seconds=300
133           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
134       able:NoExecute that is added by default to  every  pod  that  does  not
135       already have such a toleration.
136
137
138       --docker="unix:///var/run/docker.sock"
139           docker endpoint
140
141
142       --docker-env-metadata-whitelist=""
143           a  comma-separated  list of environment variable keys that needs to
144       be collected for docker containers
145
146
147       --docker-only=false
148           Only report docker containers in addition to root stats
149
150
151       --docker-root="/var/lib/docker"
152           DEPRECATED: docker root is read from docker info (this is  a  fall‐
153       back, default: /var/lib/docker)
154
155
156       --docker-tls=false
157           use TLS to connect to docker
158
159
160       --docker-tls-ca="ca.pem"
161           path to trusted CA
162
163
164       --docker-tls-cert="cert.pem"
165           path to client certificate
166
167
168       --docker-tls-key="key.pem"
169           path to private key
170
171
172       --enable-load-reader=false
173           Whether to enable cpu load reader
174
175
176       --event-storage-age-limit="default=0"
177           Max length of time for which to store events (per type). Value is a
178       comma separated list of key values, where  the  keys  are  event  types
179       (e.g.: creation, oom) or "default" and the value is a duration. Default
180       is applied to all non-specified event types
181
182
183       --event-storage-event-limit="default=0"
184           Max number of events to store (per type). Value is  a  comma  sepa‐
185       rated  list  of  key values, where the keys are event types (e.g.: cre‐
186       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
187       applied to all non-specified event types
188
189
190       --global-housekeeping-interval=1m0s
191           Interval between global housekeepings
192
193
194       --housekeeping-interval=10s
195           Interval between container housekeepings
196
197
198       --insecure-skip-tls-verify=false
199           If true, the server's certificate will not be checked for validity.
200       This will make your HTTPS connections insecure
201
202
203       --kubeconfig=""
204           Path to the kubeconfig file to use for CLI requests.
205
206
207       --log-backtrace-at=:0
208           when logging hits line file:N, emit a stack trace
209
210
211       --log-cadvisor-usage=false
212           Whether to log the usage of the cAdvisor container
213
214
215       --log-dir=""
216           If non-empty, write log files in this directory
217
218
219       --log-file=""
220           If non-empty, use this log file
221
222
223       --log-file-max-size=1800
224           Defines the maximum size a log file can grow to. Unit is megabytes.
225       If the value is 0, the maximum file size is unlimited.
226
227
228       --log-flush-frequency=5s
229           Maximum number of seconds between log flushes
230
231
232       --logtostderr=true
233           log to standard error instead of files
234
235
236       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
237           Comma-separated  list  of  files  to  check for machine-id. Use the
238       first one that exists.
239
240
241       --match-server-version=false
242           Require server version to match client version
243
244
245       -n, --namespace=""
246           If present, the namespace scope for this CLI request
247
248
249       --password=""
250           Password for basic authentication to the API server
251
252
253       --profile="none"
254           Name of profile to capture. One of (none|cpu|heap|goroutine|thread‐
255       create|block|mutex)
256
257
258       --profile-output="profile.pprof"
259           Name of the file to write the profile to
260
261
262       --request-timeout="0"
263           The  length  of  time  to  wait before giving up on a single server
264       request. Non-zero values should contain a corresponding time unit (e.g.
265       1s, 2m, 3h). A value of zero means don't timeout requests.
266
267
268       -s, --server=""
269           The address and port of the Kubernetes API server
270
271
272       --skip-headers=false
273           If true, avoid header prefixes in the log messages
274
275
276       --skip-log-headers=false
277           If true, avoid headers when opening log files
278
279
280       --stderrthreshold=2
281           logs at or above this threshold go to stderr
282
283
284       --storage-driver-buffer-duration=1m0s
285           Writes  in  the  storage driver will be buffered for this duration,
286       and committed to the non memory backends as a single transaction
287
288
289       --storage-driver-db="cadvisor"
290           database name
291
292
293       --storage-driver-host="localhost:8086"
294           database host:port
295
296
297       --storage-driver-password="root"
298           database password
299
300
301       --storage-driver-secure=false
302           use secure connection with database
303
304
305       --storage-driver-table="stats"
306           table name
307
308
309       --storage-driver-user="root"
310           database username
311
312
313       --token=""
314           Bearer token for authentication to the API server
315
316
317       --update-machine-info-interval=5m0s
318           Interval between machine info updates.
319
320
321       --user=""
322           The name of the kubeconfig user to use
323
324
325       --username=""
326           Username for basic authentication to the API server
327
328
329       -v, --v=0
330           number for the log level verbosity
331
332
333       --version=false
334           Print version information and quit
335
336
337       --vmodule=
338           comma-separated list of pattern=N settings for  file-filtered  log‐
339       ging
340
341
342

EXAMPLE

344                # Set the last-applied-configuration of a resource to match the contents of a file.
345                kubectl apply set-last-applied -f deploy.yaml
346
347                # Execute set-last-applied against each configuration file in a directory.
348                kubectl apply set-last-applied -f path/
349
350                # Set the last-applied-configuration of a resource to match the contents of a file, will create the annotation if it does not already exist.
351                kubectl apply set-last-applied -f deploy.yaml --create-annotation=true
352
353
354
355

SEE ALSO

357       kubectl-apply(1),
358
359
360

HISTORY

362       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
363       com) based on the kubernetes source material, but hopefully  they  have
364       been automatically generated since!
365
366
367
368Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum