1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

oc comandまとめ(25/05/09追記)

Last updated at Posted at 2024-06-28

概要

OpenShiftで利用するコマンド、ocコマンドのまとめです。
あまり日本語の記事が無いので、誰かの助けになればと思い作成しています。
随時追記します。

ocコマンドまとめ

リソースの内容を確認する

$ oc get <リソースの種類> <リソースの固有名>
  • リソースの種類とは、pod(短縮形はpo), deployment(deploy), configmap(cm), images(is), service(svc)などです。
  • 例) oc get po mytestpod

configmapを作成する

$ oc create configmap <configmap名> --from-file=<confファイルのファイル名>
  • fluentdにしか使ったことがない

podのログを見る

$ oc logs <pod名> -c <container名>
  • Podが作成されていない(CrashLoopBackoff等)状態では使えない
  • -c でコンテナ名を指定できる

imagestreamを確認する

$ oc get imagestream -n <project名>
$ oc get is -n <project名>
  • -n でプロジェクト名を指定できる

メモリやCPUの使用状況を確認する

$ oc get resourcequota
NAME      AGE         REQUEST           LIMIT
.....     .....       ...............  ........

$ oc get limitrange
NAME      CREATED AT
.....     .....  
  • Podの作成ができなかったりしたら見たらいいかも(メモリやCPUが足りなくて作成できていない可能性があるので)

Serviceを確認する

$ oc get service
$ oc get svc

参考文献

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?