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

NAME

6       oc export - Export resources so they can be used elsewhere
7
8
9

SYNOPSIS

11       oc export [OPTIONS]
12
13
14

DESCRIPTION

16       Export resources so they can be used elsewhere
17
18
19       The  export  command makes it easy to take existing objects and convert
20       them to configuration files for backups or for  creating  elsewhere  in
21       the  cluster.  Fields that cannot be specified on create will be set to
22       empty, and any field which is assigned on creation  (like  a  service's
23       clusterIP,  or a deployment config's latestVersion). The status part of
24       objects is also cleared.
25
26
27       Some fields like clusterIP may be useful when exporting an  application
28       from  one cluster to apply to another - assuming another service on the
29       destination cluster does not already use that IP. The --exact flag will
30       instruct  export to not clear fields that might be useful. You may also
31       use --raw to get the exact values for an object - useful for converting
32       a file on disk between API versions.
33
34
35       Another  use case for export is to create reusable templates for appli‐
36       cations. Pass --as-template to generate the API structure  for  a  tem‐
37       plate to which you can add parameters and object labels.
38
39
40

OPTIONS

42       --all-namespaces=false
43           If true, list the requested object(s) across all namespaces. Names‐
44       pace in current context is ignored even if specified with --namespace.
45
46
47       --allow-missing-template-keys=true
48           If true, ignore any errors in templates when a field or map key  is
49       missing  in  the  template.  Only applies to golang and jsonpath output
50       formats.
51
52
53       --as-template=""
54           Output a Template object with specified name instead of a  List  or
55       single object.
56
57
58       --exact=false
59           If true, preserve fields that may be cluster specific, such as ser‐
60       vice clusterIPs or generated names
61
62
63       -f, --filename=[]
64           Filename, directory, or URL to files Filename, directory, or URL to
65       file for the resource to export.
66
67
68       -o, --output="yaml"
69           Output format. One of: json|yaml|name|templatefile|template|go-tem‐
70       plate|go-template-file|jsonpath|jsonpath-file.
71
72
73       --raw=false
74           If true, do not alter the resources  in  any  way  after  they  are
75       loaded.
76
77
78       -R, --recursive=false
79           Process  the  directory  used in -f, --filename recursively. Useful
80       when you want to manage related manifests  organized  within  the  same
81       directory.
82
83
84       -l, --selector=""
85           Selector (label query) to filter on
86
87
88       --template=""
89           Template  string  or  path  to template file to use when -o=go-tem‐
90       plate, -o=go-template-file. The template format is golang  templates  [
91http://golang.org/pkg/text/template/#pkg-overview⟩].
92
93
94

OPTIONS INHERITED FROM PARENT COMMANDS

96       --allow_verification_with_non_compliant_keys=false
97           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
98       non-compliant with RFC6962.
99
100
101       --alsologtostderr=false
102           log to standard error as well as files
103
104
105       --application_metrics_count_limit=100
106           Max number of application metrics to store (per container)
107
108
109       --as=""
110           Username to impersonate for the operation
111
112
113       --as-group=[]
114           Group to impersonate for the operation, this flag can  be  repeated
115       to specify multiple groups.
116
117
118       --azure-container-registry-config=""
119           Path  to the file containing Azure container registry configuration
120       information.
121
122
123       --boot_id_file="/proc/sys/kernel/random/boot_id"
124           Comma-separated list of files to check for boot-id. Use  the  first
125       one that exists.
126
127
128       --cache-dir="/builddir/.kube/http-cache"
129           Default HTTP cache directory
130
131
132       --certificate-authority=""
133           Path to a cert file for the certificate authority
134
135
136       --client-certificate=""
137           Path to a client certificate file for TLS
138
139
140       --client-key=""
141           Path to a client key file for TLS
142
143
144       --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
145           CIDRs opened in GCE firewall for LB traffic proxy  health checks
146
147
148       --cluster=""
149           The name of the kubeconfig cluster to use
150
151
152       --container_hints="/etc/cadvisor/container_hints.json"
153           location of the container hints file
154
155
156       --containerd="unix:///var/run/containerd.sock"
157           containerd endpoint
158
159
160       --context=""
161           The name of the kubeconfig context to use
162
163
164       --default-not-ready-toleration-seconds=300
165           Indicates   the   tolerationSeconds   of   the    toleration    for
166       notReady:NoExecute  that is added by default to every pod that does not
167       already have such a toleration.
168
169
170       --default-unreachable-toleration-seconds=300
171           Indicates the tolerationSeconds  of  the  toleration  for  unreach‐
172       able:NoExecute  that  is  added  by  default to every pod that does not
173       already have such a toleration.
174
175
176       --docker="unix:///var/run/docker.sock"
177           docker endpoint
178
179
180       --docker-tls=false
181           use TLS to connect to docker
182
183
184       --docker-tls-ca="ca.pem"
185           path to trusted CA
186
187
188       --docker-tls-cert="cert.pem"
189           path to client certificate
190
191
192       --docker-tls-key="key.pem"
193           path to private key
194
195
196       --docker_env_metadata_whitelist=""
197           a comma-separated list of environment variable keys that  needs  to
198       be collected for docker containers
199
200
201       --docker_only=false
202           Only report docker containers in addition to root stats
203
204
205       --docker_root="/var/lib/docker"
206           DEPRECATED:  docker  root is read from docker info (this is a fall‐
207       back, default: /var/lib/docker)
208
209
210       --enable_load_reader=false
211           Whether to enable cpu load reader
212
213
214       --event_storage_age_limit="default=24h"
215           Max length of time for which to store events (per type). Value is a
216       comma  separated  list  of  key  values, where the keys are event types
217       (e.g.: creation, oom) or "default" and the value is a duration. Default
218       is applied to all non-specified event types
219
220
221       --event_storage_event_limit="default=100000"
222           Max  number  of  events to store (per type). Value is a comma sepa‐
223       rated list of key values, where the keys are event  types  (e.g.:  cre‐
224       ation,  oom)  or  "default"  and  the  value  is an integer. Default is
225       applied to all non-specified event types
226
227
228       --global_housekeeping_interval=0
229           Interval between global housekeepings
230
231
232       --housekeeping_interval=0
233           Interval between container housekeepings
234
235
236       --httptest.serve=""
237           if non-empty, httptest.NewServer serves on this address and blocks
238
239
240       --insecure-skip-tls-verify=false
241           If true, the server's certificate will not be checked for validity.
242       This will make your HTTPS connections insecure
243
244
245       --kubeconfig=""
246           Path to the kubeconfig file to use for CLI requests.
247
248
249       --log-flush-frequency=0
250           Maximum number of seconds between log flushes
251
252
253       --log_backtrace_at=:0
254           when logging hits line file:N, emit a stack trace
255
256
257       --log_cadvisor_usage=false
258           Whether to log the usage of the cAdvisor container
259
260
261       --log_dir=""
262           If non-empty, write log files in this directory
263
264
265       --logtostderr=true
266           log to standard error instead of files
267
268
269       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
270           Comma-separated  list  of  files  to  check for machine-id. Use the
271       first one that exists.
272
273
274       --match-server-version=false
275           Require server version to match client version
276
277
278       -n, --namespace=""
279           If present, the namespace scope for this CLI request
280
281
282       --request-timeout="0"
283           The length of time to wait before giving  up  on  a  single  server
284       request. Non-zero values should contain a corresponding time unit (e.g.
285       1s, 2m, 3h). A value of zero means don't timeout requests.
286
287
288       -s, --server=""
289           The address and port of the Kubernetes API server
290
291
292       --stderrthreshold=2
293           logs at or above this threshold go to stderr
294
295
296       --storage_driver_buffer_duration=0
297           Writes in the storage driver will be buffered  for  this  duration,
298       and committed to the non memory backends as a single transaction
299
300
301       --storage_driver_db="cadvisor"
302           database name
303
304
305       --storage_driver_host="localhost:8086"
306           database host:port
307
308
309       --storage_driver_password="root"
310           database password
311
312
313       --storage_driver_secure=false
314           use secure connection with database
315
316
317       --storage_driver_table="stats"
318           table name
319
320
321       --storage_driver_user="root"
322           database username
323
324
325       --token=""
326           Bearer token for authentication to the API server
327
328
329       --user=""
330           The name of the kubeconfig user to use
331
332
333       -v, --v=0
334           log level for V logs
335
336
337       --version=false
338           Print version information and quit
339
340
341       --vmodule=
342           comma-separated  list  of pattern=N settings for file-filtered log‐
343       ging
344
345
346

EXAMPLE

348                # export the services and deployment configurations labeled name=test
349                oc export svc,dc -l name=test
350
351                # export all services to a template
352                oc export service --as-template=test
353
354                # export to JSON
355                oc export service -o json
356
357
358
359

SEE ALSO

361       oc(1),
362
363
364

HISTORY

366       June 2016, Ported from the Kubernetes man-doc generator
367
368
369
370Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum