Get New 2021 Linux Foundation CKA Exam Dumps Bundle On flat Updated Dumps! [Q29-Q47]

Share

Get New 2021 Linux Foundation exam CKA Dumps Bundle On flat Updated Dumps!

Full CKA Practice Test and 63 unique questions with explanations waiting just for you, get it now!

NEW QUESTION 29
Create a deployment spec file thatwill:
* Launch 7 replicas of thenginxImage with the labelapp_runtime_stage=dev
* deployment name:kual00201
Save a copy of this spec file to/opt/KUAL00201/spec_deployment.yaml
(or/opt/KUAL00201/spec_deployment.json).
When you are done, clean up (delete)any new Kubernetes API object thatyou produced during this task.

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 30
List all service account and create a service account called "admin"

  • A. kubectl get sa
    kubectl get sa --all-namespaces
    //Verify
    kubectl get sa admin -o yaml
  • B. kubectl get sa
    kubectl get sa --all-namespaces
    kubectl create sa admin
    //Verify
    kubectl get sa admin -o yaml

Answer: B

 

NEW QUESTION 31
Create a pod as follows:
* Name:mongo
* Using Image:mongo
* In anew Kubernetes namespacenamed:my-website

Answer:

Explanation:
See the solution below.
Explanation
solution

 

NEW QUESTION 32
Schedule a pod as follows:
Name: nginx-kusc00101
Image: nginx
Node selector: disk=ssd

Answer:

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

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

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

 

NEW QUESTION 33
Create a persistent volume with nameapp-data, of capacity2Giandaccess modeReadWriteMany. Thetype of volume ishostPathand itslocation is/srv/app-data.

Answer:

Explanation:
See the solution below.
Explanation
solution
Persistent Volume
A persistent volume is a piece of storage in aKubernetes 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 knowthe 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 PersistentVolume
kind: PersistentVolumeapiVersion: v1metadata:name:app-dataspec:capacity: # defines the capacity of PV we are creatingstorage:2Gi#the amount of storage we are tying to claimaccessModes: # defines the rights of the volumewe are creating-ReadWriteManyhostPath:path: "/srv/app-data" # path to which we are creating the volume Challenge
* Create a Persistent Volume named ReadWriteMany, storage classname
shared,2Giof 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 willchange 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. Ensurethat the Persistent Volume Claim has the same storageClassName as the persistentVolume you had previously created.
kind: PersistentVolumeapiVersion: v1metadata:name:
spec:
accessModes:-ReadWriteManyresources:
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 fromavailabletobound.
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: nullname: app-dataspec:volumes:- name:congigpvcpersistenVolumeClaim:claimName: app-datacontainers:- image: nginxname:
appvolumeMounts:- mountPath: "

 

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

Answer:

Explanation:
Kubectl logs frontend | grep -i "started" > /opt/error-logs

 

NEW QUESTION 35
Apply the autoscaling to this deployment with minimum 10 and maximum 20 replicas and target CPU of 85% and verify hpa is created and replicas are increased to 10 from 1

Answer:

Explanation:
kubectl autoscale deploy webapp --min=10 --max=20 --cpu percent=85 kubectl get hpa kubectl get pod -l app=webapp

 

NEW QUESTION 36
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 37
Create a deployment as follows:
* Name:nginx-app
* Using containernginxwithversion 1.11.10-alpine
* The deployment should contain3replicas
Next, deploy the application with newversion1.11.13-alpine, byperforming a rolling update.
Finally, rollback that update to theprevious version1.11.10-alpine.

Answer:

Explanation:
See the solution below.
Explanation
solution


 

NEW QUESTION 38
Create a redis pod and mount "redis-config" as "redis.conf"
inside redis container, name the config volume as "redis-volume"
redis-config path - /opt/redis-config

  • A. 0
  • B. 1
  • C. Pending

Answer: C

 

NEW QUESTION 39
Get the number of schedulable nodes and write to a file
/opt/schedulable-nodes.txt

  • A. kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name}
    {.spec.taints[?(@.effect=='NoSchedule')].effect}{\"\n\"}{end}"
    | awk 'NF==11 {print $0}' > /opt/schedulable-nodes.txt
    // Verify
    cat /opt/schedulable-nodes.txt
  • B. kubectl get nodes -o jsonpath="{range
    .items[*]}{.metadata.name}
    {.spec.taints[?(@.effect=='NoSchedule')].effect}{\"\n\"}{end}"
    | awk 'NF==1 {print $0}' > /opt/schedulable-nodes.txt
    // Verify
    cat /opt/schedulable-nodes.txt

Answer: B

 

NEW QUESTION 40
Create a pod with image nginx called nginx and allow traffic on port 80

Answer:

Explanation:
See the solution below.
Explanation
kubectlrun nginx --image=nginx --restart=Never --port=80

 

NEW QUESTION 41
Perform the following tasks:
* Add an init container tohungry-bear(which has beendefined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
* The init container should createan empty file named/workdir/calm.txt
* If/workdir/calm.txtis notdetected, the pod should exit
* Once the spec file has beenupdatedwith the init containerdefinition, the pod should becreated

Answer:

Explanation:
See the solution below.
Explanation
solution


 

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
Check the rollout history and make sure everything is ok after the update

  • A. kubectl rollout history deploy webapp
    kubectl get deploy webapp --show-labels
    kubectl get rs -
    kubectl get po -l app=webapp
  • B. kubectl rollout history deploy webapp
    kubectl get deploy webapp --show-labels
    kubectl get rs -l app=webapp
    kubectl get po -l app=webapp

Answer: B

 

NEW QUESTION 44
Create a namespace called 'development' and a pod with image nginx called nginx on this namespace.

Answer:

Explanation:
kubectl create namespace development kubectl run nginx --image=nginx --restart=Never -n development

 

NEW QUESTION 45
What file type upload is supported as part of the basic WildFire service?

  • A. BAT
  • B. VBS
  • C. PE
  • D. ELF

Answer: C

 

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

Answer:

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

 

NEW QUESTION 47
......

[Sep-2021] Pass Linux Foundation CKA Exam in First Attempt Guaranteed: https://drive.google.com/open?id=1tQwpGh2vlqybrjvXopz48lSuu5Acpy_w

Reduce Your Chance of Failure in CKA Exam: https://www.actualtests4sure.com/CKA-test-questions.html