TAKE Kubernetes Administrator CKA PRACTICE QUESTIONS FOR AMAZING RESULTS [Q40-Q63]

Share

TAKE Kubernetes Administrator CKA PRACTICE QUESTIONS FOR AMAZING RESULTS

 Linux Foundation CKA Exam Dumps Are Essential To Get Good Marks


What are the steps involved in taking the CNCF CKA Certification Exam?

First, you should decide which exam provider to choose. Answer the questions in order to get 90% or above. Team up with a buddy who is going through the same course in order to get answers from each other. You can start with a free trial in order to know the kind of results you will achieve. Discussed will be available for tests. Marks will be important for the CNCF CKA Certification Exam. The exam will tell you how to manage containers. You can use different resources. CNCF CKA Dumps will be important for the CNCF CKA Certification Exam. Valid will be important for the CNCF CKA Certification Exam. Customized study guides will be important for the CNCF CKA Certification Exam. Accessing will be important for the CNCF CKA Certification Exam.

Cerification-Questions is a website that contains all the exam dumps practice questions you need to get certified. It is one of the most popular certification sites that are available online. Support will be available for the CNCF CKA Certification Exam. Attempt will be important for the CNCF CKA Certification Exam. Method will be available for all concerned. Access will be available for the CNCF CKA Certification Exam. Discount will be available for the CNCF CKA Certification Exam. You will have to show that you are willing to take the exam. Purchase will be important for students who want to get certified.

 

