最新的Linux Foundation Certified Kubernetes Administrator (CKA) Program - CKA免費考試真題
Check the Image version of nginx-dev pod using jsonpath
正確答案:
kubect1 get po nginx-dev -o
jsonpath='{.spec.containers[].image}{"\n"}'
jsonpath='{.spec.containers[].image}{"\n"}'
Schedule a Pod as follows:
. Name: kucc1
. App Containers : 2
. Container Name/Images :
* redis
* Memcached
. Name: kucc1
. App Containers : 2
. Container Name/Images :
* redis
* Memcached
正確答案:
A screen shot of a computer AI-generated content may be incorrect.


A Kubernetes worker node, named wk8s-node-0 is in state NotReady. Investigate why this is the case, and perform any appropriate steps to bring the node to a Ready state, ensuring that any changes are made permanent.
You can ssh to the failed node using:
[student@node-1] $ | ssh Wk8s-node-0
You can assume elevated privileges on the node with the following command:
[student@w8ks-node-0] $ | sudo -i
You can ssh to the failed node using:
[student@node-1] $ | ssh Wk8s-node-0
You can assume elevated privileges on the node with the following command:
[student@w8ks-node-0] $ | sudo -i
正確答案:



Create a deployment as follows:
* Name: nginx-random
* Exposed via a service nginx-random
* Ensure that the service and pod are accessible via their respective DNS records
* The container(s) within any pod(s) running as a part of this deployment should use the nginx Image Next, use the utility nslookup to look up the DNS records of the service and pod and write the output to /opt
/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.
* Name: nginx-random
* Exposed via a service nginx-random
* Ensure that the service and pod are accessible via their respective DNS records
* The container(s) within any pod(s) running as a part of this deployment should use the nginx Image Next, use the utility nslookup to look up the DNS records of the service and pod and write the output to /opt
/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.
正確答案:
Solution:






Score: 4%

Task
Create a persistent volume with name app-data , of capacity 1Gi and access mode ReadOnlyMany. The type of volume is hostPath and its location is /srv/app-data .

Task
Create a persistent volume with name app-data , of capacity 1Gi and access mode ReadOnlyMany. The type of volume is hostPath and its location is /srv/app-data .
正確答案:
Solution:
#vi pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-config
spec:
capacity:
storage: 1Gi
accessModes:
- ReadOnlyMany
hostPath:
path: /srv/app-config
#
kubectl create -f pv.yaml
#vi pv.yaml
apiVersion: v1
kind: PersistentVolume
metadata:
name: app-config
spec:
capacity:
storage: 1Gi
accessModes:
- ReadOnlyMany
hostPath:
path: /srv/app-config
#
kubectl create -f pv.yaml
Task Weight: 4%

Task
Schedule a Pod as follows:
* Name: kucc1
* App Containers: 2
* Container Name/Images:
o nginx
o consul

Task
Schedule a Pod as follows:
* Name: kucc1
* App Containers: 2
* Container Name/Images:
o nginx
o consul
正確答案:
Solution:

Graphical user interface, text, application Description automatically generated

Text Description automatically generated


Graphical user interface, text, application Description automatically generated

Text Description automatically generated

Check the image version in pod without the describe command
正確答案:
kubectl get po nginx -o
jsonpath='{.spec.containers[].image}{"\n"}'
jsonpath='{.spec.containers[].image}{"\n"}'
Get list of all the pods showing name and namespace with a jsonpath expression.
正確答案:
kubectl get pods -o=jsonpath="{.items[*]['metadata.name'
, 'metadata.namespace']}"
, 'metadata.namespace']}"
Print pod name and start time to "/opt/pod-status" file
正確答案:
kubect1 get pods -o=jsonpath='{range
items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'