:toc: macro
:toc-title:

toc::[]


== oc annotate
Update the annotations on a resource

====

[options="nowrap"]
----
  # Update pod 'foo' with the annotation 'description' and the value 'my frontend'.
  # If the same annotation is set multiple times, only the last value will be applied
  $ oc annotate pods foo description='my frontend'

  # Update pod 'foo' with the annotation 'description' and the value
  # 'my frontend running nginx', overwriting any existing value.
  $ oc annotate --overwrite pods foo description='my frontend running nginx'

  # Update all pods in the namespace
  $ oc annotate pods --all description='my frontend running nginx'

  # Update pod 'foo' only if the resource is unchanged from version 1.
  $ oc annotate pods foo description='my frontend running nginx' --resource-version=1

  # Update pod 'foo' by removing an annotation named 'description' if it exists.
  # Does not require the --overwrite flag.
  $ oc annotate pods foo description-
----
====


== oc attach
Attach to a running container.

====

[options="nowrap"]
----
  # Get output from running pod 123456-7890, using the first container by default
  $ oc attach 123456-7890

  # Get output from ruby-container from pod 123456-7890
  $ oc attach 123456-7890 -c ruby-container

  # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780
  # and sends stdout/stderr from 'bash' back to the client
  $ oc attach 123456-7890 -c ruby-container -i -t
----
====


== oc cancel-build
Cancel a pending or running build

====

[options="nowrap"]
----
  # Cancel the build with the given name
  $ oc cancel-build 1da32cvq

  # Cancel the named build and print the build logs
  $ oc cancel-build 1da32cvq --dump-logs

  # Cancel the named build and create a new one with the same parameters
  $ oc cancel-build 1da32cvq --restart
----
====


== oc config
Change configuration files for the client

====

[options="nowrap"]
----
  # Change the config context to use
  oc config use-context my-context
  
  # Set the value of a config preference
  oc config set preferences.some true
----
====


== oc config set-cluster
Sets a cluster entry in kubeconfig

====

[options="nowrap"]
----
  # Set only the server field on the e2e cluster entry without touching other values.
  $ oc config set-cluster e2e --server=https://1.2.3.4
  
  # Embed certificate authority data for the e2e cluster entry
  $ oc config set-cluster e2e --certificate-authority=~/.kube/e2e/kubernetes.ca.crt
  
  # Disable cert checking for the dev cluster entry
  $ oc config set-cluster e2e --insecure-skip-tls-verify=true
----
====


== oc config set-context
Sets a context entry in kubeconfig

====

[options="nowrap"]
----
  # Set the user field on the gce context entry without touching other values
  $ oc config set-context gce --user=cluster-admin
----
====


== oc config set-credentials
Sets a user entry in kubeconfig

====

[options="nowrap"]
----
  # Set only the "client-key" field on the "cluster-admin"
  # entry, without touching other values:
  $ oc config set-credentials cluster-admin --client-key=~/.kube/admin.key
  
  # Set basic auth for the "cluster-admin" entry
  $ oc config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
  
  # Embed client certificate data in the "cluster-admin" entry
  $ oc config set-credentials cluster-admin --client-certificate=~/.kube/admin.crt --embed-certs=true
----
====


== oc config view
Displays merged kubeconfig settings or a specified kubeconfig file.

====

[options="nowrap"]
----
  # Show Merged kubeconfig settings.
  $ oc config view
  
  # Get the password for the e2e user
  $ oc config view -o template --template='{{range .users}}{{ if eq .name "e2e" }}{{ index .user.password }}{{end}}{{end}}'
----
====


== oc convert
Convert config files between different API versions

====

[options="nowrap"]
----
# Convert 'pod.yaml' to latest version and print to stdout.
$ oc convert -f pod.yaml

# Convert the live state of the resource specified by 'pod.yaml' to the latest version
# and print to stdout in json format.
$ oc convert -f pod.yaml --local -o json

# Convert all files under current directory to latest version and create them all.
$ oc convert -f . | kubectl create -f -

----
====


== oc create
Create a resource by filename or stdin

====

[options="nowrap"]
----
  # Create a pod using the data in pod.json.
  $ oc create -f pod.json

  # Create a pod based on the JSON passed into stdin.
  $ cat pod.json | oc create -f -
----
====


== oc delete
Delete resources by filenames, stdin, resources and names, or by resources and label selector.

