100% Pass Top-selling CKA Exams - New 2021 Linux Foundation Pratice Exam
Kubernetes Administrator Dumps CKA Exam for Full Questions - Exam Study Guide
NEW QUESTION 10
Create a deployment spec file that will:
* Launch 7 replicas of the nginx Image 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 that you produced during this task.
Answer:
Explanation:
See the solution below.
Explanation
solution

NEW QUESTION 11
Check the history of the specific revision of that deployment
Answer:
Explanation:
kubectl rollout history deploy webapp --revision=3
NEW QUESTION 12
Scale the deployment from 5 replicas to 20 replicas and verify
Answer:
Explanation:
kubectl scale deploy webapp --replicas=20 kubectl get deploy webapp kubectl get po -l app=webapp
NEW QUESTION 13
Create a Pod nginx and specify a CPU request and a CPU limit of 0.5 and 1 respectively.
- A. // create a yml file
kubectl run nginx-pod --image=nginx --restart=Never --dry-run -
o yaml > nginx-pod.yml
// add the resources section and create
vim nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
cpu: "0.4"
limits:
cpu: "1"
restartPolicy: Always
kubectl apply -f nginx-pod.yaml
// verify
kubectl top pod - B. // create a yml file
kubectl run nginx-pod --image=nginx --restart=Never --dry-run -
o yaml > nginx-pod.yml
// add the resources section and create
vim nginx-pod.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
resources:
requests:
cpu: "0.5"
limits:
cpu: "1"
restartPolicy: Always
kubectl apply -f nginx-pod.yaml
// verify
kubectl top pod
Answer: B
NEW QUESTION 14
Evict all existing pods from a node-1 and make the node unschedulable for new pods.
- A. kubectl get nodes
kubectl drain node-1 #It will evict pods running on node-1 to
other nodes in the cluster
kubectl cordon node-1 # New pods cannot be scheduled to the
node
// Verify
kubectl get no
When you cordon a node, the status shows "SchedulingDisabled" - B. kubectl get nodes
kubectl drain node-1 #It will evict pods running on node-1 to
other nodes in the cluster
// Verify
kubectl get no
When you cordon a node, the status shows "SchedulingDisabled"
Answer: A
NEW QUESTION 15
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:
See the solution below.
Explanation
solution

NEW QUESTION 16
create a pod in a specific node (node1) by placing the pod definition file in a particular folder "/etc/kubernetes/manifests".
- A. Generate YAML before we SSH to the specific node, then copy the YAML into the exam notepad to use it after SSH into worker node.
SSH to the node: "ssh node1"
Gain admin privileges to the node: "sudo -i"
Move to the manifest-path "cd /etc/kubernetes/manifests"
Place the generated YAML into the folder "vi nginx.yaml"
Find the kubelet config file path "ps -aux | grep kubelet" . This
will output information on kubelet process. Locate the kubelet config
file location.
kubelet config file -- /var/lib/kubelet/config.yaml
Edit the config file "vi /var/lib/kubelet/config.yaml" to add
staticPodPath
staticPodPath: /etc/kubernetes/manifests
Restart the kubelet "systemctl restart kubelet" - B. Generate YAML before we SSH to the specific node, then copy the YAML into the exam notepad to use it after SSH into worker node.
SSH to the node: "ssh node1"
Gain admin privileges to the node: "sudo -i"
Move to the manifest-path "cd /etc/kubernetes/manifests"
kubelet config file -- /var/lib/kubelet/config.yaml
Edit the config file "vi /var/lib/kubelet/config.yaml" to add
staticPodPath
staticPodPath: /etc/kubernetes/manifests
Restart the kubelet "systemctl restart kubelet"
Answer: A
NEW QUESTION 17
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 18
Create a pod as follows:
* Name: non-persistent-redis
* container Image: redis
* Volume with name: cache-control
* Mount path: /data/redis
The pod should launch in the staging namespace and the volume must not be persistent.
Answer:
Explanation:
See the solution below.
Explanation
solution


