0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

CKA試験、Logs

Posted at

ログの出力

pod custom-appのログをモニタリングし、file not foundログを抽出し、/var/CKA2022/custom-log001ファイルに保存しなさい

kubectl logs custom-app | grep 'file not found' > /var/CKA2022/custom-log001

リソスノ出力

top 命令語を利用する

kubectl top nodes --sort-by=cpu # cpu利用が多い順でNodeを出力
kubectl top pods --sort-by=memory # memory利用が多い順でPodを出力

Json フォーマット

kubectl get pods -o json
kubectl get pods --sort-by=.metadata.name
kubectl get pv --sort-by=.spec.capacity.storage`

クラスタリスト情報を確認する

name=overloaded-cpu ラベルを利用するpodの中でCPU消費率が一番多いPodの名前を探して/var/CKA2022/custom-app-logに記録しなさい

kubectl get pod --show-labels | grep 'name=overloaded-cpu'  # ラベルを確認する
kubectl top pods --sort-by=cpu

# 'name=overloaded-cpu'ラベルを使うPodでCPU使用率が一番多いPodを`/var/CKA2022/custom-app-log`に記載する

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?