====

[options="nowrap"]
----
  # Delete a pod using the type and ID specified in pod.json.
  $ oc delete -f pod.json

  # Delete a pod based on the type and ID in the JSON passed into stdin.
  $ cat pod.json | oc delete -f -

  # Delete pods and services with label name=myLabel.
  $ oc delete pods,services -l name=myLabel

  # Delete a pod with ID 1234-56-7890-234234-456456.
  $ oc delete pod 1234-56-7890-234234-456456

  # Delete all pods
  $ oc delete pods --all
----
====


== oc deploy
View, start, cancel, or retry a deployment

====

[options="nowrap"]
----
  # Display the latest deployment for the 'database' deployment config
  $ oc deploy database

  # Start a new deployment based on the 'database'
  $ oc deploy database --latest

  # Retry the latest failed deployment based on 'frontend'
  # The deployer pod and any hook pods are deleted for the latest failed deployment
  $ oc deploy frontend --retry

  # Cancel the in-progress deployment based on 'frontend'
  $ oc deploy frontend --cancel
----
====


== oc describe
Show details of a specific resource or group of resources

====

[options="nowrap"]
----
  # Provide details about the ruby-22-centos7 image repository
  $ oc describe imageRepository ruby-22-centos7

  # Provide details about the ruby-sample-build build configuration
  $ oc describe bc ruby-sample-build
----
====


== oc edit
Edit a resource on the server

====

[options="nowrap"]
----
  # Edit the service named 'docker-registry':
  $ oc edit svc/docker-registry

  # Edit the DeploymentConfig named 'my-deployment':
  $ oc edit dc/my-deployment

  # Use an alternative editor
  $ OC_EDITOR="nano" oc edit dc/my-deployment

  # Edit the service 'docker-registry' in JSON using the v1beta3 API format:
  $ oc edit svc/docker-registry --output-version=v1beta3 -o json
----
====


== oc env
Update the environment on a resource with a pod template

====

[options="nowrap"]
----
  # Update deployment 'registry' with a new environment variable
  $ oc env dc/registry STORAGE_DIR=/local

  # List the environment variables defined on a deployment config 'registry'
  $ oc env dc/registry --list

  # List the environment variables defined on all pods
  $ oc env pods --all --list

  # Output modified deployment config in YAML, and does not alter the object on the server
  $ oc env dc/registry STORAGE_DIR=/data -o yaml

  # Update all containers in all replication controllers in the project to have ENV=prod
  $ oc env rc --all ENV=prod

  # Remove the environment variable ENV from container 'c1' in all deployment configs
  $ oc env dc --all --containers="c1" ENV-

  # Remove the environment variable ENV from a deployment config definition on disk and
  # update the deployment config on the server
  $ oc env -f dc.json ENV-

  # Set some of the local shell environment into a deployment config on the server
  $ env | grep RAILS_ | oc env -e - dc/registry
----
====


== oc exec
Execute a command in a container.

====

[options="nowrap"]
----
  # Get output from running 'date' in ruby-container from pod 123456-7890
  $ oc exec -p 123456-7890 -c ruby-container date

  # Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod 123456-780 and sends stdout/stderr from 'bash' back to the client
  $ oc exec -p 123456-7890 -c ruby-container -i -t -- bash -il
----
====


== oc explain
Documentation of resources.

====

[options="nowrap"]
----
# Get the documentation of the resource and its fields
$ oc explain pods

# Get the documentation of a specific field of a resource
$ oc explain pods.spec.containers
----
====


== oc export
Export resources so they can be used elsewhere

====

[options="nowrap"]
----
  # export the services and deployment configurations labeled name=test
  oc export svc,dc -l name=test

  # export all services to a template
  oc export service --as-template=test

  # export to JSON
  oc export service -o json

  # convert a file on disk to the latest API version (in YAML, the default)
  oc export -f a_v1beta3_service.json --output-version=v1 --exact
----
====


== oc expose
Expose a replicated application as a service or route

====

[options="nowrap"]
----
  # Create a route based on service nginx. The new route will re-use nginx's labels
  $ oc expose service nginx

  # Create a route and specify your own label and route name
  $ oc expose service nginx -l name=myroute --name=fromdowntown

  # Create a route and specify a hostname
  $ oc expose service nginx --hostname=www.example.com

  # Expose a deployment configuration as a service and use the specified port
  $ oc expose dc ruby-hello-world --port=8080
