CKA Practice Test Questions Updated 63 Questions Linux Foundation CKA Dumps - Secret To Pass in First Attempt Difficulty in Attempting Linux Foundation-CKA: Certified Kubernetes Administrator Exam CKA is a tough exam. Mainly because it focuses on your ability to perform on a practical level rather than just asking a bunch of MCQ questions that would test your knowledge. If the user has successfully [...]

CKA Practice Test Questions Updated 63 Questions [Q36-Q59]

Share

CKA Practice Test Questions Updated 63 Questions

Linux Foundation CKA Dumps - Secret To Pass in First Attempt


Difficulty in Attempting Linux Foundation-CKA: Certified Kubernetes Administrator Exam

CKA is a tough exam. Mainly because it focuses on your ability to perform on a practical level rather than just asking a bunch of MCQ questions that would test your knowledge. If the user has successfully passed the CNCF CKA practice exam and has been through CNCF CKA exam dumps then the certification exam will not be too much difficult as the user has shown aptitude for understanding complicated processes.

 

NEW QUESTION 36
Delete persistent volume and persistent volume claim

Answer:

Explanation:
kubectl delete pvc task-pv-claim kubectl delete pv task-pv-volume // Verify Kubectl get pv,pvc

 

NEW QUESTION 37
Create a snapshot of the etcd instance running at https://127.0.0.1:2379, saving the snapshot to the file path
/srv/data/etcd-snapshot.db.
The following TLS certificates/key are supplied for connecting to the server with etcdctl:
* CA certificate: /opt/KUCM00302/ca.crt
* Client certificate: /opt/KUCM00302/etcd-client.crt
* Client key: Topt/KUCM00302/etcd-client.key

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 38
List all the pods sorted by name

Answer:

Explanation:
See the solution below.
Explanation
kubectl get pods --sort-by=.metadata.name

 

NEW QUESTION 39
Create a Cronjob with busybox image that prints date and hello from kubernetes cluster message for every minute

  • A. CronJob Syntax:
    * --> Minute
    * --> Hours
    * --> Day of The Month
    * --> Month
    * --> Day of the Week
    */1 * * * * --> Execute a command every one minutes.
    vim date-job.yaml
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: date-job
    spec:
    schedule: "*/1 * * * *"
    jobTemplate:
    spec:
    template:
    - /bin/sh
    - -c
    - date; echo Hello from the Kubernetes cluster
    restartPolicy: OnFailure
    kubectl apply -f date-job.yaml
    //Verify
    kubectl get cj date-job -o yaml
  • B. CronJob Syntax:
    * --> Minute
    * --> Hours
    * --> Day of The Month
    * --> Month
    * --> Day of the Week
    */1 * * * * --> Execute a command every one minutes.
    vim date-job.yaml
    apiVersion: batch/v1beta1
    kind: CronJob
    metadata:
    name: date-job
    spec:
    schedule: "*/1 * * * *"
    jobTemplate:
    spec:
    template:
    spec:
    containers:
    - name: hello
    image: busybox
    args:
    - /bin/sh
    - -c
    - date; echo Hello from the Kubernetes cluster
    restartPolicy: OnFailure
    kubectl apply -f date-job.yaml
    //Verify
    kubectl get cj date-job -o yaml

Answer: B

 

NEW QUESTION 40
Given a partially-functioning Kubernetes cluster, identify symptoms of failure on the cluster.
Determine the node, the failing service, and take actions to bring up the failed service and restore the health of the cluster. Ensure that any changes are made permanently.
You can ssh to the relevant I nodes (bk8s-master-0 or bk8s-node-0) using:
[student@node-1] $ ssh <nodename>
You can assume elevated privileges on any node in the cluster with the following command:
[student@nodename] $ | sudo -i

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 41
Undo the deployment to the previous version 1.17.1 and verify Image has the previous version

Answer:

Explanation:
kubectl rollout undo deploy webapp kubectl describe deploy webapp | grep Image

 

NEW QUESTION 42
List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error-logs"

Answer:

Explanation:
See the solution below.
Explanation
Kubectl logs frontend | grep -i "started" > /opt/error-logs

 

