Dave McLean:
Hi all
When I do:
kubectl get pod my-pod -o yaml > pod-definition.yaml
I get a very verbose output which makes it hard to see the important stuff and hard to compare my answer and the correct answer.
What am I doing wrong?
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2021-07-05T16:39:31Z"
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:spec:
f:containers:
k:{"name":"ubuntu"}:
.: {}
f:command: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}
f:resources: {}
f:terminationMessagePath: {}
f:terminationMessagePolicy: {}
f:dnsPolicy: {}
f:enableServiceLinks: {}
f:restartPolicy: {}
f:schedulerName: {}
f:securityContext: {}
f:terminationGracePeriodSeconds: {}
manager: python-requests
operation: Update
time: "2021-07-05T16:39:31Z"
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:status:
f:conditions:
k:{"type":"ContainersReady"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
k:{"type":"Initialized"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
k:{"type":"Ready"}:
.: {}
f:lastProbeTime: {}
f:lastTransitionTime: {}
f:status: {}
f:type: {}
f:containerStatuses: {}
f:hostIP: {}
f:phase: {}
f:podIP: {}
f:podIPs:
.: {}
k:{"ip":"10.244.1.4"}:
.: {}
f:ip: {}
f:startTime: {}
manager: kubelet
operation: Update
time: "2021-07-05T16:39:40Z"
name: ubuntu-sleeper
namespace: default
resourceVersion: "911"
selfLink: /api/v1/namespaces/default/pods/ubuntu-sleeper
uid: c0ebcc54-1125-4356-99c6-c14edb997e85
spec:
securityContext:
runAsUser: 1010
containers:
- command:
- sleep
- "4800"
image: ubuntu
imagePullPolicy: Always
name: ubuntu
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-m6v69
readOnly: true
dnsPolicy: ClusterFirst
enableServiceLinks: true
nodeName: node01
preemptionPolicy: PreemptLowerPriority
priority: 0
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
serviceAccount: default
serviceAccountName: default
terminationGracePeriodSeconds: 30
tolerations:
- effect: NoExecute
key: <http://node.kubernetes.io/not-ready|node.kubernetes.io/not-ready>
operator: Exists
tolerationSeconds: 300
- effect: NoExecute
key: <http://node.kubernetes.io/unreachable|node.kubernetes.io/unreachable>
operator: Exists
tolerationSeconds: 300
volumes:
- name: default-token-m6v69
secret:
defaultMode: 420
secretName: default-token-m6v69
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2021-07-05T16:39:30Z"
status: "True"
type: Initialized
- lastProbeTime: null
lastTransitionTime: "2021-07-05T16:39:39Z"
status: "True"
type: Ready
- lastProbeTime: null
lastTransitionTime: "2021-07-05T16:39:39Z"
status: "True"
type: ContainersReady
- lastProbeTime: null
lastTransitionTime: "2021-07-05T16:39:31Z"
status: "True"
type: PodScheduled
containerStatuses:
- containerID: <docker://6eeae445be2c52a4dfa4af63b953a192acd3ce24c0935cd00384868c522bf57>7
image: ubuntu:latest
imageID: <docker-pullable://ubuntu@sha256>:aba80b77e27148d99c034a987e7da3a287ed455390352663418c0f2ed40417fe
lastState: {}
name: ubuntu
ready: true
restartCount: 0
started: true
state:
running:
startedAt: "2021-07-05T16:39:39Z"
hostIP: 172.17.0.25
phase: Running
podIP: 10.244.1.4
podIPs:
- ip: 10.244.1.4
qosClass: BestEffort
startTime: "2021-07-05T16:39:30Z"