2.7. OpenShift CLI 관리자 명령 참조
이 참조는 OpenShift CLI (oc
) 관리자 명령에 대한 설명 및 예제 명령을 제공합니다. 이러한 명령을 사용하려면 cluster-admin
또는 동등한 권한이 있어야 합니다.
개발자 명령에 대해서는 OpenShift CLI 개발자 명령 참조를 확인하세요.
oc adm -h
를 실행하여 모든 관리자 명령을 나열하거나 oc <command> --help
를 실행하여 특정 명령에 대한 추가 세부 정보를 가져옵니다.
2.7.1. OpenShift CLI (oc) 관리자 명령 링크 복사링크가 클립보드에 복사되었습니다!
2.7.1.1. oc adm build-chain 링크 복사링크가 클립보드에 복사되었습니다!
빌드의 입력 및 종속 항목을 출력
사용 예
2.7.1.2. oc adm catalog mirror 링크 복사링크가 클립보드에 복사되었습니다!
operator-registry 카탈로그 미러링
사용 예
2.7.1.3. oc adm certificate approve 링크 복사링크가 클립보드에 복사되었습니다!
인증서 서명 요청 승인
사용 예
Approve CSR 'csr-sqgzp'
# Approve CSR 'csr-sqgzp'
oc adm certificate approve csr-sqgzp
2.7.1.4. oc adm certificate deny 링크 복사링크가 클립보드에 복사되었습니다!
인증서 서명 요청 거부
사용 예
Deny CSR 'csr-sqgzp'
# Deny CSR 'csr-sqgzp'
oc adm certificate deny csr-sqgzp
2.7.1.5. oc adm 노드로 복사 링크 복사링크가 클립보드에 복사되었습니다!
지정된 파일을 노드에 복사합니다.
사용 예
Copy a new bootstrap kubeconfig file to node-0
# Copy a new bootstrap kubeconfig file to node-0
oc adm copy-to-node --copy=new-bootstrap-kubeconfig=/etc/kubernetes/kubeconfig node/node-0
2.7.1.6. oc adm cordon 링크 복사링크가 클립보드에 복사되었습니다!
노드를 예약 불가로 표시
사용 예
Mark node "foo" as unschedulable
# Mark node "foo" as unschedulable
oc adm cordon foo
2.7.1.7. oc adm create-bootstrap-project-template 링크 복사링크가 클립보드에 복사되었습니다!
부트스트랩 프로젝트 템플릿을 생성
사용 예
Output a bootstrap project template in YAML format to stdout
# Output a bootstrap project template in YAML format to stdout
oc adm create-bootstrap-project-template -o yaml
2.7.1.8. oc adm create-error-template 링크 복사링크가 클립보드에 복사되었습니다!
오류 페이지 템플릿 생성
사용 예
Output a template for the error page to stdout
# Output a template for the error page to stdout
oc adm create-error-template
2.7.1.9. oc adm create-login-template 링크 복사링크가 클립보드에 복사되었습니다!
로그인 템플릿 생성
사용 예
Output a template for the login page to stdout
# Output a template for the login page to stdout
oc adm create-login-template
2.7.1.10. oc adm create-provider-selection-template 링크 복사링크가 클립보드에 복사되었습니다!
공급자 선택 템플릿 생성
사용 예
Output a template for the provider selection page to stdout
# Output a template for the provider selection page to stdout
oc adm create-provider-selection-template
2.7.1.11. oc adm drain 링크 복사링크가 클립보드에 복사되었습니다!
유지 관리를 위해 노드를 드레이닝
사용 예
Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it
# Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set on it
oc adm drain foo --force
# As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set, or stateful set, and use a grace period of 15 minutes
oc adm drain foo --grace-period=900
2.7.1.12. oc adm groups add-users 링크 복사링크가 클립보드에 복사되었습니다!
그룹에 사용자 추가
사용 예
Add user1 and user2 to my-group
# Add user1 and user2 to my-group
oc adm groups add-users my-group user1 user2
2.7.1.13. oc adm groups new 링크 복사링크가 클립보드에 복사되었습니다!
새 그룹 생성
사용 예
2.7.1.14. oc adm groups prune 링크 복사링크가 클립보드에 복사되었습니다!
외부 공급자에서 누락된 레코드를 참조하는 이전 OpenShift 그룹 제거
사용 예
2.7.1.15. oc adm groups remove-users 링크 복사링크가 클립보드에 복사되었습니다!
그룹에서 사용자 제거
사용 예
Remove user1 and user2 from my-group
# Remove user1 and user2 from my-group
oc adm groups remove-users my-group user1 user2
2.7.1.16. oc adm groups sync 링크 복사링크가 클립보드에 복사되었습니다!
외부 공급자에서 레코드와 OpenShift 그룹 동기화
사용 예
2.7.1.17. oc adm inspect 링크 복사링크가 클립보드에 복사되었습니다!
지정된 리소스에 대한 디버깅 데이터 수집
사용 예
2.7.1.18. oc adm migrate icsp 링크 복사링크가 클립보드에 복사되었습니다!
imagecontentsourcepolicy 파일을 imagedigestmirrorset 파일로 업데이트합니다.
사용 예
Update the imagecontentsourcepolicy.yaml file to a new imagedigestmirrorset file under the mydir directory
# Update the imagecontentsourcepolicy.yaml file to a new imagedigestmirrorset file under the mydir directory
oc adm migrate icsp imagecontentsourcepolicy.yaml --dest-dir mydir
2.7.1.19. oc adm migrate template-instances 링크 복사링크가 클립보드에 복사되었습니다!
최신 group-version-kinds를 가리키도록 템플릿 인스턴스를 업데이트
사용 예
Perform a dry-run of updating all objects
# Perform a dry-run of updating all objects
oc adm migrate template-instances
# To actually perform the update, the confirm flag must be appended
oc adm migrate template-instances --confirm
2.7.1.20. oc adm must-gather 링크 복사링크가 클립보드에 복사되었습니다!
디버그 정보 수집을 위해 Pod의 새 인스턴스를 시작
사용 예
2.7.1.21. oc adm new-project 링크 복사링크가 클립보드에 복사되었습니다!
새 프로젝트 생성
사용 예
Create a new project using a node selector
# Create a new project using a node selector
oc adm new-project myproject --node-selector='type=user-node,region=east'
2.7.1.22. oc adm 노드 이미지 생성 링크 복사링크가 클립보드에 복사되었습니다!
대상 클러스터에 추가할 노드를 부팅하기 위한 ISO 이미지를 만듭니다.
사용 예
2.7.1.23. oc adm 노드 이미지 모니터 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에 추가되는 새 노드 모니터링
사용 예
2.7.1.24. oc adm node-logs 링크 복사링크가 클립보드에 복사되었습니다!
노드 로그를 표시하고 필터링
사용 예
2.7.1.25. oc adm ocp-인증서 모니터-인증서 링크 복사링크가 클립보드에 복사되었습니다!
시계 플랫폼 인증서
사용 예
Watch platform certificates
# Watch platform certificates
oc adm ocp-certificates monitor-certificates
2.7.1.26. oc adm ocp-certificates regenerate-leaf 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터의 클라이언트 및 서비스 인증서 재생성
사용 예
Regenerate a leaf certificate contained in a particular secret
# Regenerate a leaf certificate contained in a particular secret
oc adm ocp-certificates regenerate-leaf -n openshift-config-managed secret/kube-controller-manager-client-cert-key
2.7.1.27. oc adm ocp-인증서 재생성-머신-구성-서버-제공-인증서 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에서 머신 구성 운영자 인증서를 다시 생성합니다.
사용 예
Regenerate the MCO certs without modifying user-data secrets
# Regenerate the MCO certs without modifying user-data secrets
oc adm ocp-certificates regenerate-machine-config-server-serving-cert --update-ignition=false
# Update the user-data secrets to use new MCS certs
oc adm ocp-certificates update-ignition-ca-bundle-for-machine-config-server
2.7.1.28. oc adm ocp-인증서 재생성-최상위 수준 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에서 최상위 인증서 재생성
사용 예
Regenerate the signing certificate contained in a particular secret
# Regenerate the signing certificate contained in a particular secret
oc adm ocp-certificates regenerate-top-level -n openshift-kube-apiserver-operator secret/loadbalancer-serving-signer-key
2.7.1.29. oc adm ocp-certificates remove-old-trust 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터의 플랫폼 신뢰 번들을 나타내는 ConfigMaps에서 이전 CA 제거
사용 예
Remove a trust bundled contained in a particular config map
# Remove a trust bundled contained in a particular config map
oc adm ocp-certificates remove-old-trust -n openshift-config-managed configmaps/kube-apiserver-aggregator-client-ca --created-before 2023-06-05T14:44:06Z
# Remove only CA certificates created before a certain date from all trust bundles
oc adm ocp-certificates remove-old-trust configmaps -A --all --created-before 2023-06-05T14:44:06Z
2.7.1.30. oc adm ocp-certificates update-ignition-ca-bundle-for-machine-config-server 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에서 사용자 데이터 비밀을 업데이트하여 업데이트된 MCO 인증서 파일을 사용합니다.
사용 예
Regenerate the MCO certs without modifying user-data secrets
# Regenerate the MCO certs without modifying user-data secrets
oc adm ocp-certificates regenerate-machine-config-server-serving-cert --update-ignition=false
# Update the user-data secrets to use new MCS certs
oc adm ocp-certificates update-ignition-ca-bundle-for-machine-config-server
2.7.1.31. oc adm 정책에 클러스터 역할 추가 링크 복사링크가 클립보드에 복사되었습니다!
클러스터의 모든 프로젝트에 대한 그룹에 역할을 추가합니다.
사용 예
Add the 'cluster-admin' cluster role to the 'cluster-admins' group
# Add the 'cluster-admin' cluster role to the 'cluster-admins' group
oc adm policy add-cluster-role-to-group cluster-admin cluster-admins
2.7.1.32. oc adm 정책 add-cluster-role-to-user 링크 복사링크가 클립보드에 복사되었습니다!
클러스터의 모든 프로젝트에 대한 사용자에게 역할을 추가합니다.
사용 예
Add the 'system:build-strategy-docker' cluster role to the 'devuser' user
# Add the 'system:build-strategy-docker' cluster role to the 'devuser' user
oc adm policy add-cluster-role-to-user system:build-strategy-docker devuser
2.7.1.33. oc adm 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 adm policy add-role-to-user view user1
# Add the 'edit' role to serviceaccount1 for the current project
oc adm policy add-role-to-user edit -z serviceaccount1
2.7.1.34. oc adm policy add-scc-to-group 링크 복사링크가 클립보드에 복사되었습니다!
그룹에 보안 컨텍스트 제한 조건 추가
사용 예
Add the 'restricted' security context constraint to group1 and group2
# Add the 'restricted' security context constraint to group1 and group2
oc adm policy add-scc-to-group restricted group1 group2
2.7.1.35. oc adm policy add-scc-to-user 링크 복사링크가 클립보드에 복사되었습니다!
사용자 또는 서비스 계정에 보안 컨텍스트 제약 조건 추가
사용 예
Add the 'restricted' security context constraint to user1 and user2
# Add the 'restricted' security context constraint to user1 and user2
oc adm policy add-scc-to-user restricted user1 user2
# Add the 'privileged' security context constraint to serviceaccount1 in the current namespace
oc adm policy add-scc-to-user privileged -z serviceaccount1
2.7.1.36. oc adm 정책에서 그룹에서 클러스터 역할 제거 링크 복사링크가 클립보드에 복사되었습니다!
클러스터의 모든 프로젝트에 대한 그룹에서 역할을 제거합니다.
사용 예
Remove the 'cluster-admin' cluster role from the 'cluster-admins' group
# Remove the 'cluster-admin' cluster role from the 'cluster-admins' group
oc adm policy remove-cluster-role-from-group cluster-admin cluster-admins
2.7.1.37. oc adm 정책에서 사용자로부터 클러스터 역할 제거 링크 복사링크가 클립보드에 복사되었습니다!
클러스터의 모든 프로젝트에 대한 사용자 역할 제거
사용 예
Remove the 'system:build-strategy-docker' cluster role from the 'devuser' user
# Remove the 'system:build-strategy-docker' cluster role from the 'devuser' user
oc adm policy remove-cluster-role-from-user system:build-strategy-docker devuser
2.7.1.38. oc adm policy scc-review 링크 복사링크가 클립보드에 복사되었습니다!
Pod를 생성할 수 있는 서비스 계정을 확인
사용 예
2.7.1.39. oc adm policy scc-subject-review 링크 복사링크가 클립보드에 복사되었습니다!
사용자 또는 서비스 계정의 Pod 생성 가능 여부 확인
사용 예
2.7.1.40. oc adm prune 빌드 링크 복사링크가 클립보드에 복사되었습니다!
이전 빌드 및 실패한 빌드 삭제
사용 예
2.7.1.41. oc adm prune deployment 링크 복사링크가 클립보드에 복사되었습니다!
이전 완료 및 실패한 배포 구성 제거
사용 예
Dry run deleting all but the last complete deployment for every deployment config
# Dry run deleting all but the last complete deployment for every deployment config
oc adm prune deployments --keep-complete=1
# To actually perform the prune operation, the confirm flag must be appended
oc adm prune deployments --keep-complete=1 --confirm
2.7.1.42. oc adm prune groups 링크 복사링크가 클립보드에 복사되었습니다!
외부 공급자에서 누락된 레코드를 참조하는 이전 OpenShift 그룹 제거
사용 예
2.7.1.43. oc adm prune images 링크 복사링크가 클립보드에 복사되었습니다!
권장되지 않은 이미지 제거
사용 예
2.7.1.44. oc adm prune renderedmachineconfigs 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에서 렌더링된 MachineConfigs 정리
사용 예
2.7.1.45. oc adm prune renderedmachineconfigs 목록 링크 복사링크가 클립보드에 복사되었습니다!
OpenShift 클러스터에서 렌더링된 MachineConfig 나열
사용 예
List all rendered MachineConfigs for the worker MachineConfigPool in the cluster
# List all rendered MachineConfigs for the worker MachineConfigPool in the cluster
oc adm prune renderedmachineconfigs list --pool-name=worker
# List all rendered MachineConfigs in use by the cluster's MachineConfigPools
oc adm prune renderedmachineconfigs list --in-use
2.7.1.46. oc adm reboot-machine-config-pool 링크 복사링크가 클립보드에 복사되었습니다!
지정된 MachineConfigPool의 재부팅을 시작합니다.
사용 예
2.7.1.47. oc adm release extract 링크 복사링크가 클립보드에 복사되었습니다!
업데이트 페이로드 내용을 디스크에 추출
사용 예
2.7.1.48. oc adm release info 링크 복사링크가 클립보드에 복사되었습니다!
릴리스에 대한 정보 표시
사용 예
2.7.1.49. oc adm release mirror 링크 복사링크가 클립보드에 복사되었습니다!
다른 이미지 레지스트리 위치에 릴리스 미러링
사용 예
2.7.1.50. oc adm release new 링크 복사링크가 클립보드에 복사되었습니다!
새 OpenShift 릴리스 생성
사용 예
2.7.1.51. oc adm restart-kubelet 링크 복사링크가 클립보드에 복사되었습니다!
지정된 노드에서 kubelet을 다시 시작합니다.
사용 예
2.7.1.52. oc adm taint 링크 복사링크가 클립보드에 복사되었습니다!
하나 이상의 노드에서 테인트를 업데이트
사용 예
2.7.1.53. oc adm top images 링크 복사링크가 클립보드에 복사되었습니다!
이미지에 대한 사용량 통계 표시
사용 예
Show usage statistics for images
# Show usage statistics for images
oc adm top images
2.7.1.54. oc adm top imagestreams 링크 복사링크가 클립보드에 복사되었습니다!
이미지 스트림에 대한 사용량 통계 표시
사용 예
Show usage statistics for image streams
# Show usage statistics for image streams
oc adm top imagestreams
2.7.1.55. oc adm top node 링크 복사링크가 클립보드에 복사되었습니다!
노드의 리소스 (CPU/memory) 사용 표시
사용 예
Show metrics for all nodes
# Show metrics for all nodes
oc adm top node
# Show metrics for a given node
oc adm top node NODE_NAME
2.7.1.56. oc adm top persistentvolumeclaims 링크 복사링크가 클립보드에 복사되었습니다!
실험적: 바인딩된 persistentvolumeclaims에 대한 사용 통계 표시
사용 예
2.7.1.57. oc adm top pod 링크 복사링크가 클립보드에 복사되었습니다!
Pod의 리소스(CPU/메모리) 사용 표시
사용 예
2.7.1.58. oc adm uncordon 링크 복사링크가 클립보드에 복사되었습니다!
노드를 예약 가능으로 표시
사용 예
Mark node "foo" as schedulable
# Mark node "foo" as schedulable
oc adm uncordon foo
2.7.1.59. oc adm upgrade 링크 복사링크가 클립보드에 복사되었습니다!
클러스터 업그레이드 또는 업그레이드 채널 조정
사용 예
View the update status and available cluster updates
# View the update status and available cluster updates
oc adm upgrade
# Update to the latest version
oc adm upgrade --to-latest=true
2.7.1.60. oc adm verify-image-signature 링크 복사링크가 클립보드에 복사되었습니다!
이미지 서명에 포함된 이미지 ID 확인
사용 예
2.7.1.61. oc adm wait-for-node-reboot 링크 복사링크가 클립보드에 복사되었습니다!
oc adm reboot-machine-config-pool을
실행한 후 노드가 재부팅될 때까지 기다리세요.
사용 예
2.7.1.62. oc adm wait-for-stable-cluster 링크 복사링크가 클립보드에 복사되었습니다!
플랫폼 사업자들이 안정될 때까지 기다려라
사용 예
Wait for all cluster operators to become stable
# Wait for all cluster operators to become stable
oc adm wait-for-stable-cluster
# Consider operators to be stable if they report as such for 5 minutes straight
oc adm wait-for-stable-cluster --minimum-stable-period 5m