kubernetes查看现有pod的YAML描述文件

命令: kubectl get pod [pod名字] -o yaml

kubectl get pod httpd-gv4bl -o yaml

yaml描述文件结果

 
apiVersion: v1   --YAML描述文件所使用的Kubernetes API版本
kind: Pod        --Kubernetes 对象资源 
metadata:        --pod元数据(名称、标签和注解)
  creationTimestamp: 2019-09-03T06:05:16Z
  generateName: httpd-
  labels:
    run: httpd
  name: httpd-gv4bl
  namespace: default
  ownerReferences:
  - apiVersion: v1
    blockOwnerDeletion: true
    controller: true
    kind: ReplicationController
    name: httpd
    uid: 049ce8c5-035b-4422-a3b0-40e814d5c820
  resourceVersion: "1640"
  selfLink: /api/v1/namespaces/default/pods/httpd-gv4bl
  uid: b032b3bd-b42f-476a-b5fa-93121169fc7b
spec:           --pod规格/内容(pod的容器列表、volume)
  containers:
  - image: httpd
    imagePullPolicy: Always
    name: httpd
    ports:
    - containerPort: 80
      protocol: TCP
    resources: {
    
    }
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - mountPath: /var/run/secrets/kubernetes.io/serviceaccount
      name: default-token-mrn2n
      readOnly: true
  dnsPolicy: ClusterFirst
  enableServiceLinks: true
  nodeName: minikube
  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-mrn2n
    secret:
      defaultMode: 420
      secretName: default-token-mrn2n
status:             --pod及其内部容器的详细状态
  conditions:
  - lastProbeTime: null
    lastTransitionTime: 2019-09-03T06:05:16Z
    status: "True"
    type: Initialized
  - lastProbeTime: null
    lastTransitionTime: 2019-09-03T06:07:54Z
    status: "True"
    type: Ready
  - lastProbeTime: null
    lastTransitionTime: 2019-09-03T06:07:54Z
    status: "True"
    type: ContainersReady
  - lastProbeTime: null
    lastTransitionTime: 2019-09-03T06:05:16Z
    status: "True"
    type: PodScheduled
  containerStatuses:
  - containerID: docker://0ed3b5ef7bf2de481f26d23b9a431094412443db004ea04c6e57d9157baf8e1b
    image: httpd:latest
    imageID: docker-pullable://httpd@sha256:98caed3e3a90ed9db8d25dcbb98eebe0ce56358a9dbbc940d7eb66a8e2b88252
    lastState: {
    
    }
    name: httpd
    ready: true
    restartCount: 0
    state:
      running:
        startedAt: 2019-09-03T06:07:53Z
  hostIP: 192.168.122.91
  phase: Running
  podIP: 172.17.0.4
  qosClass: BestEffort
  startTime: 2019-09-03T06:05:16Z

参考

https://blog.csdn.net/xufengduo/article/details/100518814

猜你喜欢

转载自blog.csdn.net/qq_41489540/article/details/114289121