Create a pod as follows:
Name:non-persistent-redis
container Image:redis
Volume with name:cache-control
Mount path:/data/redis
The pod should launch in thestagingnamespace and the volumemust notbe persistent.
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA13 B.JPG
F:WorkData Entry WorkData Entry20200827CKA13 C.JPG
F:WorkData Entry WorkData Entry20200827CKA13 D.JPG
Does this meet the goal?
Correct Answer:
A
Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to theexisting pod namedfront-end.
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA8 B.JPG
Does this meet the goal?
Correct Answer:
A
List all the pods sorted by created timestamp
Solution:
kubect1 get pods--sort-by=.metadata.creationTimestamp
Does this meet the goal?
Correct Answer:
A
Perform the following tasks:
Add an init container tohungry-bear(which has beendefined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
The init container should createan empty file named/workdir/calm.txt
If/workdir/calm.txtis notdetected, the pod should exit
Once the spec file has beenupdatedwith the init containerdefinition, the pod should becreated
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA4 B.JPG
F:WorkData Entry WorkData Entry20200827CKA4 C.JPG
F:WorkData Entry WorkData Entry20200827CKA4 D.JPG
Does this meet the goal?
Correct Answer:
A
Create 2 nginx image pods in which one of them is labelled with env=prod and another one labelled with
env=dev and verify the same.
Solution:
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like ??creationTimestamp: null?? ??dnsPolicy: ClusterFirst??
vim nginx-prod-pod.yaml apiVersion: v1
kind: Pod metadata: labels: env: prod
name: nginx-prod spec:
containers:
- image: nginx name: nginx-prod
restartPolicy: Always
# kubectl create -f nginx-prod-pod.yaml
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yaml apiVersion: v1
kind: Pod metadata: labels: env: dev
name: nginx-dev
spec: containers:
- image: nginx name: nginx-dev
restartPolicy: Always
# kubectl create -f nginx-prod-dev.yaml Verify :
kubectl get po --show-labels kubectl get po -l env=prod kubectl get po -l env=dev
Does this meet the goal?
Correct Answer:
A