LoginSignup
0
0

Kubernetesで削除中の全リソースを表示する方法

Posted at

Kubernetesで削除中のリソースを表示する方法

Kubernetesクラスタ内で削除中の全リソースを確認するためのワンライナーを紹介します。
このスクリプトは、すべてのリソースタイプに対して、削除タイムスタンプ (deletionTimestamp) が設定されているリソースを表示します。

スクリプトの内容

以下のワンライナーを使用して、削除中のリソースを確認できます。

for resource in $(kubectl api-resources --verbs=list -o name); do echo "# Resource Type: $resource"; kubectl get "$resource" -A -o yaml | yq e 'select(.metadata.deletionTimestamp != null)'; echo "---"; done
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