----
====


== oc get
Display one or many resources

====

[options="nowrap"]
----
  # List all pods in ps output format.
  $ oc get pods

  # List a single replication controller with specified ID in ps output format.
  $ oc get rc redis

  # List all pods and show more details about them.
  $ oc get -o wide pods

  # List a single pod in JSON output format.
  $ oc get -o json pod redis-pod

  # Return only the status value of the specified pod.
  $ oc get -o template pod redis-pod --template={{.currentState.status}}
----
====


== oc import-image
Imports images from a Docker registry

====

[options="nowrap"]
----
  $ oc import-image mystream
----
====


== oc label
Update the labels on a resource

====

[options="nowrap"]
----
  # Update pod 'foo' with the label 'unhealthy' and the value 'true'.
  $ oc label pods foo unhealthy=true

  # Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value.
  $ oc label --overwrite pods foo status=unhealthy

  # Update all pods in the namespace
  $ oc label pods --all status=unhealthy

  # Update pod 'foo' only if the resource is unchanged from version 1.
  $ oc label pods foo status=unhealthy --resource-version=1

  # Update pod 'foo' by removing a label named 'bar' if it exists.
  # Does not require the --overwrite flag.
  $ oc label pods foo bar-
----
====


== oc login
Log in to a server

====

[options="nowrap"]
----
  # Log in interactively
  $ oc login

  # Log in to the given server with the given certificate authority file
  $ oc login localhost:8443 --certificate-authority=/path/to/cert.crt

  # Log in to the given server with the given credentials (will not prompt interactively)
  $ oc login localhost:8443 --username=myuser --password=mypass
----
====


== oc logout
End the current server session

====

[options="nowrap"]
----

  # Logout
  $ oc logout
----
====


== oc logs
Print the logs for a resource.

====

[options="nowrap"]
----
  # Start streaming the logs of the most recent build of the openldap build config.
  $ oc logs -f bc/openldap

  # Start streaming the logs of the latest deployment of the mysql deployment config.
  $ oc logs -f dc/mysql

  # Get the logs of the first deployment for the mysql deployment config. Note that logs
  # from older deployments may not exist either because the deployment was successful
  # or due to deployment pruning or manual deletion of the deployment.
  $ oc logs --version=1 dc/mysql

  # Return a snapshot of ruby-container logs from pod backend.
  $ oc logs backend -c ruby-container

  # Start streaming of ruby-container logs from pod backend.
  $ oc logs -f pod/backend -c ruby-container
----
====


== oc new-app
Create a new application

====

[options="nowrap"]
----

  # List all local templates and image streams that can be used to create an app
  $ oc new-app --list

  # Search all templates, image streams, and Docker images for the ones that match "ruby"
  $ oc new-app --search ruby

  # Create an application based on the source code in the current git repository (with a public remote)
  # and a Docker image
  $ oc new-app . --docker-image=repo/langimage

  # Create a Ruby application based on the provided [image]~[source code] combination
  $ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-hello-world.git

  # Use the public Docker Hub MySQL image to create an app. Generated artifacts will be labeled with db=mysql
  $ oc new-app mysql MYSQL_USER=user MYSQL_PASSWORD=pass MYSQL_DATABASE=testdb -l db=mysql

  # Use a MySQL image in a private registry to create an app and override application artifacts' names
  $ oc new-app --docker-image=myregistry.com/mycompany/mysql --name=private

  # Create an application from a remote repository using its beta4 branch
  $ oc new-app https://github.com/openshift/ruby-hello-world#beta4

  # Create an application based on a stored template, explicitly setting a parameter value
  $ oc new-app --template=ruby-helloworld-sample --param=MYSQL_USER=admin

  # Create an application from a remote repository and specify a context directory
  $ oc new-app https://github.com/youruser/yourgitrepo --context-dir=src/build

  # Create an application based on a template file, explicitly setting a parameter value
  $ oc new-app --file=./example/myapp/template.json --param=MYSQL_USER=admin

  # Search for "mysql" in all image repositories and stored templates
  $ oc new-app --search mysql

  # Search for "ruby", but only in stored templates (--template, --image and --docker-image
  # can be used to filter search results)
  $ oc new-app --search --template=ruby

  # Search for "ruby" in stored templates and print the output as an YAML
  $ oc new-app --search --template=ruby --output=yaml
