1OC(1) June 2016 OC(1)
2
3
4
6 oc patch - Update field(s) of a resource using strategic merge patch
7
8
9
11 oc patch [OPTIONS]
12
13
14
16 Update field(s) of a resource using strategic merge patch
17
18
19 JSON and YAML formats are accepted.
20
21
22
24 --allow-missing-template-keys=true
25 If true, ignore any errors in templates when a field or map key is
26 missing in the template. Only applies to golang and jsonpath output
27 formats.
28
29
30 --dry-run=false
31 If true, only print the object that would be sent, without sending
32 it.
33
34
35 -f, --filename=[]
36 Filename, directory, or URL to files identifying the resource to
37 update
38
39
40 --local=false
41 If true, patch will operate on the content of the file, not the
42 server-side resource.
43
44
45 -o, --output=""
46 Output format. One of: json|yaml|name|go-template-file|template‐
47 file|template|go-template|jsonpath|jsonpath-file.
48
49
50 -p, --patch=""
51 The patch to be applied to the resource JSON file.
52
53
54 --record=false
55 Record current kubectl command in the resource annotation. If set
56 to false, do not record the command. If set to true, record the com‐
57 mand. If not set, default to updating the existing annotation value
58 only if one already exists.
59
60
61 -R, --recursive=false
62 Process the directory used in -f, --filename recursively. Useful
63 when you want to manage related manifests organized within the same di‐
64 rectory.
65
66
67 --template=""
68 Template string or path to template file to use when -o=go-tem‐
69 plate, -o=go-template-file. The template format is golang templates [
70 ⟨http://golang.org/pkg/text/template/#pkg-overview⟩].
71
72
73 --type="strategic"
74 The type of patch being provided; one of [json merge strategic]
75
76
77
79 --allow_verification_with_non_compliant_keys=false
80 Allow a SignatureVerifier to use keys which are technically
81 non-compliant with RFC6962.
82
83
84 --alsologtostderr=false
85 log to standard error as well as files
86
87
88 --application_metrics_count_limit=100
89 Max number of application metrics to store (per container)
90
91
92 --as=""
93 Username to impersonate for the operation
94
95
96 --as-group=[]
97 Group to impersonate for the operation, this flag can be repeated
98 to specify multiple groups.
99
100
101 --azure-container-registry-config=""
102 Path to the file containing Azure container registry configuration
103 information.
104
105
106 --boot_id_file="/proc/sys/kernel/random/boot_id"
107 Comma-separated list of files to check for boot-id. Use the first
108 one that exists.
109
110
111 --cache-dir="/builddir/.kube/http-cache"
112 Default HTTP cache directory
113
114
115 --certificate-authority=""
116 Path to a cert file for the certificate authority
117
118
119 --client-certificate=""
120 Path to a client certificate file for TLS
121
122
123 --client-key=""
124 Path to a client key file for TLS
125
126
127 --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
128 CIDRs opened in GCE firewall for LB traffic proxy health checks
129
130
131 --cluster=""
132 The name of the kubeconfig cluster to use
133
134
135 --container_hints="/etc/cadvisor/container_hints.json"
136 location of the container hints file
137
138
139 --containerd="unix:///var/run/containerd.sock"
140 containerd endpoint
141
142
143 --context=""
144 The name of the kubeconfig context to use
145
146
147 --default-not-ready-toleration-seconds=300
148 Indicates the tolerationSeconds of the toleration for
149 notReady:NoExecute that is added by default to every pod that does not
150 already have such a toleration.
151
152
153 --default-unreachable-toleration-seconds=300
154 Indicates the tolerationSeconds of the toleration for unreach‐
155 able:NoExecute that is added by default to every pod that does not al‐
156 ready have such a toleration.
157
158
159 --docker="unix:///var/run/docker.sock"
160 docker endpoint
161
162
163 --docker-tls=false
164 use TLS to connect to docker
165
166
167 --docker-tls-ca="ca.pem"
168 path to trusted CA
169
170
171 --docker-tls-cert="cert.pem"
172 path to client certificate
173
174
175 --docker-tls-key="key.pem"
176 path to private key
177
178
179 --docker_env_metadata_whitelist=""
180 a comma-separated list of environment variable keys that needs to
181 be collected for docker containers
182
183
184 --docker_only=false
185 Only report docker containers in addition to root stats
186
187
188 --docker_root="/var/lib/docker"
189 DEPRECATED: docker root is read from docker info (this is a fall‐
190 back, default: /var/lib/docker)
191
192
193 --enable_load_reader=false
194 Whether to enable cpu load reader
195
196
197 --event_storage_age_limit="default=24h"
198 Max length of time for which to store events (per type). Value is a
199 comma separated list of key values, where the keys are event types
200 (e.g.: creation, oom) or "default" and the value is a duration. Default
201 is applied to all non-specified event types
202
203
204 --event_storage_event_limit="default=100000"
205 Max number of events to store (per type). Value is a comma sepa‐
206 rated list of key values, where the keys are event types (e.g.: cre‐
207 ation, oom) or "default" and the value is an integer. Default is ap‐
208 plied to all non-specified event types
209
210
211 --global_housekeeping_interval=0
212 Interval between global housekeepings
213
214
215 --housekeeping_interval=0
216 Interval between container housekeepings
217
218
219 --insecure-skip-tls-verify=false
220 If true, the server's certificate will not be checked for validity.
221 This will make your HTTPS connections insecure
222
223
224 --kubeconfig=""
225 Path to the kubeconfig file to use for CLI requests.
226
227
228 --log-flush-frequency=0
229 Maximum number of seconds between log flushes
230
231
232 --log_backtrace_at=:0
233 when logging hits line file:N, emit a stack trace
234
235
236 --log_cadvisor_usage=false
237 Whether to log the usage of the cAdvisor container
238
239
240 --log_dir=""
241 If non-empty, write log files in this directory
242
243
244 --logtostderr=true
245 log to standard error instead of files
246
247
248 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
249 Comma-separated list of files to check for machine-id. Use the
250 first one that exists.
251
252
253 --match-server-version=false
254 Require server version to match client version
255
256
257 -n, --namespace=""
258 If present, the namespace scope for this CLI request
259
260
261 --request-timeout="0"
262 The length of time to wait before giving up on a single server re‐
263 quest. Non-zero values should contain a corresponding time unit (e.g.
264 1s, 2m, 3h). A value of zero means don't timeout requests.
265
266
267 -s, --server=""
268 The address and port of the Kubernetes API server
269
270
271 --stderrthreshold=2
272 logs at or above this threshold go to stderr
273
274
275 --storage_driver_buffer_duration=0
276 Writes in the storage driver will be buffered for this duration,
277 and committed to the non memory backends as a single transaction
278
279
280 --storage_driver_db="cadvisor"
281 database name
282
283
284 --storage_driver_host="localhost:8086"
285 database host:port
286
287
288 --storage_driver_password="root"
289 database password
290
291
292 --storage_driver_secure=false
293 use secure connection with database
294
295
296 --storage_driver_table="stats"
297 table name
298
299
300 --storage_driver_user="root"
301 database username
302
303
304 --token=""
305 Bearer token for authentication to the API server
306
307
308 --user=""
309 The name of the kubeconfig user to use
310
311
312 -v, --v=0
313 log level for V logs
314
315
316 --version=false
317 Print version information and quit
318
319
320 --vmodule=
321 comma-separated list of pattern=N settings for file-filtered log‐
322 ging
323
324
325
327 # Partially update a node using strategic merge patch
328 oc patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
329
330
331
332
334 oc(1),
335
336
337
339 June 2016, Ported from the Kubernetes man-doc generator
340
341
342
343Openshift Openshift CLI User Manuals OC(1)