Monitor the logs of pod foo and:
Extract log lines corresponding to error unable-to-access-website
Write them to/opt/KULM00201/foo
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA1 B.JPG
F:WorkData Entry WorkData Entry20200827CKA1 C.JPG
Does this meet the goal?
Correct Answer:
A
Create a Kubernetes secret as follows:
Name: super-secret
password: bob
Create a pod named pod-secrets-via-file, using the redis Image, which mounts a secret named super-secret at /secrets.
Create a second pod named pod-secrets-via-env, using the redis Image, which exports password as
CONFIDENTIAL
Solution:
solution
F:WorkData Entry WorkData Entry20200827CKA12 B.JPG
F:WorkData Entry WorkData Entry20200827CKA12 C.JPG
F:WorkData Entry WorkData Entry20200827CKA12 D.JPG
Does this meet the goal?
Correct Answer:
A
List all the pods sorted by name
Solution:
kubectl get pods --sort-by=.metadata.name
Does this meet the goal?
Correct Answer:
A
Score:7%
Task
Create a new PersistentVolumeClaim
• Name: pv-volume
• Class: csi-hostpath-sc
• Capacity: 10Mi
Create a new Pod which mounts the PersistentVolumeClaim as a volume:
• Name: web-server
• Image: nginx
• Mount path: /usr/share/nginx/html
Configure the new Pod to have ReadWriteOnce access on the volume.
Finally, using kubectl edit or kubectl patch expand the PersistentVolumeClaim to a capacity of 70Mi and record that change.
Solution:
Solution:
vi pvc.yaml storageclass pvc apiVersion: v1
kind: PersistentVolumeClaim metadata:
name: pv-volume spec: accessModes:
- ReadWriteOnce volumeMode: Filesystem resources:
requests: storage: 10Mi
storageClassName: csi-hostpath-sc
# vi pod-pvc.yaml apiVersion: v1 kind: Pod metadata:
name: web-server spec:
containers:
- name: web-server image: nginx volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: my-volume volumes:
- name: my-volume persistentVolumeClaim: claimName: pv-volume
# craete
kubectl create -f pod-pvc.yaml
#edit
kubectl edit pvc pv-volume --record
Does this meet the goal?
Correct Answer:
A
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