----
====


== oc new-build
Create a new build configuration

====

[options="nowrap"]
----

  # Create a build config based on the source code in the current git repository (with a public
  # remote) and a Docker image
  $ oc new-build . --docker-image=repo/langimage

  # Create a NodeJS build config based on the provided [image]~[source code] combination
  $ oc new-build openshift/nodejs-010-centos7~https://github.com/openshift/nodejs-ex.git

  # Create a build config from a remote repository using its beta2 branch
  $ oc new-build https://github.com/openshift/ruby-hello-world#beta2

  # Create a build config using a Dockerfile specified as an argument
  $ oc new-build -D $'FROM centos:7\nRUN yum install -y httpd'

  # Create a build config from a remote repository and add custom environment variables
  $ oc new-build https://github.com/openshift/ruby-hello-world RACK_ENV=development
----
====


== oc new-project
Request a new project

====

[options="nowrap"]
----
  # Create a new project with minimal information
  $ oc new-project web-team-dev

  # Create a new project with a display name and description
  $ oc new-project web-team-dev --display-name="Web Team Development" --description="Development project for the web team."
----
====


== oc patch
Update field(s) of a resource by stdin.

====

[options="nowrap"]
----
  # Partially update a node using strategic merge patch
  $ oc patch node k8s-node-1 -p '{"spec":{"unschedulable":true}}'
----
====


== oc port-forward
Forward one or more local ports to a pod.

====

[options="nowrap"]
----
  # Listens on ports 5000 and 6000 locally, forwarding data to/from ports 5000 and 6000 in the pod
  $ oc port-forward -p mypod 5000 6000

  # Listens on port 8888 locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod 8888:5000

  # Listens on a random port locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod :5000

  # Listens on a random port locally, forwarding to 5000 in the pod
  $ oc port-forward -p mypod 0:5000
----
====


== oc process
Process a template into list of resources

====

[options="nowrap"]
----
  # Convert template.json file into resource list and pass to create
  $ oc process -f template.json | oc create -f -

  # Process template while passing a user-defined label
  $ oc process -f template.json -l name=mytemplate

  # Convert stored template into resource list
  $ oc process foo

  # Convert template stored in different namespace into a resource list
  $ oc process openshift//foo

  # Convert template.json into resource list
  $ cat template.json | oc process -f -

  # Combine multiple templates into single resource list
  $ cat template.json second_template.json | oc process -f -
----
====


== oc project
Switch to another project

====

[options="nowrap"]
----
  # Switch to 'myapp' project
  $ oc project myapp

  # Display the project currently in use
  $ oc project
----
====


== oc proxy
Run a proxy to the Kubernetes API server

====

[options="nowrap"]
----
  # Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/
  $ oc proxy --port=8011 --www=./local/www/

  # Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api
  # This makes e.g. the pods api available at localhost:8011/k8s-api/v1beta3/pods/
  $ oc proxy --api-prefix=k8s-api
----
====


== oc replace
Replace a resource by filename or stdin.

====

[options="nowrap"]
----
  # Replace a pod using the data in pod.json.
  $ oc replace -f pod.json

  # Replace a pod based on the JSON passed into stdin.
  $ cat pod.json | oc replace -f -

  # Force replace, delete and then re-create the resource
  $ oc replace --force -f pod.json
----
====


== oc rollback
Revert part of an application back to a previous deployment

====

[options="nowrap"]
----
  # Perform a rollback to the last successfully completed deployment for a deploymentconfig
  $ oc rollback frontend

  # See what a rollback to version 3 will look like, but don't perform the rollback
  $ oc rollback frontend --to-version=3 --dry-run

  # Perform a rollback to a specific deployment
  $ oc rollback frontend-2

  # Perform the rollback manually by piping the JSON of the new config back to oc
  $ oc rollback frontend --output=json | oc update deploymentConfigs deployment -f -
----
====


== oc rsh
Start a shell session in a pod

====

[options="nowrap"]
----

  # Open a shell session on the first container in pod 'foo'
  $ oc rsh foo

  # Run the command 'cat /etc/resolv.conf' inside pod 'foo'
  $ oc rsh foo cat /etc/resolv.conf
----
====


== oc rsync
Copy files between local filesystem and a pod

====