NEW QUESTION 43
Create a PersistentVolumeClaim of at least 3Gi storage and access mode ReadWriteOnce and verify status is Bound

  • A. vim task-pv-claim.yaml
    apiVersion: v2
    kind: PersistentVolumeClaim
    metadata:
    name: task-pv-claim
    spec:
    storageClassName: ""
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 4Gi
    kubectl apply -f task-pv-claim.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 4Gi RWO
    Retain Bound default/task-pv-claim
    6m16s
    kubectl get pvc
    NAME STATUS VOLUME
    CAPACITY ACCESS MODES STORAGECLASS AGE
    task-pv-claim Bound task-pv-volume
    5Gi RWO 6s
  • B. vim task-pv-claim.yaml
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
    name: task-pv-claim
    spec:
    storageClassName: ""
    accessModes:
    - ReadWriteOnce
    resources:
    requests:
    storage: 3Gi
    kubectl apply -f task-pv-claim.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 5Gi RWO
    Retain Bound default/task-pv-claim
    6m16s
    kubectl get pvc
    NAME STATUS VOLUME
    CAPACITY ACCESS MODES STORAGECLASS AGE
    task-pv-claim Bound task-pv-volume
    5Gi RWO 6s

Answer: B

 

NEW QUESTION 44
Create 2 nginx image pods in which one of them is labelled with env=prod and another one labelled with env=dev and verify the same.

Answer:

Explanation:
See the solution below.
Explanation
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like "creationTimestamp: null"
"dnsPolicy: ClusterFirst"
vim nginx-prod-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
env: prod
name: nginx-prod
spec:
containers:
- image: nginx
name: nginx-prod
restartPolicy: Always
# kubectl create -f nginx-prod-pod.yaml
kubectl run --generator=run-pod/v1 --image=nginx --
labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
env: dev
name: nginx-dev
spec:
containers:
- image: nginx
name: nginx-dev
restartPolicy: Always
# kubectl create -f nginx-prod-dev.yaml
Verify :
kubectl get po --show-labels
kubectl get po -l env=prod
kubectl get po -l env=dev

 

NEW QUESTION 45
Create 2 nginx image pods in which one of them is labelled with env=prod and another one labelled with env=dev and verify the same.

  • A. kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like "creationTimestamp: null" "dnsPolicy: ClusterFirst" vim nginx-prod-pod.yaml apiVersion: v1 kind: Pod metadata:
    labels:
    env: prod
    name: nginx-prod
    spec:
    containers:
    - image: nginx
    name: nginx-prod
    restartPolicy: Always
    # kubectl create -f nginx-prod-pod.yaml
    kubectl run --generator=run-pod/v1 --image=nginx --
    labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    env: dev
    name: nginx-dev
    spec:
    containers:
    - image: nginx
    name: nginx-dev
    restartPolicy: Always
    # kubectl create -f nginx-prod-dev.yaml
    Verify :
    kubectl get po --show-labels
    kubectl get po -l env=prod
    kubectl get po -l env=dev
  • B. kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml > nginx-prodpod.yaml Now, edit nginx-prod-pod.yaml file and remove entries like "creationTimestamp: null" "dnsPolicy: ClusterFirst" vim nginx-prod-pod.yaml apiVersion: v1 kind: Pod metadata:
    labels:
    env: prod
    name: nginx-prod
    spec:
    containers:
    - image: nginx
    name: nginx-prod
    restartPolicy: Always
    # kubectl create -f nginx-prod-pod.yaml
    kubectl run --generator=run-pod/v1 --image=nginx --
    labels=env=dev nginx-dev --dry-run -o yaml > nginx-dev-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    - image: nginx
    name: nginx-dev
    restartPolicy: Always
    # kubectl create -f nginx-prod-dev.yaml
    Verify :
    kubectl get po --show-labels
    kubectl get po -l env=dev

Answer: A

 

NEW QUESTION 46
On the NGFW, how can you generate and block a private key from export and thus harden your security posture and prevent rogue administrators or other bad actors from misusing keys?

  • A. 1) Select Device > Certificates
    2) Select Certificate Profile
    3) Generate the certificate
    4) Select Block Private Key Export
  • B. 1) Select Device > Certificate Management > Certificates Device > Certificates
    2) Generate the certificate.
    3) Select Block Private Key Export.
    4) Click Generate to generate the new certificate.
  • C. 1) Select Device > Certificate Management > Certificates >Device > Certificates
    2) Import the certificate.
    3) Select Import Private Key
    4) Click Generate to generate the new certificate.
  • D. 1) Select Device > Certificates
    2) Select Certificate Profile.
    3) Generate the certificate
    4) Select Block Private Key Export.