NEW QUESTION 40
Create a pod with init container which create a file "test.txt"
in "workdir" directory. Main container should check a file
"test.txt" exists and execute sleep 9999 if the file exists.

  • A. // create an initial yaml file with this
    kubectl run init-cont-pod --image=alpine --restart=Never --dry-run -o
    yaml > init-cont-pod.yaml
    // edit the yml as below and create it
    vim init-cont-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: init-cont-pod
    labels:
    app: myapp
    spec:
    volumes:
    - name: test-volume
    emptyDir: {}
    containers:
    - name: main-container
    image: busybox:1.28
    command: ['sh', '-c', 'if [ -f /workdir/test.txt ]; then sleep
    9999; fi']
    volumeMounts:
    image: busybox:1.28
    command: ['sh', '-c', "mkdir /workdir; echo >
    /workdir/test.txt"]
    volumeMounts:
    - name: test-volume
    mountPath: /workdir
    // Create the pod
    kubectl apply -f init-cont-pod.yaml
    kubectl get pods
    // Check Events by doing
    kubectl describe po init-cont-pod
    Init Containers:
    init-myservice:
    Container ID:
    docker://ebdbf5fad1c95111d9b0e0e2e743c2e347c81b8d4eb5abcccdfe1dd74524
    0d4f
    Image: busybox:1.28
    Image ID: dockerpullable://busybox@sha256:141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df
    416dea4f41046e0f37d47
    Port: <none>
    Host Port: <none>
    Command:
    sh
    -c
    mkdir /workdir; echo > /workdir/test.txt
    State: Terminated Reason: Completed
  • B. // create an initial yaml file with this
    kubectl run init-cont-pod --image=alpine --restart=Never --dry-run -o
    yaml > init-cont-pod.yaml
    // edit the yml as below and create it
    vim init-cont-pod.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: init-cont-pod
    labels:
    app: myapp
    spec:
    volumes:
    - name: test-volume
    emptyDir: {}
    containers:
    - name: main-container
    image: busybox:1.28
    command: ['sh', '-c', 'if [ -f /workdir/test.txt ]; then sleep
    9999; fi']
    volumeMounts:
    - name: test-volume
    mountPath: /workdir
    initContainers:
    - name: init-myservice
    image: busybox:1.28
    command: ['sh', '-c', "mkdir /workdir; echo >
    /workdir/test.txt"]
    volumeMounts:
    - name: test-volume
    mountPath: /workdir
    // Create the pod
    kubectl apply -f init-cont-pod.yaml
    kubectl get pods
    // Check Events by doing
    kubectl describe po init-cont-pod
    Init Containers:
    init-myservice:
    Container ID:
    docker://ebdbf5fad1c95111d9b0e0e2e743c2e347c81b8d4eb5abcccdfe1dd74524
    0d4f
    Image: busybox:1.28
    Image ID: dockerpullable://busybox@sha256:141c253bc4c3fd0a201d32dc1f493bcf3fff003b6df
    416dea4f41046e0f37d47
    Port: <none>
    Host Port: <none>
    Command:
    sh
    -c
    mkdir /workdir; echo > /workdir/test.txt
    State: Terminated Reason: Completed

Answer: B

 

NEW QUESTION 41
List all the pods sorted by name

Answer:

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

 

NEW QUESTION 42
Task Weight: 4%

Task
Scale the deployment webserver to 3 pods.

Answer:

Explanation:
Solution:

 

NEW QUESTION 43
Print all pod name and all image name and write it to a file
name "/opt/pod-details.txt"

Answer:

Explanation:
kubectl get pods -o=custom-columns='Pod Name:metadata.name','Image:spec.containers[*].image' > /opt/pod-details.txt

 

NEW QUESTION 44
Get list of all the pods showing name and namespace with a jsonpath expression.

Answer:

Explanation:
See the solution below.
Explanation
kubectl get pods -o=jsonpath="{.items[*]['metadata.name'
, 'metadata.namespace']}"

 

NEW QUESTION 45
Score: 4%

Context
You have been asked to create a new ClusterRole for a deployment pipeline and bind it to a specific ServiceAccount scoped to a specific namespace.
Task
Create a new ClusterRole named deployment-clusterrole, which only allows to create the following resource types:
* Deployment
* StatefulSet
* DaemonSet
Create a new ServiceAccount named cicd-token in the existing namespace app-team1.
Bind the new ClusterRole deployment-clusterrole lo the new ServiceAccount cicd-token , limited to the namespace app-team1.

Answer:

Explanation:
See the solution below.
Explanation
Solution:
Task should be complete on node -1 master, 2 worker for this connect use command
[student@node-1] > ssh k8s
kubectl create clusterrole deployment-clusterrole --verb=create
--resource=deployments,statefulsets,daemonsets
kubectl create serviceaccount cicd-token --namespace=app-team1
kubectl create rolebinding deployment-clusterrole --clusterrole=deployment-clusterrole
--serviceaccount=default:cicd-token --namespace=app-team1

 

NEW QUESTION 46
Update the deployment with the image version 1.17.4 and verify

  • A. kubectl set image deploy/webapp nginx=nginx:1.17.4
    //Verify
    kubectl describe deploy webapp | grep Image
    kubectl get deploy -o=jsonpath='{range.items [*]}{.[*]}
    {.metadata.name}{"\t"}{.spec.template.spec.containers[*].i
    mage}{"\n"}'
  • B. kubectl set image deploy/webapp nginx=nginx:1.17.4
    //Verify
    kubectl describe deploy webapp | grep Image
    kubectl get deploy -
    {.metadata.name}{"\t"}{.spec.template.spec.containers[*].i
    mage}{"\n"}'

Answer: A

 

NEW QUESTION 47
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 48
Schedule a pod as follows:
* Name: nginx-kusc00101
* Image: nginx
* Node selector: disk=ssd

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 49
Fix a node that shows as non-ready

  • A. Kubectl get nodes
    // Check which node shows a not ready
    kubectl describe nodes "node-name"
    // Login to the node which shows as not ready and check the
    process for kubelet, docker , kube-proxy.
    // systemctl status kubelet (or) ps -aux | grep -i "processname"
    // If the process is not started, then start using
    systemctl start kubelet / docker
    // Verify
    ps -auxxww | grep -i "process-name"
    kubectl get nodes
  • B. Kubectl get nodes
    // Check which node shows a not ready
    kubectl describe nodes "node-name"
    // Login to the node which shows as not ready and check the
    systemctl start kubelet / docker
    // Verify
    ps -auxxww | grep -i "process-name"
    kubectl get nodes

Answer: A

 

NEW QUESTION 50
Score: 4%

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

Answer:

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 51
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:
solution


 

NEW QUESTION 52
Score: 4%

Task
Schedule a pod as follows:
* Name: nginx-kusc00401
* Image: nginx
* Node selector: disk=ssd

Answer:

Explanation:
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

 

NEW QUESTION 53
Create a deployment called webapp with image nginx having 5 replicas in it, put the file in /tmp directory with named webapp.yaml

  • A. //Create a file using dry run command
    kubectl create deploy --image=nginx --dry-run -o yaml >
    /tmp/webapp.yaml
    // Now, edit file webapp.yaml and update replicas=5
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: webapp
    name: webapp
    spec:
    replicas: 5
    selector:
    matchLabels:
    app: webapp
    template:
    metadata:
    labels:
    Note: Search "deployment" in kubernetes.io site , you will get
    the page
    https://kubernetes.io/docs/concepts/workloads/controllers/deplo
    yment/
    // Verify the Deployment
    kubectl get deploy webapp --show-labels
    // Output the YAML file of the deployment webapp
    kubectl get deploy webapp -o yaml
  • B. //Create a file using dry run command
    kubectl create deploy --image=nginx --dry-run -o yaml >
    /tmp/webapp.yaml
    // Now, edit file webapp.yaml and update replicas=5
    apiVersion: apps/v1
    kind: Deployment
    metadata:
    labels:
    app: webapp
    name: webapp
    spec:
    replicas: 5
    selector:
    matchLabels:
    app: webapp
    template:
    metadata:
    labels:
    app: webapp
    spec:
    containers:
    - image: nginx
    name: nginx
    Note: Search "deployment" in kubernetes.io site , you will get
    the page
    https://kubernetes.io/docs/concepts/workloads/controllers/deplo
    yment/
    // Verify the Deployment
    kubectl get deploy webapp --show-labels
    // Output the YAML file of the deployment webapp
    kubectl get deploy webapp -o yaml

Answer: B

 

NEW QUESTION 54
Create a pod named kucc8 with a single app container for each of the
following images running inside (there may be between 1 and 4 images specified):
nginx + redis + memcached.

Answer:

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

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

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

 

NEW QUESTION 55
Create a ETCD backup of kubernetes cluster
Note : You don't need to memorize command, refer -
https://kubernetes.io/docs/tasks/administer-cluster/configureupgrade-etcd/ during exam

  • A. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.17.0.15:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    cacert=/etc/kubernetes/pki/etcd/ca.crt --
    cert=/etc/kubernetes/pki/etcd/server.crt --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db
  • B. ETCDCTL_API=3 etcdctl --endpoints=[ENDPOINT] --cacert=[CA CERT]
    --cert=[ETCD SERVER CERT] --key=[ETCD SERVER KEY] snapshot save
    [BACKUP FILE NAME]
    In exam, cluster setup is done with kubeadm , this means ETCD
    used by the kubernetes cluster is coming from static pod.
    kubectl get pod -n kube-system
    kubectl describe pod etcd-master -n kube-system
    You can locate the information on
    endpoint: - advertise-client-urls=https://172.16.0.18:2379
    ca certificate: - trusted-cafile=/etc/kubernetes/pki/etcd/ca.crt
    server certificate : - certfile=/etc/kubernetes/pki/etcd/server.crt
    key: - key-file=/etc/kubernetes/pki/etcd/server.key
    To Create backup
    export ETCDCTL_API=3
    (or)
    ETCDCTL_API=3 etcdctl ETCDCTL_API=3 etcdctl --
    endpoints=https://172.17.0.15:2379 --
    key=/etc/kubernetes/pki/etcd/server.key snapshot save etcdsnapshot.db
    //Verify
    ETCDCTL_API=3 etcdctl --write-out=table snapshot status
    snapshot.db

Answer: A

 

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


 

NEW QUESTION 57
From the pod label name=cpu-utilizer, find pods running high CPU workloads and write the name of the pod consuming most CPU to the file /opt/KUTR00102/KUTR00102.txt (which already exists).

Answer:

Explanation:
solution

 

NEW QUESTION 58
Create a snapshot of theetcdinstance running at , saving thesnapshot to the file path
/srv/data/etcd-snapshot.db.
The following TLScertificates/key are suppliedfor connecting to the server withetcdctl:
* 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 59
View certificate details in /etc/kubernetes/pki

Answer:

Explanation:
// Verify Public Key / Certificate file Openssl x509 -in certificate.crt -noout -text // Verify Private Key Openssl rsa -in "private-key" -check // Verify CSR Openssl req -text -noout -verify

 

NEW QUESTION 60
Create a secret mysecret with values user=myuser and password=mypassword

  • A. kubectl create secret generic my-secret --fromliteral=username=user --from-literal=password=mypassword
    // Verify
    kubectl get secret --all-namespaces
    kubectl get secret generic my-secret -o yaml
  • B. kubectl create secret generic my-secret --fromliteral=username=user --from-literal=password=mypassword
    // Verify
    kubectl get secret generic my-secret -o yaml

Answer: A

 

NEW QUESTION 61
Score: 4%

Task
Check to see how many nodes are ready (not including nodes tainted NoSchedule ) and write the number to
/opt/KUSC00402/kusc00402.txt

Answer:

Explanation:
See the solution below.
Explanation
Solution:
kubectl describe nodes | grep ready|wc -l
kubectl describe nodes | grep -i taint | grep -i noschedule |wc -l
echo 3 > /opt/KUSC00402/kusc00402.txt
#
kubectl get node | grep -i ready |wc -l
# taintsnoSchedule
kubectl describe nodes | grep -i taints | grep -i noschedule |wc -l
#
echo 2 > /opt/KUSC00402/kusc00402.txt

 

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

Answer:

Explanation:
See the solution below.
Explanation
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

 

NEW QUESTION 63
......


The Key Subjects for CNCF CKA Certification Exam

The CNCF Certified Kubernetes Administrator exam focuses on the deployment, management, and troubleshooting of applications running on Kubernetes clusters. Competition to get on the shortlists for CNCF Certified Kubernetes Administrator certification is fierce. Control over the major features of Kubernetes is crucial in passing the CNCF Certified Kubernetes Administrator exam. CNCF CKA exam dumps is recommended for candidates who want to find out more. Application of knowledge from the study guide to real life configuration will help candidates pass the CNCF Certified Kubernetes Administrator exam. Aspects of Kubernetes are crucial to passing the CNCF Certified Kubernetes Administrator exam. Product managers are operating the Kubernetes dashboard panel by using the dashboard panel. The format of options of the information displayed on the dashboard panel may change in the future. Months after the CNCF Certified Kubernetes Administrator certification exam has been released, changes will be made to the format of the portions of the dashboard panel that will be important to those who want to pass the exam.

Clients seeking to hire a Kubernetes engineer need to have a solid understanding of vendor offerings in order to secure the best options. Feel confident about your Kubernetes environment before taking the CNCF CKA exam. A perfect understanding of vendor offerings will be a major factor in passing the CNCF Certified Kubernetes Administrator exam. Basic knowledge of Kubernetes configuration for the CNCF CKA exam will help candidates pass the CNCF Certified Kubernetes Administrator exam. Configure Kubernetes to work with external software. Satisfied clients will be in a position to recommend Kubernetes engineers.


Linux Foundation CKA Exam Syllabus Topics:

TopicDetails
Topic 1
  • Understand connectivity between Pods
  • Troubleshoot application failure
  • Use Kubeadm to install a basic cluster
Topic 2
  • Understand how resource limits can affect Pod scheduling
  • Use ConfigMaps and Secrets to configure applications
Topic 3
  • Awareness of manifest management and common templating tools
  • Understand storage classes, persistent volumes
Topic 4
  • Understand deployments and how to perform rolling update and rollbacks
  • Manage a highly-available Kubernetes cluster
Topic 5
  • Know how to use Ingress controllers and Ingress resources
  • Understand how to monitor applications
Topic 6
  • Understand host networking configuration on the cluster nodes
  • Evaluate cluster and node logging
Topic 7
  • Know how to configure and use CoreDNS
  • Troubleshoot cluster component failure
  • Implement etcd backup and restore
Topic 8
  • Manage role based access control (RBAC)
  • Know how to scale applications
  • Understand the primitives used to create robust
Topic 9
  • Perform a version upgrade on a Kubernetes cluster using Kubeadm
  • Understand volume mode, access modes and reclaim policies for volumes
Topic 10
  • Choose an appropriate container network interface plugin
  • Know how to configure applications with persistent storage

 

Latest Linux Foundation CKA Dumps with Test Engine and PDF (New Questions): https://www.practicevce.com/Linux-Foundation/CKA-practice-exam-dumps.html

Pass Your CKA Exam Easily - Real CKA Practice Dump Updated: https://drive.google.com/open?id=1Esm8avxvu38Pq1lB69XRfNaInvRKNl-k