[options="nowrap"]
----

  # Synchronize a local directory with a pod directory
  $ oc rsync ./local/dir/ POD:/remote/dir

  # Synchronize a pod directory with a local directory
  $ oc rsync POD:/remote/dir/ ./local/dir
----
====


== oc run
Run a particular image on the cluster.

====

[options="nowrap"]
----
  # Starts a single instance of nginx.
  $ oc run nginx --image=nginx

  # Starts a replicated instance of nginx.
  $ oc run nginx --image=nginx --replicas=5

  # Dry run. Print the corresponding API objects without creating them.
  $ oc run nginx --image=nginx --dry-run

  # Start a single instance of nginx, but overload the spec of the replication
  # controller with a partial set of values parsed from JSON.
  $ oc run nginx --image=nginx --overrides='{ "apiVersion": "v1", "spec": { ... } }'

  # Start a single instance of nginx and keep it in the foreground, don't restart it if it exits.
  $ oc run -i --tty nginx --image=nginx --restart=Never
----
====


== oc scale
Change the number of pods in a deployment

====

[options="nowrap"]
----
  # Scale replication controller named 'foo' to 3.
  $ oc scale --replicas=3 replicationcontrollers foo

  # If the replication controller named foo's current size is 2, scale foo to 3.
  $ oc scale --current-replicas=2 --replicas=3 replicationcontrollers foo

  # Scale the latest deployment of 'bar'. In case of no deployment, bar's template
  # will be scaled instead.
  $ oc scale --replicas=10 dc bar
----
====


== oc secrets add
Add secrets to a ServiceAccount

====

[options="nowrap"]
----
  // To use your secret inside of a pod or as a push, pull, or source secret for a build, you must add a 'mount' secret to your service account like this:
  $ oc secrets add serviceaccount/sa-name secrets/secret-name secrets/another-secret-name

  // To use your secret as an image pull secret, you must add a 'pull' secret to your service account like this:
  $ oc secrets add serviceaccount/sa-name secrets/secret-name --for=pull

  // To use your secret for image pulls or inside a pod:
  $ oc secrets add serviceaccount/sa-name secrets/secret-name --for=pull,mount
----
====


== oc secrets new
Create a new secret based on a key file or on files within a directory

====

[options="nowrap"]
----
  # Create a new secret named my-secret with a key named ssh-privatekey
  $ oc secrets new my-secret ~/.ssh/ssh-privatekey

  # Create a new secret named my-secret with keys named ssh-privatekey and ssh-publickey instead of the names of the keys on disk
  $ oc secrets new my-secret ssh-privatekey=~/.ssh/id_rsa ssh-publickey=~/.ssh/id_rsa.pub

  # Create a new secret named my-secret with keys for each file in the folder "bar"
  $ oc secrets new my-secret path/to/bar

  # Create a new .dockercfg secret named my-secret
  $ oc secrets new my-secret path/to/.dockercfg

  # Create a new .docker/config.json secret named my-secret
  $ oc secrets new my-secret .dockerconfigjson=path/to/.docker/config.json
----
====


== oc secrets new-basicauth
Create a new secret for basic authentication

====

[options="nowrap"]
----
  // If your basic authentication method requires only username and password or token, add it by using:
  $ oc secrets new-basicauth SECRET --username=USERNAME --password=PASSWORD

  // If your basic authentication method requires also CA certificate, add it by using:
  $ oc secrets new-basicauth SECRET --username=USERNAME --password=PASSWORD --ca-cert=FILENAME

  // If you do already have a .gitconfig file needed for authentication, you can create a gitconfig secret by using:
  $ oc secrets new SECRET path/to/.gitconfig
----
====


== oc secrets new-dockercfg
Create a new dockercfg secret

====

[options="nowrap"]
----
  // If you don't already have a .dockercfg file, you can create a dockercfg secret directly by using:
  $ oc secrets new-dockercfg SECRET --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL

  // If you do already have a .dockercfg file, you can create a dockercfg secret by using:
  $ oc secrets new SECRET path/to/.dockercfg

  // To add new secret to 'imagePullSecrets' for the node, or 'secrets' for builds, use:
  $ oc edit SERVICE_ACCOUNT
----
====


== oc secrets new-sshauth
Create a new secret for SSH authentication

====