NEW QUESTION 19
Ensure a single instance of pod nginx is running on each node of the Kubernetes cluster where nginx also represents the Image name which has to be used. Do not override any taints currently in place.
Use DaemonSet to complete this task and use ds-kusc00201 as DaemonSet name.
Answer:
Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\3 B.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\3 C.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\3 D.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\3 E.JPG
NEW QUESTION 20
Create a redis pod, and have it use a non-persistent storage
(volume that lasts for the lifetime of the Pod)
- A. vim redis-pod-vol.yaml
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6379
volumeMounts:
- mountPath: /data
name: redis-storage
volumes:
- name: redis-storage
emptyDir: {}
kubectl apply -f redis-pod-vol.yaml - B. vim redis-pod-vol.yaml
apiVersion: v1
kind: Pod
metadata:
name: redis
spec:
containers:
- name: redis
image: redis
ports:
- containerPort: 6679
volumeMounts:
- mountPath: /data
name: redis-storage
volumes:
- name: redis-storage
emptyDir: {}
kubectl apply -f redis-pod-vol.yaml
Answer: A
NEW QUESTION 21
Create a file called "config.txt" with two values key1=value1
and key2=value2. Then create a configmap named "keyvalcfgmap" andread data from the file "config.txt" and verify that configmap is created correctly
- A. cat >> config.txt << EOF
key1=value1
key2=value2
EOF
cat config.txt
// Create configmap from "config.txt" file
kubectl create cm keyvalcfgmap --from-file=config.txt
//Verify
kubectl get cm keyvalcfgmap -o yaml - B. cat >> config.txt << EOF
key1=value1
key2=value2
EOF
kubectl create cm keyvalcfgmap --from-file=config.txt
//Verify
kubectl get cm keyvalcfgmap -o yaml
Answer: A
NEW QUESTION 22
Create a busybox pod that runs the command "env" and save the output to "envpod" file
Answer:
Explanation:
See the solution below.
Explanation
kubectl run busybox --image=busybox --restart=Never --rm -it -- env > envpod.yaml
NEW QUESTION 23
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.
Answer:
Explanation:
Create a second pod named pod-secrets-via-env, using the redis Image, which exports password as CONFIDENTIAL See the solution below.
Explanation
solution


NEW QUESTION 24
Score: 7%
Task
Reconfigure the existing deployment front-end and add a port specification named http exposing port 80/tcp of the existing container nginx.
Create a new service named front-end-svc exposing the container port http.
Configure the new service to also expose the individual Pods via a NodePort on the nodes on which they are scheduled.
Answer:
Explanation:
See the solution below.
Explanation
Solution:
kubectl get deploy front-end
kubectl edit deploy front-end -o yaml
#port specification named http
#service.yaml
apiVersion: v1
kind: Service
metadata:
name: front-end-svc
labels:
app: nginx
spec:
ports:
- port: 80
protocol: tcp
name: http
selector:
app: nginx
type: NodePort
# kubectl create -f service.yaml
# kubectl get svc
# port specification named http
kubectl expose deployment front-end --name=front-end-svc --port=80 --tarport=80 --type=NodePort
NEW QUESTION 25
List all configmap and secrets in the cluster in all namespace and write it to a file /opt/configmap-secret
Answer:
Explanation:
kubectl get configmap,secrets --all-namespaces > /opt/configmap-secret // Verify Cat /opt/configmap-secret
NEW QUESTION 26
Create a deployment as follows:
Name: nginx-random
Exposed via a service nginx-random
Ensure that the service & 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 & pod and write the output to
/opt/KUNW00601/service.dns and /opt/KUNW00601/pod.dns respectively.
Answer:
Explanation:
See the solution below.
Explanation
Solution:
F:\Work\Data Entry Work\Data Entry\20200827\CKA\17 C.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\17 D.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\17 E.JPG
NEW QUESTION 27
Ensure a single instance of podnginxis running on each node of theKubernetes cluster wherenginxalso represents the Image name whichhas to be used. Do not override anytaints currently in place.
UseDaemonSetto complete thistask and useds-kusc00201asDaemonSet name.
Answer:
Explanation:
See the solution below.
Explanation
solution



NEW QUESTION 28
Create an nginx pod and set an env value as 'var1=val1'. Check the env value existence within the pod
- A. kubectl run nginx --image=nginx --restart=Never --env=var1=val1
# then
kubectl exec -it nginx -- env
# or
kubectl exec -it nginx -- sh -c 'echo $var1'
# or
kubectl describe po nginx | grep val1
# or
kubectl run nginx --restart=Never --image=nginx --env=var1=val1
-it --rm - env - B. kubectl run nginx --image=nginx --restart=Never --env=var1=val1
# then
kubectl exec -it nginx -- env
# or
kubectl run nginx --restart=Never --image=nginx --env=var1=val1
-it --rm -- env
Answer: A
NEW QUESTION 29
Resume the rollout of the deployment
Answer:
Explanation:
kubectl rollout resume deploy webapp
NEW QUESTION 30
List "nginx-dev" and "nginx-prod" pod and delete those pods
Answer:
Explanation:
See the solution below.
Explanation
kubect1 get pods -o wide
kubectl delete po "nginx-dev"kubectl delete po "nginx-prod"
NEW QUESTION 31
......
Authentic Best resources for CKA Online Practice Exam: https://www.dumpsvalid.com/CKA-still-valid-exam.html
CKA Test Engine Practice Exam: https://drive.google.com/open?id=1njWyKbkqj89Afsbz-Pofsjn41HIeJ5IZ