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 3 years have passed since last update.

Kubernetes Podのstatus一覧

Last updated at Posted at 2021-04-15

Podのstatusは、WaitingRunningTerminatedの3つ

KubernetesはPod内の各コンテナの状態を追跡します。

PodがschedulerによってNodeに割り当てられると、kubeletはcontainer runtimeを使用してコンテナの作成を開始します。

コンテナの状態はWaiting、RunningまたはTerminatedの3ついずれかになります。

status|意味

  • | -
    Waiting | RunningまたはTerminatedのいずれの状態でもない
    Running | 問題なく実行中
    Terminated | 完了。または、何らかの理由で失敗

Podのコンテナのstatus確認コマンド

kubectl describe pod [POD_NAME]

Pod内のコンテナごとにStateの項目として表示されます。

Waiting

コンテナがRunningまたはTerminatedのいずれの状態でもない場合コンテナはWaitingの状態になります。

Waiting状態のコンテナは引き続きコンテナイメージレジストリからイメージを取得したりSecretを適用したりするなど必要な操作を実行します。
Waiting状態のコンテナを持つPodに対してkubectlコマンドを使用すると、そのコンテナがWaitingの状態である理由の要約が表示されます。

Running

Running状態はコンテナが問題なく実行されていることを示します。

コンテナがRunning状態に入る前にpostStartフック(もしあれば)が実行されます。
Running状態のコンテナを持つPodに対してkubectlコマンドを使用すると、そのコンテナがRunning状態になった時刻が表示されます。

Terminated

Terminated状態のコンテナは実行されて、完了したときまたは何らかの理由で失敗したことを示します。
Terminated状態のコンテナを持つPodに対してkubectlコマンドを使用すると、終了理由と終了コード、コンテナの開始時刻と終了時刻が表示されます。

コンテナがTerminatedに入る前にpreStopフックがあれば実行されます。

参考

Podのライフサイクル | Kubernetes

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?