2.7. OpenShift CLI 개발자 명령 참조
이 참조는 OpenShift CLI (oc
) developer 명령에 대한 설명 및 예제 명령을 제공합니다. 관리자 명령의 경우 OpenShift CLI 관리자 명령 참조 를 참조하십시오.
oc help
를 실행하여 모든 명령을 나열하거나 oc <command> --help
를 실행하여 특정 명령에 대한 추가 세부 정보를 가져옵니다.
2.7.1. OpenShift CLI (oc) 개발자 명령 링크 복사링크가 클립보드에 복사되었습니다!
2.7.1.1. oc annotate 링크 복사링크가 클립보드에 복사되었습니다!
리소스에서 주석을 업데이트
사용 예
2.7.1.2. oc api-resources 링크 복사링크가 클립보드에 복사되었습니다!
서버에서 지원되는 API 리소스를 인쇄
사용 예
2.7.1.3. oc api-versions 링크 복사링크가 클립보드에 복사되었습니다!
"group/version" 형식으로 서버에서 지원되는 API 버전을 인쇄
사용 예
Print the supported API versions
# Print the supported API versions
oc api-versions
2.7.1.4. oc apply 링크 복사링크가 클립보드에 복사되었습니다!
파일 이름 또는 stdin으로 리소스에 구성 적용
사용 예
2.7.1.5. oc apply edit-last-applied 링크 복사링크가 클립보드에 복사되었습니다!
리소스/오브젝트의 최신 last-applied-configuration 주석을 편집
사용 예
Edit the last-applied-configuration annotations by type/name in YAML
# 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
2.7.1.6. oc apply set-last-applied 링크 복사링크가 클립보드에 복사되었습니다!
파일의 내용과 일치하도록 라이브 오브젝트에 last-applied-configuration 주석을 설정
사용 예
2.7.1.7. oc apply view-last-applied 링크 복사링크가 클립보드에 복사되었습니다!
리소스/오브젝트의 최신 last-applied-configuration 주석을 표시
사용 예
View the last-applied-configuration annotations by type/name in YAML
# 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
2.7.1.8. oc attach 링크 복사링크가 클립보드에 복사되었습니다!
실행 중인 컨테이너에 연결
사용 예
2.7.1.9. oc auth can-i 링크 복사링크가 클립보드에 복사되었습니다!
작업이 허용되는지 확인
사용 예
2.7.1.10. oc auth reconcile 링크 복사링크가 클립보드에 복사되었습니다!
RBAC 역할, 역할 바인딩, 클러스터 역할 및 클러스터 역할 바인딩 오브젝트에 대한 규칙 조정
사용 예
Reconcile RBAC resources from a file
# Reconcile RBAC resources from a file
oc auth reconcile -f my-rbac-rules.yaml
2.7.1.11. oc auth whoami 링크 복사링크가 클립보드에 복사되었습니다!
실험: 자체 주제 속성 확인
사용 예
Get your subject attributes.
# Get your subject attributes.
oc auth whoami
# Get your subject attributes in JSON format.
oc auth whoami -o json
2.7.1.12. oc autoscale 링크 복사링크가 클립보드에 복사되었습니다!
배포 구성, 배포, 복제본 세트, 상태 저장 세트 또는 복제 컨트롤러를 자동 스케일링
사용 예
Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used
# Auto scale a deployment "foo", with the number of pods between 2 and 10, no target CPU utilization specified so a default autoscaling policy will be used
oc autoscale deployment foo --min=2 --max=10
# Auto scale a replication controller "foo", with the number of pods between 1 and 5, target CPU utilization at 80%
oc autoscale rc foo --max=5 --cpu-percent=80
2.7.1.13. oc cancel-build 링크 복사링크가 클립보드에 복사되었습니다!
실행 중이거나 보류 중인 빌드 또는 새 빌드를 취소
사용 예
2.7.1.14. oc cluster-info 링크 복사링크가 클립보드에 복사되었습니다!
클러스터 정보 표시
사용 예
Print the address of the control plane and cluster services
# Print the address of the control plane and cluster services
oc cluster-info
2.7.1.15. oc cluster-info dump 링크 복사링크가 클립보드에 복사되었습니다!
디버깅 및 진단을 위한 관련 정보 덤프
사용 예
2.7.1.16. oc completion 링크 복사링크가 클립보드에 복사되었습니다!
지정된 쉘에 대한 쉘 완료 코드 출력(bash, zsh, fish 또는 powershell)
사용 예
2.7.1.17. oc config current-context 링크 복사링크가 클립보드에 복사되었습니다!
current-context 표시
사용 예
Display the current-context
# Display the current-context
oc config current-context
2.7.1.18. oc config delete-cluster 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 지정된 클러스터를 삭제
사용 예
Delete the minikube cluster
# Delete the minikube cluster
oc config delete-cluster minikube
2.7.1.19. oc config delete-context 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 지정된 컨텍스트를 삭제
사용 예
Delete the context for the minikube cluster
# Delete the context for the minikube cluster
oc config delete-context minikube
2.7.1.20. oc config delete-user 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 지정된 사용자를 삭제
사용 예
Delete the minikube user
# Delete the minikube user
oc config delete-user minikube
2.7.1.21. oc config get-clusters 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에 정의된 클러스터를 표시
사용 예
List the clusters that oc knows about
# List the clusters that oc knows about
oc config get-clusters
2.7.1.22. oc config get-contexts 링크 복사링크가 클립보드에 복사되었습니다!
하나 또는 여러 컨텍스트를 설명
사용 예
List all the contexts in your kubeconfig file
# 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
2.7.1.23. oc config get-users 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에 정의된 사용자를 표시
사용 예
List the users that oc knows about
# List the users that oc knows about
oc config get-users
2.7.1.24. oc config new-admin-kubeconfig 링크 복사링크가 클립보드에 복사되었습니다!
서버를 생성하고, 신뢰하고, 새 admin.kubeconfig를 표시합니다.
사용 예
Generate a new admin kubeconfig
# Generate a new admin kubeconfig
oc config new-admin-kubeconfig
2.7.1.25. oc config new-kubelet-bootstrap-kubeconfig 링크 복사링크가 클립보드에 복사되었습니다!
서버를 생성하고, 신뢰하고, 새 kubelet /etc/kubernetes/kubeconfig를 표시합니다.
사용 예
Generate a new kubelet bootstrap kubeconfig
# Generate a new kubelet bootstrap kubeconfig
oc config new-kubelet-bootstrap-kubeconfig
2.7.1.26. oc config refresh-ca-bundle 링크 복사링크가 클립보드에 복사되었습니다!
apiserver에 연결하여 OpenShift CA 번들을 업데이트합니다.
사용 예
2.7.1.27. oc config rename-context 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig 파일에서 컨텍스트의 이름 변경
사용 예
Rename the context 'old-name' to 'new-name' in your kubeconfig file
# Rename the context 'old-name' to 'new-name' in your kubeconfig file
oc config rename-context old-name new-name
2.7.1.28. oc config set 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig 파일에서 개별 값 설정
사용 예
2.7.1.29. oc config set-cluster 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 클러스터 항목 설정
사용 예
2.7.1.30. oc config set-context 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 컨텍스트 항목 설정
사용 예
Set the user field on the gce context entry without touching other values
# Set the user field on the gce context entry without touching other values
oc config set-context gce --user=cluster-admin
2.7.1.31. oc config set-credentials 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig에서 사용자 항목 설정
사용 예
2.7.1.32. oc config unset 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig 파일에서 개별 값 설정 해제
사용 예
Unset the current-context
# Unset the current-context
oc config unset current-context
# Unset namespace in foo context
oc config unset contexts.foo.namespace
2.7.1.33. oc config use-context 링크 복사링크가 클립보드에 복사되었습니다!
kubeconfig 파일에서 current-context 설정
사용 예
Use the context for the minikube cluster
# Use the context for the minikube cluster
oc config use-context minikube
2.7.1.34. oc config view 링크 복사링크가 클립보드에 복사되었습니다!
병합된 kubeconfig 설정 또는 지정된 kubeconfig 파일을 표시
사용 예
2.7.1.35. oc cp 링크 복사링크가 클립보드에 복사되었습니다!
컨테이너 간에 파일 및 디렉터리를 복사
사용 예
2.7.1.36. oc create 링크 복사링크가 클립보드에 복사되었습니다!
파일 또는 stdin에서 리소스를 생성
사용 예
2.7.1.37. oc create build 링크 복사링크가 클립보드에 복사되었습니다!
새 빌드를 생성
사용 예
Create a new build
# Create a new build
oc create build myapp
2.7.1.38. oc create clusterresourcequota 링크 복사링크가 클립보드에 복사되었습니다!
클러스터 리소스 쿼터를 생성
사용 예
Create a cluster resource quota limited to 10 pods
# Create a cluster resource quota limited to 10 pods
oc create clusterresourcequota limit-bob --project-annotation-selector=openshift.io/requester=user-bob --hard=pods=10
2.7.1.39. oc create clusterrole 링크 복사링크가 클립보드에 복사되었습니다!
클러스터 역할 생성
사용 예
2.7.1.40. oc create clusterrolebinding 링크 복사링크가 클립보드에 복사되었습니다!
특정 클러스터 역할에 대한 클러스터 역할 바인딩 생성
사용 예
Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role
# 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
2.7.1.41. oc create configmap 링크 복사링크가 클립보드에 복사되었습니다!
로컬 파일, 디렉터리 또는 리터럴 값에서 구성 맵 생성
사용 예
2.7.1.42. oc create cronjob 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 cron 작업 생성
사용 예
Create a cron job
# 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
2.7.1.43. oc create deployment 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 배포 생성
사용 예
2.7.1.44. oc create deploymentconfig 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이미지를 사용하는 기본 옵션으로 배포 구성을 생성
사용 예
Create an nginx deployment config named my-nginx
# Create an nginx deployment config named my-nginx
oc create deploymentconfig my-nginx --image=nginx
2.7.1.45. oc create identity 링크 복사링크가 클립보드에 복사되었습니다!
수동으로 ID를 생성 (자동 생성이 비활성화된 경우에만 필요)
사용 예
Create an identity with identity provider "acme_ldap" and the identity provider username "adamjones"
# Create an identity with identity provider "acme_ldap" and the identity provider username "adamjones"
oc create identity acme_ldap:adamjones
2.7.1.46. oc create imagestream 링크 복사링크가 클립보드에 복사되었습니다!
비어 있는 새 이미지 스트림을 생성
사용 예
Create a new image stream
# Create a new image stream
oc create imagestream mysql
2.7.1.47. oc create imagestreamtag 링크 복사링크가 클립보드에 복사되었습니다!
새 이미지 스트림 태그를 생성
사용 예
Create a new image stream tag based on an image in a remote registry
# Create a new image stream tag based on an image in a remote registry
oc create imagestreamtag mysql:latest --from-image=myregistry.local/mysql/mysql:5.0
2.7.1.48. oc create ingress 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 수신 생성
사용 예
2.7.1.49. oc create job 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 작업 생성
사용 예
2.7.1.50. oc create namespace 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 네임 스페이스를 생성
사용 예
Create a new namespace named my-namespace
# Create a new namespace named my-namespace
oc create namespace my-namespace
2.7.1.51. oc create poddisruptionbudget 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 Pod 중단 예산 생성
사용 예
2.7.1.52. oc create priorityclass 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 우선순위 클래스 생성
사용 예
2.7.1.53. oc create quota 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 할당량 생성
사용 예
Create a new resource quota named my-quota
# 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
2.7.1.54. oc create role 링크 복사링크가 클립보드에 복사되었습니다!
단일 규칙을 사용하여 역할 생성
사용 예
2.7.1.55. oc create rolebinding 링크 복사링크가 클립보드에 복사되었습니다!
특정 역할 또는 클러스터 역할에 대한 역할 바인딩 생성
사용 예
Create a role binding for user1, user2, and group1 using the admin cluster role
# 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
2.7.1.56. oc create route edge 링크 복사링크가 클립보드에 복사되었습니다!
엣지 TLS 종료를 사용하는 경로를 생성
사용 예
2.7.1.57. oc create route passthrough 링크 복사링크가 클립보드에 복사되었습니다!
패스스루 TLS 종료를 사용하는 경로를 생성
사용 예
2.7.1.58. oc create route reencrypt 링크 복사링크가 클립보드에 복사되었습니다!
재암호화 TLS 종료를 사용하는 경로를 생성
사용 예
2.7.1.59. oc create secret docker-registry 링크 복사링크가 클립보드에 복사되었습니다!
Docker 레지스트리와 함께 사용할 시크릿을 생성
사용 예
If you do not already have a .dockercfg file, create a dockercfg secret directly
# If you do not already have a .dockercfg file, create a dockercfg secret directly
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
2.7.1.60. oc create secret generic 링크 복사링크가 클립보드에 복사되었습니다!
로컬 파일, 디렉터리 또는 리터럴 값에서 시크릿을 생성
사용 예
2.7.1.61. oc create secret tls 링크 복사링크가 클립보드에 복사되었습니다!
TLS 시크릿을 생성
사용 예
Create a new TLS secret named tls-secret with the given key pair
# 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
2.7.1.62. oc create service clusterip 링크 복사링크가 클립보드에 복사되었습니다!
ClusterIP 서비스 생성
사용 예
Create a new ClusterIP service named my-cs
# 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"
2.7.1.63. oc create service externalname 링크 복사링크가 클립보드에 복사되었습니다!
ExternalName 서비스 생성
사용 예
Create a new ExternalName service named my-ns
# Create a new ExternalName service named my-ns
oc create service externalname my-ns --external-name bar.com
2.7.1.64. oc create service loadbalancer 링크 복사링크가 클립보드에 복사되었습니다!
LoadBalancer 서비스 생성
사용 예
Create a new LoadBalancer service named my-lbs
# Create a new LoadBalancer service named my-lbs
oc create service loadbalancer my-lbs --tcp=5678:8080
2.7.1.65. oc create service nodeport 링크 복사링크가 클립보드에 복사되었습니다!
NodePort 서비스 생성
사용 예
Create a new NodePort service named my-ns
# Create a new NodePort service named my-ns
oc create service nodeport my-ns --tcp=5678:8080
2.7.1.66. oc create serviceaccount 링크 복사링크가 클립보드에 복사되었습니다!
지정된 이름으로 서비스 계정을 생성
사용 예
Create a new service account named my-service-account
# Create a new service account named my-service-account
oc create serviceaccount my-service-account
2.7.1.67. oc create token 링크 복사링크가 클립보드에 복사되었습니다!
서비스 계정 토큰 요청
사용 예
2.7.1.68. oc create user 링크 복사링크가 클립보드에 복사되었습니다!
사용자를 수동으로 생성 (자동 생성이 비활성화된 경우에만 필요)
사용 예
Create a user with the username "ajones" and the display name "Adam Jones"
# Create a user with the username "ajones" and the display name "Adam Jones"
oc create user ajones --full-name="Adam Jones"
2.7.1.69. oc create useridentitymapping 링크 복사링크가 클립보드에 복사되었습니다!
ID를 사용자에게 수동으로 매핑
사용 예
Map the identity "acme_ldap:adamjones" to the user "ajones"
# Map the identity "acme_ldap:adamjones" to the user "ajones"
oc create useridentitymapping acme_ldap:adamjones ajones
2.7.1.70. oc debug 링크 복사링크가 클립보드에 복사되었습니다!
디버깅을 위해 Pod의 새 인스턴스를 시작
사용 예
2.7.1.71. oc delete 링크 복사링크가 클립보드에 복사되었습니다!
파일 이름, stdin, 리소스 및 이름별 또는 리소스 및 라벨 선택기별 리소스 삭제
사용 예
2.7.1.72. oc describe 링크 복사링크가 클립보드에 복사되었습니다!
특정 리소스 또는 리소스 그룹의 세부 정보를 표시
사용 예
2.7.1.73. oc diff 링크 복사링크가 클립보드에 복사되었습니다!
적용될 버전에 대한 Diff 라이브 버전
사용 예
Diff resources included in pod.json
# Diff resources included in pod.json
oc diff -f pod.json
# Diff file read from stdin
cat service.yaml | oc diff -f -
2.7.1.74. oc edit 링크 복사링크가 클립보드에 복사되었습니다!
서버에서 리소스를 편집
사용 예
2.7.1.75. oc events 링크 복사링크가 클립보드에 복사되었습니다!
이벤트 나열
사용 예
2.7.1.76. oc exec 링크 복사링크가 클립보드에 복사되었습니다!
컨테이너에서 명령을 실행
사용 예
2.7.1.77. oc explain 링크 복사링크가 클립보드에 복사되었습니다!
리소스에 대한 문서 가져오기
사용 예
2.7.1.78. oc expose 링크 복사링크가 클립보드에 복사되었습니다!
복제된 애플리케이션을 서비스 또는 경로로 노출
사용 예
2.7.1.79. oc extract 링크 복사링크가 클립보드에 복사되었습니다!
시크릿 또는 구성 맵을 디스크에 추출
사용 예
2.7.1.80. oc get 링크 복사링크가 클립보드에 복사되었습니다!
리소스를 하나 이상 표시
사용 예
2.7.1.81. oc get-token 링크 복사링크가 클립보드에 복사되었습니다!
실험: credentials exec 플러그인으로 외부 OIDC 발행자에서 토큰 가져오기
사용 예
Starts an auth code flow to the issuer url with the client id and the given extra scopes
# Starts an auth code flow to the issuer url with the client id and the given extra scopes
oc get-token --client-id=client-id --issuer-url=test.issuer.url --extra-scopes=email,profile
# Starts an authe code flow to the issuer url with a different callback address.
oc get-token --client-id=client-id --issuer-url=test.issuer.url --callback-address=127.0.0.1:8343
2.7.1.82. oc idle 링크 복사링크가 클립보드에 복사되었습니다!
확장 가능한 리소스를 유휴 상태로 설정
사용 예
Idle the scalable controllers associated with the services listed in to-idle.txt
# Idle the scalable controllers associated with the services listed in to-idle.txt
$ oc idle --resource-names-file to-idle.txt
2.7.1.83. oc image append 링크 복사링크가 클립보드에 복사되었습니다!
이미지에 레이어를 추가하고 레지스트리에 푸시
사용 예
2.7.1.84. oc image extract 링크 복사링크가 클립보드에 복사되었습니다!
이미지에서 파일 시스템으로 파일을 복사
사용 예
2.7.1.85. oc image info 링크 복사링크가 클립보드에 복사되었습니다!
이미지에 대한 정보 표시
사용 예
2.7.1.86. oc image mirror 링크 복사링크가 클립보드에 복사되었습니다!
한 저장소에서 다른 저장소로 이미지를 미러링
사용 예
2.7.1.87. oc import-image 링크 복사링크가 클립보드에 복사되었습니다!
컨테이너 이미지 레지스트리에서 이미지를 가져옵니다
사용 예
2.7.1.88. oc kustomize 링크 복사링크가 클립보드에 복사되었습니다!
디렉터리 또는 URL에서 kustomization 대상을 빌드합니다.
사용 예
2.7.1.89. oc label 링크 복사링크가 클립보드에 복사되었습니다!
리소스에서 레이블을 업데이트
사용 예
2.7.1.90. oc login 링크 복사링크가 클립보드에 복사되었습니다!
서버에 로그인
사용 예
2.7.1.91. oc logout 링크 복사링크가 클립보드에 복사되었습니다!
현재 서버 세션을 종료
사용 예
Log out
# Log out
oc logout
2.7.1.92. oc logs 링크 복사링크가 클립보드에 복사되었습니다!
Pod에서 컨테이너의 로그를 출력
사용 예
2.7.1.93. oc new-app 링크 복사링크가 클립보드에 복사되었습니다!
새 애플리케이션을 생성
사용 예
2.7.1.94. oc new-build 링크 복사링크가 클립보드에 복사되었습니다!
새 빌드 구성을 생성
사용 예
2.7.1.95. oc new-project 링크 복사링크가 클립보드에 복사되었습니다!
새 프로젝트를 요청
사용 예
Create a new project with minimal information
# 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."
2.7.1.96. oc observe 링크 복사링크가 클립보드에 복사되었습니다!
리소스에 대한 변경 사항을 관찰하고 이에 대응합니다(시험적)
사용 예
2.7.1.97. oc patch 링크 복사링크가 클립보드에 복사되었습니다!
리소스 필드를 업데이트
사용 예
2.7.1.98. oc plugin list 링크 복사링크가 클립보드에 복사되었습니다!
사용자의 PATH에 표시되는 모든 플러그인 실행 파일 나열
사용 예
List all available plugins
# List all available plugins
oc plugin list
2.7.1.99. oc policy add-role-to-user 링크 복사링크가 클립보드에 복사되었습니다!
현재 프로젝트의 사용자 또는 서비스 계정에 역할을 추가
사용 예
Add the 'view' role to user1 for the current project
# 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
2.7.1.100. oc policy scc-review 링크 복사링크가 클립보드에 복사되었습니다!
Pod를 생성할 수 있는 서비스 계정을 확인
사용 예
2.7.1.101. oc policy scc-subject-review 링크 복사링크가 클립보드에 복사되었습니다!
사용자 또는 서비스 계정의 Pod 생성 가능 여부 확인
사용 예
2.7.1.102. oc port-forward 링크 복사링크가 클립보드에 복사되었습니다!
Pod에 하나 이상의 로컬 포트를 전달
사용 예
2.7.1.103. oc process 링크 복사링크가 클립보드에 복사되었습니다!
템플릿을 리소스 목록으로 처리
사용 예
2.7.1.104. oc project 링크 복사링크가 클립보드에 복사되었습니다!
다른 프로젝트로 전환
사용 예
Switch to the 'myapp' project
# Switch to the 'myapp' project
oc project myapp
# Display the project currently in use
oc project
2.7.1.105. oc projects 링크 복사링크가 클립보드에 복사되었습니다!
기존 프로젝트를 표시
사용 예
List all projects
# List all projects
oc projects
2.7.1.106. oc proxy 링크 복사링크가 클립보드에 복사되었습니다!
Kubernetes API 서버에 대해 프록시를 실행
사용 예
2.7.1.107. oc registry login 링크 복사링크가 클립보드에 복사되었습니다!
통합 레지스트리에 로그인
사용 예
Log in to the integrated registry
# Log in to the integrated registry
oc registry login
# Log in to different registry using BASIC auth credentials
oc registry login --registry quay.io/myregistry --auth-basic=USER:PASS
2.7.1.108. oc replace 링크 복사링크가 클립보드에 복사되었습니다!
리소스를 파일 이름 또는 stdin으로 교체
사용 예
2.7.1.109. oc rollback 링크 복사링크가 클립보드에 복사되었습니다!
애플리케이션의 일부를 이전 배포로 되돌립니다
사용 예
2.7.1.110. oc rollout cancel 링크 복사링크가 클립보드에 복사되었습니다!
진행 중인 배포를 취소
사용 예
Cancel the in-progress deployment based on 'nginx'
# Cancel the in-progress deployment based on 'nginx'
oc rollout cancel dc/nginx
2.7.1.111. oc rollout history 링크 복사링크가 클립보드에 복사되었습니다!
롤아웃 내역 보기
사용 예
View the rollout history of a deployment
# 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
2.7.1.112. oc rollout latest 링크 복사링크가 클립보드에 복사되었습니다!
트리거의 최신 상태로 배포 구성에 대한 새 롤아웃 시작
사용 예
Start a new rollout based on the latest images defined in the image change triggers
# 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
2.7.1.113. oc rollout pause 링크 복사링크가 클립보드에 복사되었습니다!
제공된 리소스를 일시 중지됨으로 표시
사용 예
Mark the nginx deployment as paused. Any current state of
# 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
2.7.1.114. oc rollout restart 링크 복사링크가 클립보드에 복사되었습니다!
리소스를 다시 시작
사용 예
2.7.1.115. oc rollout resume 링크 복사링크가 클립보드에 복사되었습니다!
일시 중지된 리소스 재개
사용 예
Resume an already paused deployment
# Resume an already paused deployment
oc rollout resume dc/nginx
2.7.1.116. oc rollout retry 링크 복사링크가 클립보드에 복사되었습니다!
가장 최근에 실패한 롤아웃 재시도
사용 예
Retry the latest failed deployment based on '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
2.7.1.117. oc rollout status 링크 복사링크가 클립보드에 복사되었습니다!
롤아웃 상태를 표시
사용 예
Watch the status of the latest rollout
# Watch the status of the latest rollout
oc rollout status dc/nginx
2.7.1.118. oc rollout undo 링크 복사링크가 클립보드에 복사되었습니다!
이전 롤아웃 실행 취소
사용 예
Roll back to the previous deployment
# 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
2.7.1.119. oc rsh 링크 복사링크가 클립보드에 복사되었습니다!
컨테이너에서 쉘 세션 시작
사용 예
2.7.1.120. oc rsync 링크 복사링크가 클립보드에 복사되었습니다!
로컬 파일 시스템과 Pod 간 파일 복사
사용 예
Synchronize a local directory with a pod directory
# 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
2.7.1.121. oc run 링크 복사링크가 클립보드에 복사되었습니다!
클러스터에서 특정 이미지 실행
사용 예
2.7.1.122. oc scale 링크 복사링크가 클립보드에 복사되었습니다!
배포, 복제본 세트 또는 복제 컨트롤러의 새 크기 설정
사용 예
2.7.1.123. oc secrets link 링크 복사링크가 클립보드에 복사되었습니다!
서비스 계정에 시크릿 연결
사용 예
Add an image pull secret to a service account to automatically use it for pulling pod images
# 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
2.7.1.124. oc secrets unlink 링크 복사링크가 클립보드에 복사되었습니다!
서비스 계정에서 시크릿 분리
사용 예
Unlink a secret currently associated with a service account
# Unlink a secret currently associated with a service account
oc secrets unlink serviceaccount-name secret-name another-secret-name ...
2.7.1.125. oc set build-hook 링크 복사링크가 클립보드에 복사되었습니다!
빌드 구성에서 빌드 후크를 업데이트
사용 예
2.7.1.126. oc set build-secret 링크 복사링크가 클립보드에 복사되었습니다!
빌드 구성에서 빌드 보안을 업데이트
사용 예
2.7.1.127. oc set data 링크 복사링크가 클립보드에 복사되었습니다!
구성 맵 또는 시크릿 내의 데이터를 업데이트
사용 예
2.7.1.128. oc set deployment-hook 링크 복사링크가 클립보드에 복사되었습니다!
배포 구성에서 배포 후크를 업데이트
사용 예
2.7.1.129. oc set env 링크 복사링크가 클립보드에 복사되었습니다!
Pod 템플릿에서 환경 변수를 업데이트
사용 예
2.7.1.130. oc set image 링크 복사링크가 클립보드에 복사되었습니다!
Pod 템플릿 이미지 업데이트
사용 예
2.7.1.131. oc set image-lookup 링크 복사링크가 클립보드에 복사되었습니다!
애플리케이션을 배포할 때 이미지가 해결되는 방법 변경
사용 예
2.7.1.132. oc set probe 링크 복사링크가 클립보드에 복사되었습니다!
Pod 템플릿에서 프로브 업데이트
사용 예
2.7.1.133. oc set resources 링크 복사링크가 클립보드에 복사되었습니다!
Pod 템플릿을 사용하여 오브젝트에서 리소스 요청/제한 업데이트
사용 예
2.7.1.134. oc set route-backends 링크 복사링크가 클립보드에 복사되었습니다!
경로의 백엔드 업데이트
사용 예
2.7.1.135. oc set selector 링크 복사링크가 클립보드에 복사되었습니다!
리소스에 선택기 설정
사용 예
Set the labels and selector before creating a deployment/service pair.
# 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 -
2.7.1.136. oc set serviceaccount 링크 복사링크가 클립보드에 복사되었습니다!
리소스의 서비스 계정을 업데이트
사용 예
Set deployment nginx-deployment's service account to serviceaccount1
# 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
2.7.1.137. oc set subject 링크 복사링크가 클립보드에 복사되었습니다!
역할 바인딩 또는 클러스터 역할 바인딩에서 사용자, 그룹 또는 서비스 계정을 업데이트
사용 예
2.7.1.138. oc set triggers 링크 복사링크가 클립보드에 복사되었습니다!
하나 이상의 오브젝트에서 트리거 업데이트
사용 예
2.7.1.139. oc set volumes 링크 복사링크가 클립보드에 복사되었습니다!
Pod 템플릿에서 볼륨 업데이트
사용 예
2.7.1.140. oc start-build 링크 복사링크가 클립보드에 복사되었습니다!
새 빌드를 시작
사용 예
2.7.1.141. oc status 링크 복사링크가 클립보드에 복사되었습니다!
현재 프로젝트의 개요를 표시
사용 예
2.7.1.142. oc tag 링크 복사링크가 클립보드에 복사되었습니다!
기존 이미지를 이미지 스트림에 태깅
사용 예
2.7.1.143. oc version 링크 복사링크가 클립보드에 복사되었습니다!
클라이언트 및 서버 버전 정보를 인쇄
사용 예
2.7.1.144. oc wait 링크 복사링크가 클립보드에 복사되었습니다!
실험적: 하나 이상의 리소스에서 특정 조건을 대기합니다.
사용 예
2.7.1.145. oc whoami 링크 복사링크가 클립보드에 복사되었습니다!
현재 세션에 대한 정보를 반환
사용 예
Display the currently authenticated user
# Display the currently authenticated user
oc whoami