1KUBERNETES(1)(kubernetes) KUBERNETES(1)(kubernetes)
2
3
4
5Eric Paris Jan 2015
6
7
9 kubectl apply set-last-applied - Set the last-applied-configuration an‐
10 notation on a live object to match the contents of a file
11
12
13
15 kubectl apply set-last-applied [OPTIONS]
16
17
18
20 Set the latest last-applied-configuration annotations by setting it to
21 match the contents of a file. This results in the last-applied-configu‐
22 ration being updated as though 'kubectl apply -f ' was run, without up‐
23 dating any other parts of the object.
24
25
26
28 --allow-missing-template-keys=true If true, ignore any errors in
29 templates when a field or map key is missing in the template. Only ap‐
30 plies to golang and jsonpath output formats.
31
32
33 --create-annotation=false Will create 'last-applied-configuration'
34 annotations if current objects doesn't have one
35
36
37 --dry-run="none" Must be "none", "server", or "client". If client
38 strategy, only print the object that would be sent, without sending it.
39 If server strategy, submit server-side request without persisting the
40 resource.
41
42
43 -f, --filename=[] Filename, directory, or URL to files that con‐
44 tains the last-applied-configuration annotations
45
46
47 -o, --output="" Output format. One of: (json, yaml, name, go-tem‐
48 plate, go-template-file, template, templatefile, jsonpath, jsonpath-as-
49 json, jsonpath-file).
50
51
52 --show-managed-fields=false If true, keep the managedFields when
53 printing objects in JSON or YAML format.
54
55
56 --template="" Template string or path to template file to use when
57 -o=go-template, -o=go-template-file. The template format is golang tem‐
58 plates [http://golang.org/pkg/text/template/#pkg-overview].
59
60
61
63 --as="" Username to impersonate for the operation. User could be a
64 regular user or a service account in a namespace.
65
66
67 --as-group=[] Group to impersonate for the operation, this flag
68 can be repeated to specify multiple groups.
69
70
71 --as-uid="" UID to impersonate for the operation.
72
73
74 --azure-container-registry-config="" Path to the file containing
75 Azure container registry configuration information.
76
77
78 --cache-dir="/builddir/.kube/cache" Default cache directory
79
80
81 --certificate-authority="" Path to a cert file for the certificate
82 authority
83
84
85 --client-certificate="" Path to a client certificate file for TLS
86
87
88 --client-key="" Path to a client key file for TLS
89
90
91 --cluster="" The name of the kubeconfig cluster to use
92
93
94 --context="" The name of the kubeconfig context to use
95
96
97 --insecure-skip-tls-verify=false If true, the server's certificate
98 will not be checked for validity. This will make your HTTPS connections
99 insecure
100
101
102 --kubeconfig="" Path to the kubeconfig file to use for CLI re‐
103 quests.
104
105
106 --match-server-version=false Require server version to match
107 client version
108
109
110 -n, --namespace="" If present, the namespace scope for this CLI
111 request
112
113
114 --password="" Password for basic authentication to the API server
115
116
117 --profile="none" Name of profile to capture. One of
118 (none|cpu|heap|goroutine|threadcreate|block|mutex)
119
120
121 --profile-output="profile.pprof" Name of the file to write the
122 profile to
123
124
125 --request-timeout="0" The length of time to wait before giving up
126 on a single server request. Non-zero values should contain a corre‐
127 sponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't time‐
128 out requests.
129
130
131 -s, --server="" The address and port of the Kubernetes API server
132
133
134 --tls-server-name="" Server name to use for server certificate
135 validation. If it is not provided, the hostname used to contact the
136 server is used
137
138
139 --token="" Bearer token for authentication to the API server
140
141
142 --user="" The name of the kubeconfig user to use
143
144
145 --username="" Username for basic authentication to the API server
146
147
148 --version=false Print version information and quit
149
150
151 --warnings-as-errors=false Treat warnings received from the server
152 as errors and exit with a non-zero exit code
153
154
155
157 # Set the last-applied-configuration of a resource to match the contents of a file
158 kubectl apply set-last-applied -f deploy.yaml
159
160 # Execute set-last-applied against each configuration file in a directory
161 kubectl apply set-last-applied -f path/
162
163 # 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
164 kubectl apply set-last-applied -f deploy.yaml --create-annotation=true
165
166
167
168
170 kubectl-apply(1),
171
172
173
175 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
176 com) based on the kubernetes source material, but hopefully they have
177 been automatically generated since!
178
179
180
181Manuals User KUBERNETES(1)(kubernetes)