[options="nowrap"]
----
  // If your SSH authentication method requires only private SSH key, add it by using:
  $ oc secrets new-sshauth SECRET --ssh-privatekey=FILENAME

  // If your SSH authentication method requires also CA certificate, add it by using:
  $ oc secrets new-sshauth SECRET --ssh-privatekey=FILENAME --ca-cert=FILENAME

  // If you do already have a .gitconfig file needed for authentication, you can create a gitconfig secret by using:
  $ oc secrets new SECRET path/to/.gitconfig
----
====


== oc start-build
Start a new build

====

[options="nowrap"]
----
  # Starts build from build config "hello-world"
  $ oc start-build hello-world

  # Starts build from a previous build "hello-world-1"
  $ oc start-build --from-build=hello-world-1

  # Use the contents of a directory as build input
  $ oc start-build hello-world --from-dir=src/

  # Send the contents of a Git repository to the server from tag 'v2'
  $ oc start-build hello-world --from-repo=../hello-world --commit=v2

  # Start a new build for build config "hello-world" and watch the logs until the build
  # completes or fails.
  $ oc start-build hello-world --follow

  # Start a new build for build config "hello-world" and wait until the build completes. It
  # exits with a non-zero return code if the build fails.
  $ oc start-build hello-world --wait
----
====


== oc status
Show an overview of the current project

====

[options="nowrap"]
----
  # See an overview of the current project.
  $ oc status

  # Export the overview of the current project in an svg file.
  $ oc status -o dot | dot -T svg -o project.svg

  # See an overview of the current project including details for any identified issues.
  $ oc status -v
----
====


== oc stop
Deprecated: Gracefully shut down a resource by name or filename.

====

[options="nowrap"]
----
  # Shut down foo.
  $ oc stop replicationcontroller foo

  # Stop pods and services with label name=myLabel.
  $ oc stop pods,services -l name=myLabel

  # Shut down the service defined in service.json
  $ oc stop -f service.json

  # Shut down all resources in the path/to/resources directory
  $ oc stop -f path/to/resources
----
====


== oc tag
Tag existing images into image streams

====

[options="nowrap"]
----
  # Tag the current image for the image stream 'openshift/ruby' and tag '2.0' into the image stream 'yourproject/ruby with tag 'tip'.
  $ oc tag openshift/ruby:2.0 yourproject/ruby:tip

  # Tag a specific image.
  $ oc tag openshift/ruby@sha256:6b646fa6bf5e5e4c7fa41056c27910e679c03ebe7f93e361e6515a9da7e258cc yourproject/ruby:tip

  # Tag an external Docker image.
  $ oc tag --source=docker openshift/origin:latest yourproject/ruby:tip

  # Remove the specified spec tag from an image stream.
  $ oc tag openshift/origin:latest -d
----
====


== oc types
An introduction to concepts and types

====

[options="nowrap"]
----
  # View all projects you have access to
  $ oc get projects

  # See a list of all services in the current project
  $ oc get svc

  # Describe a deployment configuration in detail
  $ oc describe dc mydeploymentconfig

  # Show the images tagged into an image stream
  $ oc describe is ruby-centos7
----
====


== oc volumes
Update volume on a resource with a pod template

====

[options="nowrap"]
----
  # List volumes defined on all deployment configs in the current project
  $ oc volume dc --all

  # Add a new empty dir volume to deployment config (dc) 'registry' mounted under
  # /var/lib/registry
  $ oc volume dc/registry --add --mount-path=/var/lib/registry

  # Use an existing persistent volume claim (pvc) to overwrite an existing volume 'v1'
  $ oc volume dc/registry --add --name=v1 -t pvc --claim-name=pvc1 --overwrite

  # Remove volume 'v1' from deployment config 'registry'
  $ oc volume dc/registry --remove --name=v1

  # Create a new persistent volume claim that overwrites an existing volume 'v1'
  $ oc volume dc/registry --add --name=v1 -t pvc --claim-size=1G --overwrite

  # Change the mount point for volume 'v1' to /data
  $ oc volume dc/registry --add --name=v1 -m /data --overwrite

  # Modify the deployment config by removing volume mount "v1" from container "c1"
  # (and by removing the volume "v1" if no other containers have volume mounts that reference it)
  $ oc volume dc/registry --remove --name=v1 --containers=c1

  # Add new volume based on a more complex volume source (Git repo, AWS EBS, GCE PD,
  # Ceph, Gluster, NFS, ISCSI, ...)
  $ oc volume dc/registry --add -m /repo --source=<json-string>
----
====


