Check the image version in pod without the describe command
Solution:
kubectl get po nginx -o jsonpath='{.spec.containers[].image}{"n"}'
Does this meet the goal?
Correct Answer:
A
Score: 5%
Task
From the pod label name=cpu-utilizer, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/KUTR00401/KUTR00401.txt (which already exists).
Solution:
Solution:
kubectl top -l name=cpu-user -A
echo 'pod name' >> /opt/KUT00401/KUT00401.txt
Does this meet the goal?
Correct Answer:
A
Score:7%
Context
An existing Pod needs to be integrated into the Kubernetes built-in logging architecture (e. g. kubectl logs). Adding a streaming sidecar container is a good and common way to accomplish this requirement.
Task
Add a sidecar container named sidecar, using the busybox Image, to the existing Pod big-corp-app. The new sidecar container has to run the following command:
/bin/sh -c tail -n+1 -f /va r/log/big-corp-app.log
Use a Volume, mounted at /var/log, to make the log file big-corp-app.log available to the sidecar container.
Solution:
Solution:
#
kubectl get pod big-corp-app -o yaml
#
apiVersion: v1 kind: Pod metadata:
name: big-corp-app spec:
containers:
- name: big-corp-app image: busybox
args:
- /bin/sh
- -c
- > i=0;
while true; do
echo "$(date) INFO $i" >> /var/log/big-corp-app.log; i=$((i+1));
sleep 1; done
volumeMounts:
- name: logs mountPath: /var/log
- name: count-log-1 image: busybox
args: [/bin/sh, -c, 'tail -n+1 -f /var/log/big-corp-app.log'] volumeMounts:
- name: logs mountPath: /var/log volumes:
- name: logs emptyDir: {
}
#
kubectl logs big-corp-app -c count-log-1
Does this meet the goal?
Correct Answer:
A
Perform the following tasks:
Add an init container to hungry-bear (which has been defined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
The init container should create an empty file named/workdir/calm.txt
If /workdir/calm.txt is not detected, the pod should exit
Once the spec file has been updated with the init container definition, the pod should be created
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
List all the pods showing name and namespace with a json path expression
Solution:
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'metadata.namespace']}"
Does this meet the goal?
Correct Answer:
A