Answer: A

 

NEW QUESTION 47
Score: 4%

Task
Set the node named ek8s-node-1 as unavailable and reschedule all the pods running on it.

Answer:

Explanation:
See the solution below.
Explanation
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon ek8s-node-1
kubectl drain ek8s-node-1 --delete-local-data --ignore-daemonsets --force

 

NEW QUESTION 48
Create a busybox pod which executes this command sleep 3600 with the service account admin and verify

  • A. kubectl run busybox --image=busybox --restart=Always --dry-run
    -o yaml -- /bin/sh -c "sleep 3600" > busybox.yml
    // Edit busybox.yaml file
    apiVersion: v1
    kind: Pod
    metadata:
    creationTimestamp: null
    labels:
    run: busybox
    name: busybox
    spec:
    serviceAccountName: admin
    containers:
    - args:
    - /bin/sh
    - -c
    - sleep 3600
    image: busybox
    name: busybox
    restartPolicy: Always
    // verify
    K kubectl describe po busybox
  • B. kubectl run busybox --image=busybox --restart=Always --dry-run
    -o yaml -- /bin/sh -c "sleep 3600" > busybox.yml
    // Edit busybox.yaml file
    apiVersion: v1
    kind: Pod
    metadata:
    creationTimestamp: null
    labels:
    run: busybox
    name: busybox
    spec:
    serviceAccountName: admin
    containers:
    - args:
    - /bin/sh
    - -c
    - sleep 3800
    image: busybox
    name: busybox
    restartPolicy: Always
    // verify
    K kubectl describe po busybox

Answer: A

 

NEW QUESTION 49
Print pod name and start time to "/opt/pod-status" file

Answer:

Explanation:
kubect1 get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'

 

NEW QUESTION 50
For this item, you will have to ssh to the nodes ik8s-master-0 and ik8s-node-0 and complete all tasks on these nodes. Ensure that you return to the base node (hostname: node-1) when you have completed this item.
Context
As an administrator of a small development team, you have been asked to set up a Kubernetes cluster to test the viability of a new application.
Task
You must use kubeadm to perform this task. Any kubeadm invocations will require the use of the
--ignore-preflight-errors=all option.
* Configure the node ik8s-master-O as a master node. .
* Join the node ik8s-node-o to the cluster.

Answer:

Explanation:
See the solution below.
Explanation
solution
You must use the kubeadm configuration file located at /etc/kubeadm.conf when initializingyour cluster.
You may use any CNI plugin to complete this task, but if you don't have your favourite CNI plugin's manifest URL at hand, Calico is one popular option: https://docs.projectcalico.org/v3.14/manifests/calico.yaml Docker is already installed on both nodes and has been configured so that you can install the required tools.

 

NEW QUESTION 51
Check nodes which are ready and print it to a file /opt/nodestatus

  • A. JSONPATH='{range .items[*]}{@.metadata.name}:{range
    @.status.conditions[*]}{@.type}={@.status};{end}{end}' \
    && kubectl get nodes -o jsonpath="$JSONPATH" | grep
    "Ready=True" > /opt/node-status
    //Verify
    cat /opt/node-status
  • B. JSONPATH='{range .items[*]}{@.metadata.name}:{range
    @.status.conditions[*]}{@.type}={@.status};{end}{end}' \
    //Verify
    cat /opt/node-status

Answer: A

 

NEW QUESTION 52
Create a configmap called myconfigmap with literal value
appname=myapp

  • A. kubectl create cm myconfigmap --from-literal=appname=myapp
    // Verify
    kubectl get cm -o yaml
    (or)
    kubectl describe cm
  • B. kubectl create cm myconfigmap --from-literal=appname=myapp
    // Verify
    (or)
    kubectl describe cm

Answer: A

 

NEW QUESTION 53
Create a hostPath PersistentVolume named task-pv-volume with storage 10Gi, access modes ReadWriteOnce, storageClassName manual, and volume at /mnt/data and verify

  • A. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: ""
    capacity:
    storage: 5Gi
    accessModes:
    - ReadWriteOnce
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 4Gi RWO
    Retain Available
    8s
  • B. vim task-pv-volume.yaml
    apiVersion: v1
    kind: PersistentVolume
    metadata:
    name: task-pv-volume
    labels:
    type: local
    spec:
    storageClassName: ""
    capacity:
    storage: 5Gi
    accessModes:
    - ReadWriteOnce
    hostPath:
    path: "/mnt/data"
    kubectl apply -f task-pv-volume.yaml
    //Verify
    kubectl get pv
    NAME CAPACITY ACCESS
    MODES RECLAIM POLICY STATUS CLAIM
    STORAGECLASS REASON AGE
    task-pv-volume 5Gi RWO
    Retain Available
    3s

