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. Name‐
44       space 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|template|go-template|go-tem‐
70       plate-file|templatefile|jsonpath-file|jsonpath.
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 di‐
81       rectory.
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 al‐
173       ready 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 ap‐
225       plied 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       --insecure-skip-tls-verify=false
237           If true, the server's certificate will not be checked for validity.
238       This will make your HTTPS connections insecure
239
240
241       --kubeconfig=""
242           Path to the kubeconfig file to use for CLI requests.
243
244
245       --log-flush-frequency=0
246           Maximum number of seconds between log flushes
247
248
249       --log_backtrace_at=:0
250           when logging hits line file:N, emit a stack trace
251
252
253       --log_cadvisor_usage=false
254           Whether to log the usage of the cAdvisor container
255
256
257       --log_dir=""
258           If non-empty, write log files in this directory
259
260
261       --logtostderr=true
262           log to standard error instead of files
263
264
265       --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
266           Comma-separated  list  of  files  to  check for machine-id. Use the
267       first one that exists.
268
269
270       --match-server-version=false
271           Require server version to match client version
272
273
274       -n, --namespace=""
275           If present, the namespace scope for this CLI request
276
277
278       --request-timeout="0"
279           The length of time to wait before giving up on a single server  re‐
280       quest.  Non-zero  values should contain a corresponding time unit (e.g.
281       1s, 2m, 3h). A value of zero means don't timeout requests.
282
283
284       -s, --server=""
285           The address and port of the Kubernetes API server
286
287
288       --stderrthreshold=2
289           logs at or above this threshold go to stderr
290
291
292       --storage_driver_buffer_duration=0
293           Writes in the storage driver will be buffered  for  this  duration,
294       and committed to the non memory backends as a single transaction
295
296
297       --storage_driver_db="cadvisor"
298           database name
299
300
301       --storage_driver_host="localhost:8086"
302           database host:port
303
304
305       --storage_driver_password="root"
306           database password
307
308
309       --storage_driver_secure=false
310           use secure connection with database
311
312
313       --storage_driver_table="stats"
314           table name
315
316
317       --storage_driver_user="root"
318           database username
319
320
321       --token=""
322           Bearer token for authentication to the API server
323
324
325       --user=""
326           The name of the kubeconfig user to use
327
328
329       -v, --v=0
330           log level for V logs
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                # export the services and deployment configurations labeled name=test
345                oc export svc,dc -l name=test
346
347                # export all services to a template
348                oc export service --as-template=test
349
350                # export to JSON
351                oc export service -o json
352
353
354
355

SEE ALSO

357       oc(1),
358
359
360

HISTORY

362       June 2016, Ported from the Kubernetes man-doc generator
363
364
365
366Openshift                  Openshift CLI User Manuals                    OC(1)
Impressum