1OC(1)                              June 2016                             OC(1)
2
3
4

NAME

6       oc patch - Update field(s) of a resource using strategic merge patch
7
8
9

SYNOPSIS

11       oc patch [OPTIONS]
12
13
14

DESCRIPTION

16       Update field(s) of a resource using strategic merge patch
17
18
19       JSON and YAML formats are accepted.
20
21
22

OPTIONS

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|go-tem‐
47       plate-file|templatefile|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
64       directory.
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 [
70http://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

OPTIONS INHERITED FROM PARENT COMMANDS

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
156       already 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
208       applied 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       --httptest.serve=""
220           if non-empty, httptest.NewServer serves on this address and blocks
221
222
223       --insecure-skip-tls-verify=false
224           If true, the server's certificate will not be checked for validity.
225       This will make your HTTPS connections insecure
226
227
228       --kubeconfig=""
229           Path to the kubeconfig file to use for CLI requests.
230
231
232       --log-flush-frequency=0
233           Maximum number of seconds between log flushes
234
235
236       --log_backtrace_at=:0
237           when logging hits line file:N, emit a stack trace
238
239
240       --log_cadvisor_usage=false
241           Whether to log the usage of the cAdvisor container
242
243
244       --log_dir=""
245           If non-empty, write log files in this directory
246
247
248       --logtostderr=true
249           log to standard error instead of files
250
251
252       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
253           Comma-separated list of files to  check  for  machine-id.  Use  the
254       first one that exists.
255
256
257       --match-server-version=false
258           Require server version to match client version
259
260
261       -n, --namespace=""
262           If present, the namespace scope for this CLI request
263
264
265       --request-timeout="0"
266           The  length  of  time  to  wait before giving up on a single server
267       request. Non-zero values should contain a corresponding time unit (e.g.
268       1s, 2m, 3h). A value of zero means don't timeout requests.
269
270
271       -s, --server=""
272           The address and port of the Kubernetes API server
273
274
275       --stderrthreshold=2
276           logs at or above this threshold go to stderr
277
278
279       --storage_driver_buffer_duration=0
280           Writes  in  the  storage driver will be buffered for this duration,
281       and committed to the non memory backends as a single transaction
282
283
284       --storage_driver_db="cadvisor"
285           database name
286
287
288       --storage_driver_host="localhost:8086"
289           database host:port
290
291
292       --storage_driver_password="root"
293           database password
294
295
296       --storage_driver_secure=false
297           use secure connection with database
298
299
300       --storage_driver_table="stats"
301           table name
302
303
304       --storage_driver_user="root"
305           database username
306
307
308       --token=""
309           Bearer token for authentication to the API server
310
311
312       --user=""
313           The name of the kubeconfig user to use
314
315
316       -v, --v=0
317           log level for V logs
318
319
320       --version=false
321           Print version information and quit
322
323
324       --vmodule=
325           comma-separated list of pattern=N settings for  file-filtered  log‐
326       ging
327
328
329

EXAMPLE

331                # Partially update a node using strategic merge patch
332                oc patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
333
334
335
336

SEE ALSO

338       oc(1),
339
340
341

HISTORY

343       June 2016, Ported from the Kubernetes man-doc generator
344
345
346
347Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum