Create a Pod with three busy box containers with commands "ls; sleep 3600;", "echo Hello World; sleep 3600;" and "echo this is the third container; sleep 3600" respectively and check the status

Create a Pod with three busy box containers with commands "ls; sleep 3600;", "echo Hello World; sleep 3600;" and "echo this is the third container; sleep 3600" respectively and check the status
A . Solution:
// first create single container pod with dry run flag
kubectl run busybox –image=busybox –restart=Always
–dry-run -o yaml — bin/sh -c "sleep 3600; ls" > multi-container.yaml // edit the pod to following yaml and
create it
apiVersion: v1
kind: Pod
metadata:
labels:
run: busybox
name: busybox
spec:
containers:
– args:
– bin/sh
– -c
– ls; sleep 3600
image: busybox
name: busybox-container-1
– args:
– bin/sh
– -c
– echo Hello world; sleep 3600
image: busybox
name: busybox-container-2
– args:
– bin/sh
– -c
– echo this is third container; sleep 3600
image: busybox
name: busybox-container-3
restartPolicy: Always
// Verify
Kubectl get pods

Answer: A

Latest CKA Dumps Valid Version with 122 Q&As

Latest And Valid Q&A | Instant Download | Once Fail, Full Refund

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments