ページの先頭行へ戻る
Enterprise Service Development Platform V1.0.0 操作ガイド
FUJITSU Software

3.5 Podの状態取得

  1. Ansibleサーバにログインし、以下のコマンドを実行します。

    >kubectl get pods
  2. STATUSが、「Running」の場合は、正常に起動しています。その他状態については、Pod Lifecycle - Kubernetesのドキュメント等を参照してください。

    ■コマンドの出力例(起動している場合)

    NAME                                                    READY     STATUS             RESTARTS   AGE
    curl-deployment-59dc6b75b-7sxpt                         1/1       Running            2          31d
    opencvtest-deploy-577479bd76-mhkfw                      1/1       Running            2          31d
    ws-example-67cd7945c5-b5p98                             1/1       Running            3          35d
  3. 以下のコマンドを実行し、Podの詳細情報を取得します。
    >kubectl describe pods <Pod名>
  4. Statusが、「Running」の場合は、正常に起動しています。また、Podに含まれるコンテナの状態は、Containers.Stateに表示されます。

    ■コマンドの出力例(起動している場合)

    Name:           curl-deployment-59dc6b75b-7sxpt
    Namespace:      default
    Node:           az2-sghpf-service-server-k8s-node-00.novalocal/172.16.2.10
    Start Time:     Tue, 31 Jul 2018 01:58:01 +0000
    Labels:         app=curlpod
                    pod-template-hash=158726316
    Annotations:    <none>
    Status:         Running
    IP:             10.244.2.115
    Controlled By:  ReplicaSet/curl-deployment-59dc6b75b
    Containers:
      curlpod:
        Container ID:  docker://0fb12a3e4e2c0edb8363e2709d0c6612fa2cd780e584481d03978d353627284c
        Image:         radial/busyboxplus:curl
        Image ID:      docker-pullable://radial/busyboxplus@sha256:a68c05ab1112fd90ad7b14985a48520e9d26dbbe00cb9c09aa79fdc0ef46b372
        Port:          <none>
        Host Port:     <none>
        Command:
          sh
          -c
          while true; do sleep 1; done
        State:          Running
          Started:      Thu, 30 Aug 2018 00:55:10 +0000
        Last State:     Terminated
          Reason:       Error
          Exit Code:    255
          Started:      Fri, 03 Aug 2018 07:04:37 +0000
          Finished:     Thu, 30 Aug 2018 00:54:37 +0000
        Ready:          True
        Restart Count:  2
        Environment:    <none>
        Mounts:
          /var/run/secrets/kubernetes.io/serviceaccount from default-token-dh9nk (ro)
    Conditions:
      Type           Status
      Initialized    True
      Ready          True
      PodScheduled   True
    Volumes:
      default-token-dh9nk:
        Type:        Secret (a volume populated by a Secret)
        SecretName:  default-token-dh9nk
        Optional:    false
    QoS Class:       BestEffort
    Node-Selectors:  <none>
    Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                     node.kubernetes.io/unreachable:NoExecute for 300s
    Events:          <none>