I have created the simple static web pod using the following way
mkdir /etc/kubelet.d/ cat <<EOF >/etc/kubelet.d/static-web.yaml apiVersion: v1 kind: Pod metadata: name: static-web labels: role: myrole spec: containers: - name: web image: nginx ports: - name: web containerPort: 80 protocol: TCP EOF
After creating
I am deleting the source file from /etc/kubelet.d/static-web.yaml. Now I wants to retrieve the yaml file from the running pod.
While I am trying to generate, I am getting yaml outout in 120 to 150 lines rather original source file Exam: original source file 10 to 15 the file what I am getting it is around 120 to 150 lines.
So can you help me to get exact as the source file like above and eliminate unnecessary object file
root@master-1:~# kubectl get pod static-web
NAME READY STATUS RESTARTS AGE
static-web 1/1 Running 0 20h
I have copied only few lines
root@master-1:~# kubectl get pod static-web -o yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: "2020-12-28T10:08:26Z"
labels:
role: myrole
managedFields:
- apiVersion: v1
fieldsType: FieldsV1
fieldsV1:
f:metadata:
f:labels:
.: {}
f:role: {}
f:spec:
f:containers:
k:{"name":"web"}:
.: {}
f:image: {}
f:imagePullPolicy: {}
f:name: {}