Skip to content

Commit e6c7c92

Browse files
author
OpenShift Bot
authored
Merge pull request #14769 from soltysh/update_run_help
Merged by openshift-bot
2 parents 47808f7 + 0787e5b commit e6c7c92

File tree

1 file changed

+29
-16
lines changed

1 file changed

+29
-16
lines changed

pkg/cmd/cli/cmd/wrappers.go

+29-16
Original file line numberDiff line numberDiff line change
@@ -406,28 +406,41 @@ var (
406406
--generator to create a replication controller instead of a deployment config.`)
407407

408408
runExample = templates.Examples(`
409-
# Starts a single instance of nginx.
410-
%[1]s run nginx --image=nginx
409+
# Start a single instance of nginx.
410+
%[1]s run nginx --image=nginx
411411
412-
# Starts a replicated instance of nginx.
413-
%[1]s run nginx --image=nginx --replicas=5
412+
# Start a single instance of hazelcast and let the container expose port 5701 .
413+
%[1]s run hazelcast --image=hazelcast --port=5701
414414
415-
# Dry run. Print the corresponding API objects without creating them.
416-
%[1]s run nginx --image=nginx --dry-run
415+
# Start a single instance of hazelcast and set environment variables "DNS_DOMAIN=cluster"
416+
# and "POD_NAMESPACE=default" in the container.
417+
%[1]s run hazelcast --image=hazelcast --env="DNS_DOMAIN=cluster" --env="POD_NAMESPACE=default"
417418
418-
# Start a single instance of nginx, but overload the spec of the replication
419-
# controller with a partial set of values parsed from JSON.
420-
%[1]s run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
419+
# Start a replicated instance of nginx.
420+
%[1]s run nginx --image=nginx --replicas=5
421421
422-
# Start a single instance of nginx and keep it in the foreground, don't restart it if it exits.
423-
%[1]s run -i --tty nginx --image=nginx --restart=Never
422+
# Dry run. Print the corresponding API objects without creating them.
423+
%[1]s run nginx --image=nginx --dry-run
424424
425-
# Start the nginx container using the default command, but use custom
426-
# arguments (arg1 .. argN) for that command.
427-
%[1]s run nginx --image=nginx -- <arg1> <arg2> ... <argN>
425+
# Start a single instance of nginx, but overload the spec of the deployment config with
426+
# a partial set of values parsed from JSON.
427+
%[1]s run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'
428428
429-
# Start the nginx container using a different command and custom arguments
430-
%[1]s run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>`)
429+
# Start a pod of busybox and keep it in the foreground, don't restart it if it exits.
430+
%[1]s run -i -t busybox --image=busybox --restart=Never
431+
432+
# Start the nginx container using the default command, but use custom arguments (arg1 .. argN)
433+
# for that command.
434+
%[1]s run nginx --image=nginx -- <arg1> <arg2> ... <argN>
435+
436+
# Start the nginx container using a different command and custom arguments.
437+
%[1]s run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
438+
439+
# Start the job to compute π to 2000 places and print it out.
440+
%[1]s run pi --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'
441+
442+
# Start the cron job to compute π to 2000 places and print it out every 5 minutes.
443+
%[1]s run pi --schedule="0/5 * * * ?" --image=perl --restart=OnFailure -- perl -Mbignum=bpi -wle 'print bpi(2000)'`)
431444
)
432445

433446
// NewCmdRun is a wrapper for the Kubernetes cli run command

0 commit comments

Comments
 (0)