1OC(1) June 2016 OC(1)
2
3
4
6 oc new-app - Create a new application
7
8
9
11 oc new-app [OPTIONS]
12
13
14
16 Create a new application by specifying source code, templates, and/or
17 images
18
19
20 This command will try to build up the components of an application us‐
21 ing images, templates, or code that has a public repository. It will
22 lookup the images on the local Docker installation (if available), a
23 Docker registry, an integrated image stream, or stored templates.
24
25
26 If you specify a source code URL, it will set up a build that takes
27 your source code and converts it into an image that can run inside of a
28 pod. Local source must be in a git repository that has a remote reposi‐
29 tory that the server can see. The images will be deployed via a deploy‐
30 ment configuration, and a service will be connected to the first public
31 port of the app. You may either specify components using the various
32 existing flags or let new-app autodetect what kind of components you
33 have provided.
34
35
36 If you provide source code, a new build will be automatically trig‐
37 gered. You can use 'oc status' to check the progress.
38
39
40
42 --allow-missing-images=false
43 If true, indicates that referenced Docker images that cannot be
44 found locally or in a registry should still be used.
45
46
47 --allow-missing-imagestream-tags=false
48 If true, indicates that image stream tags that don't exist should
49 still be used.
50
51
52 --allow-missing-template-keys=false
53 If true, ignore any errors in templates when a field or map key is
54 missing in the template. Only applies to golang and jsonpath output
55 formats.
56
57
58 --as-test=false
59 If true create this application as a test deployment, which vali‐
60 dates that the deployment succeeds and then scales down.
61
62
63 --build-env=[]
64 Specify a key-value pair for an environment variable to set into
65 each build image.
66
67
68 --build-env-file=[]
69 File containing key-value pairs of environment variables to set
70 into each build image.
71
72
73 --code=[]
74 Source code to use to build this application.
75
76
77 --context-dir=""
78 Context directory to be used for the build.
79
80
81 --docker-image=[]
82 Name of a Docker image to include in the app.
83
84
85 --dry-run=false
86 If true, show the result of the operation without performing it.
87
88
89 -e, --env=[]
90 Specify a key-value pair for an environment variable to set into
91 each container.
92
93
94 --env-file=[]
95 File containing key-value pairs of environment variables to set
96 into each container.
97
98
99 -f, --file=[]
100 Path to a template file to use for the app.
101
102
103 --grant-install-rights=false
104 If true, a component that requires access to your account may use
105 your token to install software into your project. Only grant images you
106 trust the right to run with your token.
107
108
109 --group=[]
110 Indicate components that should be grouped together as
111 <comp1>+<comp2>.
112
113
114 --ignore-unknown-parameters=false
115 If true, will not stop processing if a provided parameter does not
116 exist in the template.
117
118
119 -i, --image-stream=[]
120 Name of an image stream to use in the app.
121
122
123 --insecure-registry=false
124 If true, indicates that the referenced Docker images are on inse‐
125 cure registries and should bypass certificate checking
126
127
128 -l, --labels=""
129 Label to set in all resources for this application.
130
131
132 -L, --list=false
133 List all local templates and image streams that can be used to cre‐
134 ate.
135
136
137 --name=""
138 Set name to use for generated application artifacts
139
140
141 --no-install=false
142 Do not attempt to run images that describe themselves as being in‐
143 stallable
144
145
146 -o, --output=""
147 Output format. One of: json|yaml|name|template|go-template|go-tem‐
148 plate-file|templatefile|jsonpath-file|jsonpath.
149
150
151 --output-version=""
152 The preferred API versions of the output objects
153
154
155 -p, --param=[]
156 Specify a key-value pair (e.g., -p FOO=BAR) to set/override a pa‐
157 rameter value in the template.
158
159
160 --param-file=[]
161 File containing parameter values to set/override in the template.
162
163
164 -S, --search=false
165 Search all templates, image streams, and Docker images that match
166 the arguments provided.
167
168
169 -a, --show-all=true
170 When printing, show all resources (false means hide terminated
171 pods.)
172
173
174 --show-labels=false
175 When printing, show all labels as the last column (default hide la‐
176 bels column)
177
178
179 --sort-by=""
180 If non-empty, sort list types using this field specification. The
181 field specification is expressed as a JSONPath expression (e.g.
182 '{.metadata.name}'). The field in the API resource specified by this
183 JSONPath expression must be an integer or a string.
184
185
186 --source-secret=""
187 The name of an existing secret that should be used for cloning a
188 private git repository.
189
190
191 --strategy=
192 Specify the build strategy to use if you don't want to detect
193 (docker|pipeline|source).
194
195
196 --template=[]
197 Name of a stored template to use in the app.
198
199
200
202 --allow_verification_with_non_compliant_keys=false
203 Allow a SignatureVerifier to use keys which are technically
204 non-compliant with RFC6962.
205
206
207 --alsologtostderr=false
208 log to standard error as well as files
209
210
211 --application_metrics_count_limit=100
212 Max number of application metrics to store (per container)
213
214
215 --as=""
216 Username to impersonate for the operation
217
218
219 --as-group=[]
220 Group to impersonate for the operation, this flag can be repeated
221 to specify multiple groups.
222
223
224 --azure-container-registry-config=""
225 Path to the file containing Azure container registry configuration
226 information.
227
228
229 --boot_id_file="/proc/sys/kernel/random/boot_id"
230 Comma-separated list of files to check for boot-id. Use the first
231 one that exists.
232
233
234 --cache-dir="/builddir/.kube/http-cache"
235 Default HTTP cache directory
236
237
238 --certificate-authority=""
239 Path to a cert file for the certificate authority
240
241
242 --client-certificate=""
243 Path to a client certificate file for TLS
244
245
246 --client-key=""
247 Path to a client key file for TLS
248
249
250 --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
251 CIDRs opened in GCE firewall for LB traffic proxy health checks
252
253
254 --cluster=""
255 The name of the kubeconfig cluster to use
256
257
258 --container_hints="/etc/cadvisor/container_hints.json"
259 location of the container hints file
260
261
262 --containerd="unix:///var/run/containerd.sock"
263 containerd endpoint
264
265
266 --context=""
267 The name of the kubeconfig context to use
268
269
270 --default-not-ready-toleration-seconds=300
271 Indicates the tolerationSeconds of the toleration for
272 notReady:NoExecute that is added by default to every pod that does not
273 already have such a toleration.
274
275
276 --default-unreachable-toleration-seconds=300
277 Indicates the tolerationSeconds of the toleration for unreach‐
278 able:NoExecute that is added by default to every pod that does not al‐
279 ready have such a toleration.
280
281
282 --docker="unix:///var/run/docker.sock"
283 docker endpoint
284
285
286 --docker-tls=false
287 use TLS to connect to docker
288
289
290 --docker-tls-ca="ca.pem"
291 path to trusted CA
292
293
294 --docker-tls-cert="cert.pem"
295 path to client certificate
296
297
298 --docker-tls-key="key.pem"
299 path to private key
300
301
302 --docker_env_metadata_whitelist=""
303 a comma-separated list of environment variable keys that needs to
304 be collected for docker containers
305
306
307 --docker_only=false
308 Only report docker containers in addition to root stats
309
310
311 --docker_root="/var/lib/docker"
312 DEPRECATED: docker root is read from docker info (this is a fall‐
313 back, default: /var/lib/docker)
314
315
316 --enable_load_reader=false
317 Whether to enable cpu load reader
318
319
320 --event_storage_age_limit="default=24h"
321 Max length of time for which to store events (per type). Value is a
322 comma separated list of key values, where the keys are event types
323 (e.g.: creation, oom) or "default" and the value is a duration. Default
324 is applied to all non-specified event types
325
326
327 --event_storage_event_limit="default=100000"
328 Max number of events to store (per type). Value is a comma sepa‐
329 rated list of key values, where the keys are event types (e.g.: cre‐
330 ation, oom) or "default" and the value is an integer. Default is ap‐
331 plied to all non-specified event types
332
333
334 --global_housekeeping_interval=0
335 Interval between global housekeepings
336
337
338 --housekeeping_interval=0
339 Interval between container housekeepings
340
341
342 --insecure-skip-tls-verify=false
343 If true, the server's certificate will not be checked for validity.
344 This will make your HTTPS connections insecure
345
346
347 --kubeconfig=""
348 Path to the kubeconfig file to use for CLI requests.
349
350
351 --log-flush-frequency=0
352 Maximum number of seconds between log flushes
353
354
355 --log_backtrace_at=:0
356 when logging hits line file:N, emit a stack trace
357
358
359 --log_cadvisor_usage=false
360 Whether to log the usage of the cAdvisor container
361
362
363 --log_dir=""
364 If non-empty, write log files in this directory
365
366
367 --logtostderr=true
368 log to standard error instead of files
369
370
371 --machine_id_file="/etc/machine-id,/var/lib/dbus/machine-id"
372 Comma-separated list of files to check for machine-id. Use the
373 first one that exists.
374
375
376 --match-server-version=false
377 Require server version to match client version
378
379
380 -n, --namespace=""
381 If present, the namespace scope for this CLI request
382
383
384 --request-timeout="0"
385 The length of time to wait before giving up on a single server re‐
386 quest. Non-zero values should contain a corresponding time unit (e.g.
387 1s, 2m, 3h). A value of zero means don't timeout requests.
388
389
390 -s, --server=""
391 The address and port of the Kubernetes API server
392
393
394 --stderrthreshold=2
395 logs at or above this threshold go to stderr
396
397
398 --storage_driver_buffer_duration=0
399 Writes in the storage driver will be buffered for this duration,
400 and committed to the non memory backends as a single transaction
401
402
403 --storage_driver_db="cadvisor"
404 database name
405
406
407 --storage_driver_host="localhost:8086"
408 database host:port
409
410
411 --storage_driver_password="root"
412 database password
413
414
415 --storage_driver_secure=false
416 use secure connection with database
417
418
419 --storage_driver_table="stats"
420 table name
421
422
423 --storage_driver_user="root"
424 database username
425
426
427 --token=""
428 Bearer token for authentication to the API server
429
430
431 --user=""
432 The name of the kubeconfig user to use
433
434
435 -v, --v=0
436 log level for V logs
437
438
439 --version=false
440 Print version information and quit
441
442
443 --vmodule=
444 comma-separated list of pattern=N settings for file-filtered log‐
445 ging
446
447
448
450 # List all local templates and image streams that can be used to create an app
451 oc new-app --list
452
453 # Create an application based on the source code in the current git repository (with a public remote)
454 # and a Docker image
455 oc new-app . --docker-image=repo/langimage
456
457 # Create a Ruby application based on the provided [image] [source code] combination
458 oc new-app centos/ruby-25-centos7 https://github.com/sclorg/ruby-ex.git
459
460 # Use the public Docker Hub MySQL image to create an app. Generated artifacts will be labeled with db=mysql
461 oc new-app mysql MYSQL_USER=user MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb -l db=mysql
462
463 # Use a MySQL image in a private registry to create an app and override application artifacts' names
464 oc new-app --docker-image=myregistry.com/mycompany/mysql --name=private
465
466 # Create an application from a remote repository using its beta4 branch
467 oc new-app https://github.com/openshift/ruby-hello-world#beta4
468
469 # Create an application based on a stored template, explicitly setting a parameter value
470 oc new-app --template=ruby-helloworld-sample --param=MYSQL_USER=admin
471
472 # Create an application from a remote repository and specify a context directory
473 oc new-app https://github.com/youruser/yourgitrepo --context-dir=src/build
474
475 # Create an application from a remote private repository and specify which existing secret to use
476 oc new-app https://github.com/youruser/yourgitrepo --source-secret=yoursecret
477
478 # Create an application based on a template file, explicitly setting a parameter value
479 oc new-app --file=./example/myapp/template.json --param=MYSQL_USER=admin
480
481 # Search all templates, image streams, and Docker images for the ones that match "ruby"
482 oc new-app --search ruby
483
484 # Search for "ruby", but only in stored templates (--template, --image-stream and --docker-image
485 # can be used to filter search results)
486 oc new-app --search --template=ruby
487
488 # Search for "ruby" in stored templates and print the output as an YAML
489 oc new-app --search --template=ruby --output=yaml
490
491
492
493
495 oc(1),
496
497
498
500 June 2016, Ported from the Kubernetes man-doc generator
501
502
503
504Openshift Openshift CLI User Manuals OC(1)