Test Online Free CNCF CKA Exam Questions and Answers
The questions for CKA were last updated On Aug.29 2022 Get CKA Full AccessQuestion No : 1
CORRECT TEXT
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.
Answer: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
Question No : 2
CORRECT TEXT
Create an nginx pod and list the pod with different levels of verbosity
Answer:// create a pod
kubectl run nginx --image=nginx --restart=Never --port=80
// List the pod with different verbosity kubectl get po nginx --v=7
kubectl get po nginx --v=8 kubectl get po nginx --v=9
Question No : 3
CORRECT TEXT
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
Answer:solution
Question No : 4
CORRECT TEXT
Score: 4%
Task
Schedule a pod as follows:
• Name: nginx-kusc00401
• Image: nginx
• Node selector: disk=ssd
Answer:Solution:
#yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx-kusc00401
spec:
containers:
- name: nginx image: nginx imagePullPolicy: IfNotPresent nodeSelector:
disk: spinning
#
kubectl create -f node-select.yaml
- TOP 50 Exam Questions
-
Exam
All copyrights reserved 2024 PassQuestion NETWORK CO.,LIMITED. All Rights Reserved.