This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.2.6. OpenShift CLI 管理者コマンドリファレンス
このリファレンスは、OpenShift CLI (oc
) 管理者コマンドの説明およびコマンド例を示しています。これらのコマンドを使用するには、cluster-admin
または同等のパーミッションが必要です。
開発者コマンドは、OpenShift CLI 開発者コマンドリファレンス を参照してください。
oc adm -h
を実行して、すべての管理者コマンドを表示するか、または oc <command> --help
を実行して、特定のコマンドに関する追加情報を取得します。
2.6.1. OpenShift CLI (oc) 管理者コマンド リンクのコピーリンクがクリップボードにコピーされました!
2.6.1.1. oc adm build-chain リンクのコピーリンクがクリップボードにコピーされました!
ビルドの入力と依存関係を出力します。
使用例
2.6.1.2. oc adm catalog mirror リンクのコピーリンクがクリップボードにコピーされました!
operator-registry カタログをミラーリングします。
使用例
2.6.1.3. oc adm certificate approval リンクのコピーリンクがクリップボードにコピーされました!
証明書署名リクエストを承認します。
使用例
Approve CSR 'csr-sqgzp'
# Approve CSR 'csr-sqgzp'
oc adm certificate approve csr-sqgzp
2.6.1.4. oc adm certificate deny リンクのコピーリンクがクリップボードにコピーされました!
証明書署名リクエストを拒否します。
使用例
Deny CSR 'csr-sqgzp'
# Deny CSR 'csr-sqgzp'
oc adm certificate deny csr-sqgzp
2.6.1.5. oc adm completion リンクのコピーリンクがクリップボードにコピーされました!
指定されたシェル (bash または zsh) の補完コードを出力します。
使用例
2.6.1.6. oc adm config current-context リンクのコピーリンクがクリップボードにコピーされました!
current-context を表示します。
使用例
Display the current-context
# Display the current-context
oc config current-context
2.6.1.7. oc adm config delete-cluster リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig から指定されたクラスターを削除します。
使用例
Delete the minikube cluster
# Delete the minikube cluster
oc config delete-cluster minikube
2.6.1.8. oc adm config delete-context リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig から指定されたコンテキストを削除します。
使用例
Delete the context for the minikube cluster
# Delete the context for the minikube cluster
oc config delete-context minikube
2.6.1.9. oc adm config delete-user リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig から指定されたユーザーを削除します。
使用例
Delete the minikube user
# Delete the minikube user
oc config delete-user minikube
2.6.1.10. oc adm config get-clusters リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig に定義されるクラスターを表示します。
使用例
List the clusters that oc knows about
# List the clusters that oc knows about
oc config get-clusters
2.6.1.11. oc adm config get-contexts リンクのコピーリンクがクリップボードにコピーされました!
コンテキストを 1 つまたは複数記述します。
使用例
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.6.1.12. oc adm config get-users リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig で定義されるユーザーを表示します。
使用例
List the users that oc knows about
# List the users that oc knows about
oc config get-users
2.6.1.13. oc adm 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.6.1.14. oc adm config set リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig ファイルに個別の値を設定します。
使用例
2.6.1.15. oc adm config set-cluster リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig でクラスターエントリーを設定します。
使用例
2.6.1.16. oc adm 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.6.1.17. oc adm config set-credentials リンクのコピーリンクがクリップボードにコピーされました!
kubeconfig のユーザーエントリーを設定します。
使用例
2.6.1.18. oc adm 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.6.1.19. oc adm 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.6.1.20. oc adm config view リンクのコピーリンクがクリップボードにコピーされました!
マージされた kubeconfig 設定または指定された kubeconfig ファイルを表示します。
使用例
2.6.1.21. oc adm cordon リンクのコピーリンクがクリップボードにコピーされました!
ノードにスケジュール対象外 (unschedulable) のマークを付けます。
使用例
Mark node "foo" as unschedulable
# Mark node "foo" as unschedulable
oc adm cordon foo
2.6.1.22. 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.6.1.23. 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.6.1.24. 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.6.1.25. 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.6.1.26. 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.6.1.27. 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.6.1.28. oc adm groups new リンクのコピーリンクがクリップボードにコピーされました!
新規グループを作成します。
使用例
2.6.1.29. oc adm groups prune リンクのコピーリンクがクリップボードにコピーされました!
外部プロバイダーから欠落しているレコードを参照する以前の OpenShift グループを削除します。
使用例
2.6.1.30. 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.6.1.31. oc adm groups sync リンクのコピーリンクがクリップボードにコピーされました!
OpenShift グループと外部プロバイダーからのレコードを同期します。
使用例
2.6.1.32. oc adm inspect リンクのコピーリンクがクリップボードにコピーされました!
指定のリソースのデバッグデータを収集します。
使用例
2.6.1.33. 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.6.1.34. oc adm must-gather リンクのコピーリンクがクリップボードにコピーされました!
Pod の新規インスタンスを起動してデバッグ情報を収集します。
使用例
2.6.1.35. 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.6.1.36. oc adm node-logs リンクのコピーリンクがクリップボードにコピーされました!
ノードのログを表示し、フィルターします。
使用例
2.6.1.37. oc adm pod-network isolate-projects リンクのコピーリンクがクリップボードにコピーされました!
プロジェクトネットワークを分離します。
使用例
Provide isolation for project p1
# Provide isolation for project p1
oc adm pod-network isolate-projects <p1>
# Allow all projects with label name=top-secret to have their own isolated project network
oc adm pod-network isolate-projects --selector='name=top-secret'
2.6.1.38. oc adm pod-network join-projects リンクのコピーリンクがクリップボードにコピーされました!
プロジェクトネットワークに参加します。
使用例
Allow project p2 to use project p1 network
# Allow project p2 to use project p1 network
oc adm pod-network join-projects --to=<p1> <p2>
# Allow all projects with label name=top-secret to use project p1 network
oc adm pod-network join-projects --to=<p1> --selector='name=top-secret'
2.6.1.39. oc adm pod-network make-projects-global リンクのコピーリンクがクリップボードにコピーされました!
プロジェクトネットワークをグローバルにします。
使用例
Allow project p1 to access all pods in the cluster and vice versa
# Allow project p1 to access all pods in the cluster and vice versa
oc adm pod-network make-projects-global <p1>
# Allow all projects with label name=share to access all pods in the cluster and vice versa
oc adm pod-network make-projects-global --selector='name=share'
2.6.1.40. 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 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.6.1.41. oc adm policy add-scc-to-group リンクのコピーリンクがクリップボードにコピーされました!
SCC (Security Context Constraints) オブジェクトをグループに追加します。
使用例
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.6.1.42. oc adm policy add-scc-to-user リンクのコピーリンクがクリップボードにコピーされました!
SCC (security context constraint) をユーザーまたはサービスアカウントに追加します。
使用例
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.6.1.43. oc adm policy scc-review リンクのコピーリンクがクリップボードにコピーされました!
Pod を作成できるサービスアカウントを確認します。
使用例
2.6.1.44. oc adm policy scc-subject-review リンクのコピーリンクがクリップボードにコピーされました!
ユーザーまたはサービスアカウントが Pod を作成できるかどうかを確認します。
使用例
2.6.1.45. oc adm prune builds リンクのコピーリンクがクリップボードにコピーされました!
以前の完了済みおよび失敗したビルドを削除します。
使用例
2.6.1.46. oc adm prune deployments リンクのコピーリンクがクリップボードにコピーされました!
以前の完了済みおよび失敗したデプロイメント設定を削除します。
使用例
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.6.1.47. oc adm prune groups リンクのコピーリンクがクリップボードにコピーされました!
外部プロバイダーから欠落しているレコードを参照する以前の OpenShift グループを削除します。
使用例
2.6.1.48. oc adm prune images リンクのコピーリンクがクリップボードにコピーされました!
参照されていないイメージを削除します。
使用例
2.6.1.49. oc adm release extract リンクのコピーリンクがクリップボードにコピーされました!
更新ペイロードの内容をディスクに抽出します。
使用例
Use git to check out the source code for the current cluster release to DIR
# Use git to check out the source code for the current cluster release to DIR
oc adm release extract --git=DIR
# Extract cloud credential requests for AWS
oc adm release extract --credentials-requests --cloud=aws
2.6.1.50. oc adm release info リンクのコピーリンクがクリップボードにコピーされました!
リリースに関する情報を表示します。
使用例
2.6.1.51. oc adm release mirror リンクのコピーリンクがクリップボードにコピーされました!
リリースを別のイメージレジストリーの場所にミラーリングします。
使用例
2.6.1.52. oc adm release new リンクのコピーリンクがクリップボードにコピーされました!
新しい OpenShift リリースを作成します。
使用例
2.6.1.53. oc adm taint リンクのコピーリンクがクリップボードにコピーされました!
1 つ以上のノードでテイントを更新します。
使用例
2.6.1.54. oc adm top images リンクのコピーリンクがクリップボードにコピーされました!
イメージの使用状況の統計を表示します。
使用例
Show usage statistics for images
# Show usage statistics for images
oc adm top images
2.6.1.55. oc adm top imagestreams リンクのコピーリンクがクリップボードにコピーされました!
イメージストリームの使用状況の統計を表示します。
使用例
Show usage statistics for image streams
# Show usage statistics for image streams
oc adm top imagestreams
2.6.1.56. oc adm top node リンクのコピーリンクがクリップボードにコピーされました!
ノードのリソース (CPU/メモリー) の使用状況を表示します。
使用例
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.6.1.57. oc adm top pod リンクのコピーリンクがクリップボードにコピーされました!
Pod のリソース (CPU/メモリー) の使用状況を表示します。
使用例
2.6.1.58. oc adm uncordon リンクのコピーリンクがクリップボードにコピーされました!
ノードにスケジュール対象 (schedulable) のマークを付けます。
使用例
Mark node "foo" as schedulable
# Mark node "foo" as schedulable
oc adm uncordon foo
2.6.1.59. oc adm verify-image-signature リンクのコピーリンクがクリップボードにコピーされました!
イメージ署名に含まれるイメージ ID を確認します。
使用例