Answer: B

 

NEW QUESTION 54
Create a persistent volume with name app-data, of capacity 2Gi and access mode ReadWriteMany. The type of volume is hostPath and its location is /srv/app-data.

Answer:

Explanation:
See the solution below.
Explanation
solution
Persistent Volume
A persistent volume is a piece of storage in a Kubernetes cluster. PersistentVolumes are a cluster-level resource like nodes, which don't belong to any namespace. It is provisioned by the administrator and has a particular file size. This way, a developer deploying their app on Kubernetes need not know the underlying infrastructure. When the developer needs a certain amount of persistent storage for their application, the system administrator configures the cluster so that they consume the PersistentVolume provisioned in an easy way.
Creating Persistent Volume
kind: PersistentVolumeapiVersion: v1metadata: name:app-dataspec: capacity: # defines the capacity of PV we are creating storage: 2Gi #the amount of storage we are tying to claim accessModes: # defines the rights of the volume we are creating - ReadWriteMany hostPath: path: "/srv/app-data" # path to which we are creating the volume Challenge
* Create a Persistent Volume named ReadWriteMany, storage classname
shared, 2Gi of storage capacity and the host path

2. Save the file and create the persistent volume.
Image for post

3. View the persistent volume.

* Our persistent volume status is available meaning it is available and it has not been mounted yet. This status will change when we mount the persistentVolume to a persistentVolumeClaim.
PersistentVolumeClaim
In a real ecosystem, a system admin will create the PersistentVolume then a developer will create a PersistentVolumeClaim which will be referenced in a pod. A PersistentVolumeClaim is created by specifying the minimum size and the access mode they require from the persistentVolume.
Challenge
* Create a Persistent Volume Claim that requests the Persistent Volume we had created above. The claim should request 2Gi. Ensure that the Persistent Volume Claim has the same storageClassName as the persistentVolume you had previously created.
kind: PersistentVolumeapiVersion: v1metadata: name:
spec:
accessModes: - ReadWriteMany
requests: storage: 2Gi
storageClassName: shared
2. Save and create the pvc
njerry191@cloudshell:~ (extreme-clone-2654111)$ kubect1 create -f app-data.yaml persistentvolumeclaim/app-data created
3. View the pvc
Image for post

4. Let's see what has changed in the pv we had initially created.
Image for post

Our status has now changed from available to bound.
5. Create a new pod named myapp with image nginx that will be used to Mount the Persistent Volume Claim with the path /var/app/config.
Mounting a Claim
apiVersion: v1kind: Podmetadata: creationTimestamp: null name: app-dataspec: volumes: - name:congigpvc persistenVolumeClaim: claimName: app-data containers: - image: nginx name: app volumeMounts: - mountPath: "/srv/app-data " name: configpvc

 

NEW QUESTION 55
Create a file:
/opt/KUCC00302/kucc00302.txt that lists all pods that implement service baz in namespace development.
The format of the file should be one pod name per line.

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 B.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\11 D.JPG

 

NEW QUESTION 56
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 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

Answer:

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\20 C.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\20 D.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\20 E.JPG

 

NEW QUESTION 57
List all the pods sorted by created timestamp

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get pods--sort-by=.metadata.creationTimestamp

 

NEW QUESTION 58
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.

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 59
......


Average Salary of Linux Foundation-CKA: Certified Kubernetes Administrator Exam Certified Professionals

The average salary of a AI-900: Microsoft Azure AI Fundamentals Exam Outlook and Modules Exam Certified Expert in:

  • United State - 145,112 USD
  • Europe - 105,1100 EURO
  • India - 11,74,223 INR
  • England - 84,784 POUND

 

Linux Foundation CKA Exam Dumps [2021] Practice Valid Exam Dumps Question: https://www.exam4free.com/CKA-valid-dumps.html

CKA Dumps - Grab Out For [NEW-2021] Linux Foundation Exam: https://drive.google.com/open?id=1Dl93wxSJgNuikigPcOwmzdtrgdgqpi3d