Este conteúdo não está disponível no idioma selecionado.
Chapter 6. OpenShift CLI command reference
Descriptions and example commands for OpenShift CLI (oc) commands are included in this reference document. You must have cluster-admin or equivalent permissions to use these commands. To list administrator commands and information about them, use the following commands:
Enter the
oc adm -hcommand to list all administrator commands:Command syntax
oc adm -h
$ oc adm -hCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enter the
oc <command> --helpcommand to get additional details for a specific command:Command syntax
oc <command> --help
$ oc <command> --helpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Using oc <command> --help lists details for any oc command. Not all oc commands apply to using Red Hat build of MicroShift.
6.1. OpenShift CLI (oc) developer commands Copiar o linkLink copiado para a área de transferência!
6.1.1. oc annotate Copiar o linkLink copiado para a área de transferência!
Update the annotations on a resource
Example usage
6.1.2. oc api-resources Copiar o linkLink copiado para a área de transferência!
Print the supported API resources on the server
Example usage
6.1.3. oc api-versions Copiar o linkLink copiado para a área de transferência!
Print the supported API versions on the server, in the form of "group/version"
Example usage
# Print the supported API versions oc api-versions
# Print the supported API versions
oc api-versions
6.1.4. oc apply Copiar o linkLink copiado para a área de transferência!
Apply a configuration to a resource by file name or stdin
Example usage
6.1.5. oc apply edit-last-applied Copiar o linkLink copiado para a área de transferência!
Edit latest last-applied-configuration annotations of a resource/object
Example usage
# Edit the last-applied-configuration annotations by type/name in YAML oc apply edit-last-applied deployment/nginx # Edit the last-applied-configuration annotations by file in JSON oc apply edit-last-applied -f deploy.yaml -o json
# Edit the last-applied-configuration annotations by type/name in YAML
oc apply edit-last-applied deployment/nginx
# Edit the last-applied-configuration annotations by file in JSON
oc apply edit-last-applied -f deploy.yaml -o json
6.1.6. oc apply set-last-applied Copiar o linkLink copiado para a área de transferência!
Set the last-applied-configuration annotation on a live object to match the contents of a file
Example usage
6.1.7. oc apply view-last-applied Copiar o linkLink copiado para a área de transferência!
View the latest last-applied-configuration annotations of a resource/object
Example usage
# View the last-applied-configuration annotations by type/name in YAML oc apply view-last-applied deployment/nginx # View the last-applied-configuration annotations by file in JSON oc apply view-last-applied -f deploy.yaml -o json
# View the last-applied-configuration annotations by type/name in YAML
oc apply view-last-applied deployment/nginx
# View the last-applied-configuration annotations by file in JSON
oc apply view-last-applied -f deploy.yaml -o json
6.1.8. oc attach Copiar o linkLink copiado para a área de transferência!
Attach to a running container
Example usage
6.1.9. oc auth can-i Copiar o linkLink copiado para a área de transferência!
Check whether an action is allowed
Example usage
6.1.10. oc auth reconcile Copiar o linkLink copiado para a área de transferência!
Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects
Example usage
# Reconcile RBAC resources from a file oc auth reconcile -f my-rbac-rules.yaml
# Reconcile RBAC resources from a file
oc auth reconcile -f my-rbac-rules.yaml
6.1.11. oc auth whoami Copiar o linkLink copiado para a área de transferência!
Experimental: Check self subject attributes
Example usage
# Get your subject attributes. oc auth whoami # Get your subject attributes in JSON format. oc auth whoami -o json
# Get your subject attributes.
oc auth whoami
# Get your subject attributes in JSON format.
oc auth whoami -o json
6.1.12. oc cluster-info Copiar o linkLink copiado para a área de transferência!
Display cluster information
Example usage
# Print the address of the control plane and cluster services oc cluster-info
# Print the address of the control plane and cluster services
oc cluster-info
6.1.13. oc cluster-info dump Copiar o linkLink copiado para a área de transferência!
Dump relevant information for debugging and diagnosis
Example usage
6.1.14. oc completion Copiar o linkLink copiado para a área de transferência!
Output shell completion code for the specified shell (bash, zsh, fish, or powershell)
Example usage
6.1.15. oc config current-context Copiar o linkLink copiado para a área de transferência!
Display the current-context
Example usage
# Display the current-context oc config current-context
# Display the current-context
oc config current-context
6.1.16. oc config delete-cluster Copiar o linkLink copiado para a área de transferência!
Delete the specified cluster from the kubeconfig
Example usage
# Delete the minikube cluster oc config delete-cluster minikube
# Delete the minikube cluster
oc config delete-cluster minikube
6.1.17. oc config delete-context Copiar o linkLink copiado para a área de transferência!
Delete the specified context from the kubeconfig
Example usage
# Delete the context for the minikube cluster oc config delete-context minikube
# Delete the context for the minikube cluster
oc config delete-context minikube
6.1.18. oc config delete-user Copiar o linkLink copiado para a área de transferência!
Delete the specified user from the kubeconfig
Example usage
# Delete the minikube user oc config delete-user minikube
# Delete the minikube user
oc config delete-user minikube
6.1.19. oc config get-clusters Copiar o linkLink copiado para a área de transferência!
Display clusters defined in the kubeconfig
Example usage
# List the clusters that oc knows about oc config get-clusters
# List the clusters that oc knows about
oc config get-clusters
6.1.20. oc config get-contexts Copiar o linkLink copiado para a área de transferência!
Describe one or many contexts
Example usage
# List all the contexts in your kubeconfig file oc config get-contexts # Describe one context in your kubeconfig file oc config get-contexts my-context
# List all the contexts in your kubeconfig file
oc config get-contexts
# Describe one context in your kubeconfig file
oc config get-contexts my-context
6.1.21. oc config get-users Copiar o linkLink copiado para a área de transferência!
Display users defined in the kubeconfig
Example usage
# List the users that oc knows about oc config get-users
# List the users that oc knows about
oc config get-users
6.1.22. oc config new-admin-kubeconfig Copiar o linkLink copiado para a área de transferência!
Generate, make the server trust, and display a new admin.kubeconfig.
Example usage
# Generate a new admin kubeconfig oc config new-admin-kubeconfig
# Generate a new admin kubeconfig
oc config new-admin-kubeconfig
6.1.23. oc config new-kubelet-bootstrap-kubeconfig Copiar o linkLink copiado para a área de transferência!
Generate, make the server trust, and display a new kubelet /etc/kubernetes/kubeconfig.
Example usage
# Generate a new kubelet bootstrap kubeconfig oc config new-kubelet-bootstrap-kubeconfig
# Generate a new kubelet bootstrap kubeconfig
oc config new-kubelet-bootstrap-kubeconfig
6.1.24. oc config refresh-ca-bundle Copiar o linkLink copiado para a área de transferência!
Update the OpenShift CA bundle by contacting the apiserver.
Example usage
6.1.25. oc config rename-context Copiar o linkLink copiado para a área de transferência!
Rename a context from the kubeconfig file
Example usage
# Rename the context 'old-name' to 'new-name' in your kubeconfig file oc config rename-context old-name new-name
# Rename the context 'old-name' to 'new-name' in your kubeconfig file
oc config rename-context old-name new-name
6.1.26. oc config set Copiar o linkLink copiado para a área de transferência!
Set an individual value in a kubeconfig file
Example usage
6.1.27. oc config set-cluster Copiar o linkLink copiado para a área de transferência!
Set a cluster entry in kubeconfig
Example usage
6.1.28. oc config set-context Copiar o linkLink copiado para a área de transferência!
Set a context entry in kubeconfig
Example usage
# Set the user field on the gce context entry without touching other values oc config set-context gce --user=cluster-admin
# Set the user field on the gce context entry without touching other values
oc config set-context gce --user=cluster-admin
6.1.29. oc config set-credentials Copiar o linkLink copiado para a área de transferência!
Set a user entry in kubeconfig
Example usage
6.1.30. oc config unset Copiar o linkLink copiado para a área de transferência!
Unset an individual value in a kubeconfig file
Example usage
# Unset the current-context oc config unset current-context # Unset namespace in foo context oc config unset contexts.foo.namespace
# Unset the current-context
oc config unset current-context
# Unset namespace in foo context
oc config unset contexts.foo.namespace
6.1.31. oc config use-context Copiar o linkLink copiado para a área de transferência!
Set the current-context in a kubeconfig file
Example usage
# Use the context for the minikube cluster oc config use-context minikube
# Use the context for the minikube cluster
oc config use-context minikube
6.1.32. oc config view Copiar o linkLink copiado para a área de transferência!
Display merged kubeconfig settings or a specified kubeconfig file
Example usage
6.1.33. oc cp Copiar o linkLink copiado para a área de transferência!
Copy files and directories to and from containers
Example usage
6.1.34. oc create Copiar o linkLink copiado para a área de transferência!
Create a resource from a file or from stdin
Example usage
6.1.35. oc create clusterrole Copiar o linkLink copiado para a área de transferência!
Create a cluster role
Example usage
6.1.36. oc create clusterrolebinding Copiar o linkLink copiado para a área de transferência!
Create a cluster role binding for a particular cluster role
Example usage
# Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role oc create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1
# Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role
oc create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1
6.1.37. oc create configmap Copiar o linkLink copiado para a área de transferência!
Create a config map from a local file, directory or literal value
Example usage
6.1.38. oc create cronjob Copiar o linkLink copiado para a área de transferência!
Create a cron job with the specified name
Example usage
# Create a cron job oc create cronjob my-job --image=busybox --schedule="*/1 * * * *" # Create a cron job with a command oc create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date
# Create a cron job
oc create cronjob my-job --image=busybox --schedule="*/1 * * * *"
# Create a cron job with a command
oc create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date
6.1.39. oc create deployment Copiar o linkLink copiado para a área de transferência!
Create a deployment with the specified name
Example usage
6.1.40. oc create ingress Copiar o linkLink copiado para a área de transferência!
Create an ingress with the specified name
Example usage
6.1.41. oc create job Copiar o linkLink copiado para a área de transferência!
Create a job with the specified name
Example usage
6.1.42. oc create namespace Copiar o linkLink copiado para a área de transferência!
Create a namespace with the specified name
Example usage
# Create a new namespace named my-namespace oc create namespace my-namespace
# Create a new namespace named my-namespace
oc create namespace my-namespace
6.1.43. oc create poddisruptionbudget Copiar o linkLink copiado para a área de transferência!
Create a pod disruption budget with the specified name
Example usage
6.1.44. oc create priorityclass Copiar o linkLink copiado para a área de transferência!
Create a priority class with the specified name
Example usage
6.1.45. oc create quota Copiar o linkLink copiado para a área de transferência!
Create a quota with the specified name
Example usage
# Create a new resource quota named my-quota oc create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10 # Create a new resource quota named best-effort oc create quota best-effort --hard=pods=100 --scopes=BestEffort
# Create a new resource quota named my-quota
oc create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10
# Create a new resource quota named best-effort
oc create quota best-effort --hard=pods=100 --scopes=BestEffort
6.1.46. oc create role Copiar o linkLink copiado para a área de transferência!
Create a role with single rule
Example usage
6.1.47. oc create rolebinding Copiar o linkLink copiado para a área de transferência!
Create a role binding for a particular role or cluster role
Example usage
# Create a role binding for user1, user2, and group1 using the admin cluster role oc create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1 # Create a role binding for serviceaccount monitoring:sa-dev using the admin role oc create rolebinding admin-binding --role=admin --serviceaccount=monitoring:sa-dev
# Create a role binding for user1, user2, and group1 using the admin cluster role
oc create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1
# Create a role binding for serviceaccount monitoring:sa-dev using the admin role
oc create rolebinding admin-binding --role=admin --serviceaccount=monitoring:sa-dev
6.1.48. oc create route edge Copiar o linkLink copiado para a área de transferência!
Create a route that uses edge TLS termination
Example usage
6.1.49. oc create route passthrough Copiar o linkLink copiado para a área de transferência!
Create a route that uses passthrough TLS termination
Example usage
6.1.50. oc create route reencrypt Copiar o linkLink copiado para a área de transferência!
Create a route that uses reencrypt TLS termination
Example usage
6.1.51. oc create secret docker-registry Copiar o linkLink copiado para a área de transferência!
Create a secret for use with a Docker registry
Example usage
# If you don't already have a .dockercfg file, you can create a dockercfg secret directly by using: oc create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL # Create a new secret named my-secret from ~/.docker/config.json oc create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json
# If you don't already have a .dockercfg file, you can create a dockercfg secret directly by using:
oc create secret docker-registry my-secret --docker-server=DOCKER_REGISTRY_SERVER --docker-username=DOCKER_USER --docker-password=DOCKER_PASSWORD --docker-email=DOCKER_EMAIL
# Create a new secret named my-secret from ~/.docker/config.json
oc create secret docker-registry my-secret --from-file=.dockerconfigjson=path/to/.docker/config.json
6.1.52. oc create secret generic Copiar o linkLink copiado para a área de transferência!
Create a secret from a local file, directory, or literal value
Example usage
6.1.53. oc create secret tls Copiar o linkLink copiado para a área de transferência!
Create a TLS secret
Example usage
# Create a new TLS secret named tls-secret with the given key pair oc create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key
# Create a new TLS secret named tls-secret with the given key pair
oc create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key
6.1.54. oc create service clusterip Copiar o linkLink copiado para a área de transferência!
Create a ClusterIP service
Example usage
# Create a new ClusterIP service named my-cs oc create service clusterip my-cs --tcp=5678:8080 # Create a new ClusterIP service named my-cs (in headless mode) oc create service clusterip my-cs --clusterip="None"
# Create a new ClusterIP service named my-cs
oc create service clusterip my-cs --tcp=5678:8080
# Create a new ClusterIP service named my-cs (in headless mode)
oc create service clusterip my-cs --clusterip="None"
6.1.55. oc create service externalname Copiar o linkLink copiado para a área de transferência!
Create an ExternalName service
Example usage
# Create a new ExternalName service named my-ns oc create service externalname my-ns --external-name bar.com
# Create a new ExternalName service named my-ns
oc create service externalname my-ns --external-name bar.com
6.1.56. oc create service loadbalancer Copiar o linkLink copiado para a área de transferência!
Create a LoadBalancer service
Example usage
# Create a new LoadBalancer service named my-lbs oc create service loadbalancer my-lbs --tcp=5678:8080
# Create a new LoadBalancer service named my-lbs
oc create service loadbalancer my-lbs --tcp=5678:8080
6.1.57. oc create service nodeport Copiar o linkLink copiado para a área de transferência!
Create a NodePort service
Example usage
# Create a new NodePort service named my-ns oc create service nodeport my-ns --tcp=5678:8080
# Create a new NodePort service named my-ns
oc create service nodeport my-ns --tcp=5678:8080
6.1.58. oc create serviceaccount Copiar o linkLink copiado para a área de transferência!
Create a service account with the specified name
Example usage
# Create a new service account named my-service-account oc create serviceaccount my-service-account
# Create a new service account named my-service-account
oc create serviceaccount my-service-account
6.1.59. oc create token Copiar o linkLink copiado para a área de transferência!
Request a service account token
Example usage
6.1.60. oc debug Copiar o linkLink copiado para a área de transferência!
Launch a new instance of a pod for debugging
Example usage
6.1.61. oc delete Copiar o linkLink copiado para a área de transferência!
Delete resources by file names, stdin, resources and names, or by resources and label selector
Example usage
6.1.62. oc describe Copiar o linkLink copiado para a área de transferência!
Show details of a specific resource or group of resources
Example usage
6.1.63. oc diff Copiar o linkLink copiado para a área de transferência!
Diff the live version against a would-be applied version
Example usage
# Diff resources included in pod.json oc diff -f pod.json # Diff file read from stdin cat service.yaml | oc diff -f -
# Diff resources included in pod.json
oc diff -f pod.json
# Diff file read from stdin
cat service.yaml | oc diff -f -
6.1.64. oc edit Copiar o linkLink copiado para a área de transferência!
Edit a resource on the server
Example usage
6.1.65. oc events Copiar o linkLink copiado para a área de transferência!
List events
Example usage
6.1.66. oc exec Copiar o linkLink copiado para a área de transferência!
Execute a command in a container
Example usage
6.1.67. oc explain Copiar o linkLink copiado para a área de transferência!
Get documentation for a resource
Example usage
# 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
# 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
6.1.68. oc expose Copiar o linkLink copiado para a área de transferência!
Expose a replicated application as a service or route
Example usage
6.1.69. oc extract Copiar o linkLink copiado para a área de transferência!
Extract secrets or config maps to disk
Example usage
6.1.70. oc get Copiar o linkLink copiado para a área de transferência!
Display one or many resources
Example usage
6.1.71. oc image append Copiar o linkLink copiado para a área de transferência!
Add layers to images and push them to a registry
Example usage
6.1.72. oc image extract Copiar o linkLink copiado para a área de transferência!
Copy files from an image to the file system
Example usage
6.1.73. oc image info Copiar o linkLink copiado para a área de transferência!
Display information about an image
Example usage
6.1.74. oc image mirror Copiar o linkLink copiado para a área de transferência!
Mirror images from one repository to another
Example usage
6.1.75. oc kustomize Copiar o linkLink copiado para a área de transferência!
Build a kustomization target from a directory or URL
Example usage
6.1.76. oc label Copiar o linkLink copiado para a área de transferência!
Update the labels on a resource
Example usage
6.1.77. oc logs Copiar o linkLink copiado para a área de transferência!
Print the logs for a container in a pod
Example usage
6.1.78. oc observe Copiar o linkLink copiado para a área de transferência!
Observe changes to resources and react to them (experimental)
Example usage
6.1.79. oc patch Copiar o linkLink copiado para a área de transferência!
Update fields of a resource
Example usage
6.1.80. oc plugin list Copiar o linkLink copiado para a área de transferência!
List all visible plugin executables on a user’s PATH
Example usage
# List all available plugins oc plugin list
# List all available plugins
oc plugin list
6.1.81. oc policy add-role-to-user Copiar o linkLink copiado para a área de transferência!
Add a role to users or service accounts for the current project
Example usage
# Add the 'view' role to user1 for the current project oc policy add-role-to-user view user1 # Add the 'edit' role to serviceaccount1 for the current project oc policy add-role-to-user edit -z serviceaccount1
# Add the 'view' role to user1 for the current project
oc policy add-role-to-user view user1
# Add the 'edit' role to serviceaccount1 for the current project
oc policy add-role-to-user edit -z serviceaccount1
6.1.82. oc policy scc-review Copiar o linkLink copiado para a área de transferência!
Check which service account can create a pod
Example usage
6.1.83. oc policy scc-subject-review Copiar o linkLink copiado para a área de transferência!
Check whether a user or a service account can create a pod
Example usage
6.1.84. oc port-forward Copiar o linkLink copiado para a área de transferência!
Forward one or more local ports to a pod
Example usage
6.1.85. oc proxy Copiar o linkLink copiado para a área de transferência!
Run a proxy to the Kubernetes API server
Example usage
6.1.86. oc rollback Copiar o linkLink copiado para a área de transferência!
Revert part of an application back to a previous deployment
Example usage
6.1.87. oc rollout cancel Copiar o linkLink copiado para a área de transferência!
Cancel the in-progress deployment
Example usage
# Cancel the in-progress deployment based on 'nginx' oc rollout cancel dc/nginx
# Cancel the in-progress deployment based on 'nginx'
oc rollout cancel dc/nginx
6.1.88. oc rollout history Copiar o linkLink copiado para a área de transferência!
View rollout history
Example usage
# View the rollout history of a deployment oc rollout history dc/nginx # View the details of deployment revision 3 oc rollout history dc/nginx --revision=3
# View the rollout history of a deployment
oc rollout history dc/nginx
# View the details of deployment revision 3
oc rollout history dc/nginx --revision=3
6.1.89. oc rollout latest Copiar o linkLink copiado para a área de transferência!
Start a new rollout for a deployment config with the latest state from its triggers
Example usage
# Start a new rollout based on the latest images defined in the image change triggers oc rollout latest dc/nginx # Print the rolled out deployment config oc rollout latest dc/nginx -o json
# Start a new rollout based on the latest images defined in the image change triggers
oc rollout latest dc/nginx
# Print the rolled out deployment config
oc rollout latest dc/nginx -o json
6.1.90. oc rollout pause Copiar o linkLink copiado para a área de transferência!
Mark the provided resource as paused
Example usage
# Mark the nginx deployment as paused. Any current state of # the deployment will continue its function, new updates to the deployment will not # have an effect as long as the deployment is paused oc rollout pause dc/nginx
# Mark the nginx deployment as paused. Any current state of
# the deployment will continue its function, new updates to the deployment will not
# have an effect as long as the deployment is paused
oc rollout pause dc/nginx
6.1.91. oc rollout restart Copiar o linkLink copiado para a área de transferência!
Restart a resource
Example usage
6.1.92. oc rollout resume Copiar o linkLink copiado para a área de transferência!
Resume a paused resource
Example usage
# Resume an already paused deployment oc rollout resume dc/nginx
# Resume an already paused deployment
oc rollout resume dc/nginx
6.1.93. oc rollout retry Copiar o linkLink copiado para a área de transferência!
Retry the latest failed rollout
Example usage
# Retry the latest failed deployment based on 'frontend' # The deployer pod and any hook pods are deleted for the latest failed deployment oc rollout retry dc/frontend
# Retry the latest failed deployment based on 'frontend'
# The deployer pod and any hook pods are deleted for the latest failed deployment
oc rollout retry dc/frontend
6.1.94. oc rollout status Copiar o linkLink copiado para a área de transferência!
Show the status of the rollout
Example usage
# Watch the status of the latest rollout oc rollout status dc/nginx
# Watch the status of the latest rollout
oc rollout status dc/nginx
6.1.95. oc rollout undo Copiar o linkLink copiado para a área de transferência!
Undo a previous rollout
Example usage
# Roll back to the previous deployment oc rollout undo dc/nginx # Roll back to deployment revision 3. The replication controller for that version must exist oc rollout undo dc/nginx --to-revision=3
# Roll back to the previous deployment
oc rollout undo dc/nginx
# Roll back to deployment revision 3. The replication controller for that version must exist
oc rollout undo dc/nginx --to-revision=3
6.1.96. oc rsh Copiar o linkLink copiado para a área de transferência!
Start a shell session in a container
Example usage
6.1.97. oc rsync Copiar o linkLink copiado para a área de transferência!
Copy files between a local file system and a pod
Example usage
# 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
# 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
6.1.98. oc run Copiar o linkLink copiado para a área de transferência!
Run a particular image on the cluster
Example usage
6.1.99. oc scale Copiar o linkLink copiado para a área de transferência!
Set a new size for a deployment, replica set, or replication controller
Example usage
6.1.100. oc secrets link Copiar o linkLink copiado para a área de transferência!
Link secrets to a service account
Example usage
# Add an image pull secret to a service account to automatically use it for pulling pod images oc secrets link serviceaccount-name pull-secret --for=pull # Add an image pull secret to a service account to automatically use it for both pulling and pushing build images oc secrets link builder builder-image-secret --for=pull,mount
# Add an image pull secret to a service account to automatically use it for pulling pod images
oc secrets link serviceaccount-name pull-secret --for=pull
# Add an image pull secret to a service account to automatically use it for both pulling and pushing build images
oc secrets link builder builder-image-secret --for=pull,mount
6.1.101. oc secrets unlink Copiar o linkLink copiado para a área de transferência!
Detach secrets from a service account
Example usage
# Unlink a secret currently associated with a service account oc secrets unlink serviceaccount-name secret-name another-secret-name ...
# Unlink a secret currently associated with a service account
oc secrets unlink serviceaccount-name secret-name another-secret-name ...
6.1.102. oc set data Copiar o linkLink copiado para a área de transferência!
Update the data within a config map or secret
Example usage
6.1.103. oc set env Copiar o linkLink copiado para a área de transferência!
Update environment variables on a pod template
Example usage
6.1.104. oc set image Copiar o linkLink copiado para a área de transferência!
Update the image of a pod template
Example usage
6.1.105. oc set image-lookup Copiar o linkLink copiado para a área de transferência!
Change how images are resolved when deploying applications
Example usage
6.1.106. oc set probe Copiar o linkLink copiado para a área de transferência!
Update a probe on a pod template
Example usage
6.1.107. oc set resources Copiar o linkLink copiado para a área de transferência!
Update resource requests/limits on objects with pod templates
Example usage
6.1.108. oc set route-backends Copiar o linkLink copiado para a área de transferência!
Update the backends for a route
Example usage
6.1.109. oc set selector Copiar o linkLink copiado para a área de transferência!
Set the selector on a resource
Example usage
# Set the labels and selector before creating a deployment/service pair. oc create service clusterip my-svc --clusterip="None" -o yaml --dry-run | oc set selector --local -f - 'environment=qa' -o yaml | oc create -f - oc create deployment my-dep -o yaml --dry-run | oc label --local -f - environment=qa -o yaml | oc create -f -
# Set the labels and selector before creating a deployment/service pair.
oc create service clusterip my-svc --clusterip="None" -o yaml --dry-run | oc set selector --local -f - 'environment=qa' -o yaml | oc create -f -
oc create deployment my-dep -o yaml --dry-run | oc label --local -f - environment=qa -o yaml | oc create -f -
6.1.110. oc set serviceaccount Copiar o linkLink copiado para a área de transferência!
Update the service account of a resource
Example usage
# Set deployment nginx-deployment's service account to serviceaccount1 oc set serviceaccount deployment nginx-deployment serviceaccount1 # Print the result (in YAML format) of updated nginx deployment with service account from a local file, without hitting the API server oc set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
# Set deployment nginx-deployment's service account to serviceaccount1
oc set serviceaccount deployment nginx-deployment serviceaccount1
# Print the result (in YAML format) of updated nginx deployment with service account from a local file, without hitting the API server
oc set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
6.1.111. oc set subject Copiar o linkLink copiado para a área de transferência!
Update the user, group, or service account in a role binding or cluster role binding
Example usage
6.1.112. oc set volumes Copiar o linkLink copiado para a área de transferência!
Update volumes on a pod template
Example usage
6.1.113. oc tag Copiar o linkLink copiado para a área de transferência!
Tag existing images into image streams
Example usage
6.1.114. oc version Copiar o linkLink copiado para a área de transferência!
Print the client and server version information
Example usage
6.1.115. oc wait Copiar o linkLink copiado para a área de transferência!
Experimental: Wait for a specific condition on one or many resources
Example usage
6.2. OpenShift CLI (oc) administrator commands Copiar o linkLink copiado para a área de transferência!
6.2.1. oc adm inspect Copiar o linkLink copiado para a área de transferência!
Collect debugging data for a given resource
Example usage
6.2.2. oc adm release extract Copiar o linkLink copiado para a área de transferência!
Extract the contents of an update payload to disk
Example usage
6.2.3. oc adm release info Copiar o linkLink copiado para a área de transferência!
Display information about a release
Example usage
6.2.4. oc adm taint Copiar o linkLink copiado para a área de transferência!
Update the taints on nodes
Example usage