LoginSignup
1
0

More than 1 year has passed since last update.

Kubernetesの作成済みPodのspecをjqコマンドで吐き出す。

Posted at

spec とは、オブジェクト定義の親階層的な感じです。

では、まずPodの確認から。

yusuke@mbp kubernetes % kubectl get pod                                  
NAME         READY   STATUS    RESTARTS   AGE
nginx-yaml   1/1     Running   0          18m

次に、specの内容をjqコマンドで吐き出します。

yusuke@mbp kubernetes % kubectl get pod nginx-yaml -o jsonpath="{.spec}" | jq
{
  "containers": [
    {
      "image": "nginx",
      "imagePullPolicy": "Always",
      "name": "nginx",
      "resources": {},
      "terminationMessagePath": "/dev/termination-log",
      "terminationMessagePolicy": "File",
      "volumeMounts": [
        {
          "mountPath": "/var/run/secrets/kubernetes.io/serviceaccount",
          "name": "default-token-9lsqm",
          "readOnly": true
        }
      ]
    }
  ],
  "dnsPolicy": "ClusterFirst",
  "enableServiceLinks": true,
  "nodeName": "docker-desktop",
  "preemptionPolicy": "PreemptLowerPriority",
  "priority": 0,
  "restartPolicy": "Always",
  "schedulerName": "default-scheduler",
  "securityContext": {},
  "serviceAccount": "default",
  "serviceAccountName": "default",
  "terminationGracePeriodSeconds": 30,
  "tolerations": [
    {
      "effect": "NoExecute",
      "key": "node.kubernetes.io/not-ready",
      "operator": "Exists",
      "tolerationSeconds": 300
    },
    {
      "effect": "NoExecute",
      "key": "node.kubernetes.io/unreachable",
      "operator": "Exists",
      "tolerationSeconds": 300
    }
  ],
  "volumes": [
    {
      "name": "default-token-9lsqm",
      "secret": {
        "defaultMode": 420,
        "secretName": "default-token-9lsqm"
      }
    }
  ]
}

細かく定義したものではないのでs、
ほとんどがデフォルト値です。
以上。

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