List pod logs named “frontend” and search for the pattern “started” and write it to a file “/opt/error-logs”
Solution:
Kubectl logs frontend | grep -i “started” > /opt/error-logs
Does this meet the goal?
Correct Answer:
A
Score: 7%
Task
First, create a snapshot of the existing etcd instance running at https://127.0.0.1:2379, saving the snapshot to /srv/data/etcd-snapshot.db.
Next, restore an existing, previous snapshot located at /var/lib/backup/etcd-snapshot-previo us.db
Solution:
Solution:
#backup
ETCDCTL_API=3 etcdctl --endpoints="https://127.0.0.1:2379" --cacert=/opt/KUIN000601/ca.crt
--cert=/opt/KUIN000601/etcd-client.crt --key=/opt/KUIN000601/etcd-client.key snapshot save
/etc/data/etcd-snapshot.db
#restore
ETCDCTL_API=3 etcdctl --endpoints="https://127.0.0.1:2379" --cacert=/opt/KUIN000601/ca.crt
--cert=/opt/KUIN000601/etcd-client.crt --key=/opt/KUIN000601/etcd-client.key snapshot restore
/var/lib/backup/etcd-snapshot-previoys.db
Does this meet the goal?
Correct Answer:
A
Create a busybox pod that runs the command “env” and save the output to “envpod” file
Solution:
kubectl run busybox --image=busybox --restart=Never –-rm -it -- env > envpod.yaml
Does this meet the goal?
Correct Answer:
A
Create a pod with image nginx called nginx and allow traffic on port 80
Solution:
kubectlrun nginx --image=nginx --restart=Never --port=80
Does this meet the goal?
Correct Answer:
A
List all persistent volumes sorted bycapacity, saving the fullkubectloutput to
/opt/KUCC00102/volume_list. Usekubectl 's own functionality forsorting the output, and do not manipulate it any further.
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA2 C.JPG
Does this meet the goal?
Correct Answer:
A