You are on page 1of 59

LinuxFoundation.CKA.v2022-03-25.

q61

Exam Code: CKA


Exam Name: Certified Kubernetes Administrator (CKA) Program Exam
Certification Provider: Linux Foundation
Free Question Number: 61
Version: v2022-03-25
# of views: 110
# of Questions views: 678
https://www.freecram.net/torrent/LinuxFoundation.CKA.v2022-03-25.q61.html

NEW QUESTION: 1
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:
See the solution below.
Explanation
solution
NEW QUESTION: 2
List pod logs named "frontend" and search for the pattern "started" and write it to a file "/opt/error-
logs"
Answer:
Kubectl logs frontend | grep -i "started" > /opt/error-logs

NEW QUESTION: 3
What file type upload is supported as part of the basic WildFire service?
A. PE
B. BAT
C. ELF
D. VBS
Answer: (SHOW ANSWER)

NEW QUESTION: 4
Create a redis pod and expose it on port 6379
A. kubectl run redis --image=redis --restart=Never --port=6379
YAML File :
apiVersion: v1
kind: Pod
metadata:
labels:
run: redis
name: redis
spec:
containers:
ports:
- containerPort: 6679
Rt restartPolicy: Alwaysf
B. kubectl run redis --image=redis --restart=Never --port=6379
YAML File :
apiVersion: v1
kind: Pod
metadata:
labels:
run: redis
name: redis
spec:
containers:
- image: redis
name: redis
ports:
- containerPort: 6379
Rt restartPolicy: Always
Answer: (SHOW ANSWER)

NEW QUESTION: 5
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:
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: 6
Create a pod that echo "hello world" and then exists. Have the pod deleted automatically when
it's completed
Answer:
See the solution below.
Explanation
kubectl run busybox --image=busybox -it --rm --restart=Never --
/bin/sh -c 'echo hello world'
kubectl get po # You shouldn't see pod with the name "busybox"

NEW QUESTION: 7
Create and configure the service front-end-service so it's accessible through NodePort and routes
to the existing pod named front-end.
Answer:
See the solution below.
Explanation
solution

NEW QUESTION: 8
From the pod labelname=cpu-utilizer, find podsrunning high CPU workloads and write the name
of the pod consumingmost CPU to thefile/opt/KUTR00102/KUTR00102.txt(which already exists).
Answer:
See the solution below.
Explanation
solution

NEW QUESTION: 9
Get the DNS records for the service and pods for the deployment redis and the put the value
in /tmp/dnsrecordpod and /tmp/dnsrecord-service
A. // Get Pod Ip
kubectl get po -o wide
// Get Service Name
kubectl get svc
// Create a temporary pod and execute nslookup command
Note: POD IP format should be a-b-c-d and not a.b.c.d
kubectl run busybox --image=busybox:1.28 --restart=Never -
-rm -it -- nslookup 192-168-0-69.default.pod >
/tmp/dnsrecord-pod
kubectl run busybox1 --image=busybox:1.26 --restart=Never
--rm -it -- nslookup redis-service > /tmp/dnsrecordservice
//Verify
cat /tmp/dnsrecord-pod
Server: 10.2.8.10
Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod
Address 1: 192.168.0.69 192-166-0-69.redis service.default.svc.cluster.local cat /tmp/dnsrecord-
pod Server: 10.2.0.10 Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name:
192-168-0-69.default.pod Address 1: 192.168.0.69 192-168-0-69.redis
service.default.svc.cluster.local
B. // Get Pod Ip
kubectl get po -o wide
// Get Service Name
kubectl get svc
// Create a temporary pod and execute nslookup command
Note: POD IP format should be a-b-c-d and not a.b.c.d
kubectl run busybox --image=busybox:1.28 --restart=Never -
-rm -it -- nslookup 192-168-0-69.default.pod >
/tmp/dnsrecord-pod
kubectl run busybox1 --image=busybox:1.28 --restart=Never
--rm -it -- nslookup redis-service > /tmp/dnsrecordservice
//Verify
cat /tmp/dnsrecord-pod
Server: 10.2.0.10
Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name: 192-168-0-69.default.pod
Address 1: 192.168.0.69 192-168-0-69.redis service.default.svc.cluster.local cat /tmp/dnsrecord-
pod Server: 10.2.0.10 Address 1: 10.2.0.10 kube-dns.kube system.svc.cluster.local Name:
192-168-0-69.default.pod Address 1: 192.168.0.69 192-168-0-69.redis
service.default.svc.cluster.local
Answer: (SHOW ANSWER)
NEW QUESTION: 10
Answer:
kubectl uncordon node-1 //verify kubectl get no

NEW QUESTION: 11
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 -
{.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 -o=jsonpath='{range.items [*]}{.[*]}
{.metadata.name}{"\t"}{.spec.template.spec.containers[*].i
mage}{"\n"}'
Answer: (SHOW ANSWER)

NEW QUESTION: 12
Create a busybox pod and add "sleep 3600" command
Answer:
kubectl run busybox --image=busybox --restart=Never -- /bin/sh -c "sleep 3600"

NEW QUESTION: 13
Create a nginx pod with label env=test in engineering namespace
Answer:
See the solution below.
Explanation
kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering --
dry-run -o yaml > nginx-pod.yaml kubectl run nginx --image=nginx --restart=Never --
labels=env=test --namespace=engineering --dry-run -o yaml | kubectl create -nengineering-f -
YAML File:
apiVersion: v1
kind: Pod
metadata:
name: nginx
namespace: engineering
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
restartPolicy: Never
kubectl create -f nginx-pod.yaml

NEW QUESTION: 14
List all the pods showing name and namespace with a json path expression
Answer:
kubectl get pods -o=jsonpath="{.items[*]['metadata.name', 'metadata.namespace']}"

NEW QUESTION: 15
Check the image version in pod without the describe command
Answer:
See the solution below.
Explanation
kubectl get po nginx -o
jsonpath='{.spec.containers[].image}{"\n"}'

NEW QUESTION: 16
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:
See the solution below.
Explanation
solution
Valid CKA Dumps shared by Fast2test.com for Helping Passing CKA Exam! Fast2test.com
now offer the newest CKA exam dumps, the Fast2test.com CKA exam questions have
been updated and answers have been corrected get the newest Fast2test.com CKA dumps
with Test Engine here: https://www.fast2test.com/CKA-premium-file.html (63 Q&As Dumps,
30%OFF Special Discount: freecram)

NEW QUESTION: 17
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:
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: 18
Configure the kubelet systemd- managed service, on the node labelled with name=wk8s-node-1,
to launch a pod containing a single container of Image httpd named webtool automatically. Any
spec files required should be placed in the /etc/kubernetes/manifests directory on the node.
You can ssh to the appropriate node using:
[student@node-1] $ ssh wk8s-node-1
You can assume elevated privileges on the node with the following command:
[student@wk8s-node-1] $ | sudo -i
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 C.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 D.JPG

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


F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 F.JPG

F:\Work\Data Entry Work\Data Entry\20200827\CKA\21 G.JPG


NEW QUESTION: 19
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:
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: 20
A. Task Manager
B. Configuration Logs
C. Traffic Logs
D. System Logs
Answer: (SHOW ANSWER)

NEW QUESTION: 21
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:
- 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
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:
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
Answer: (SHOW ANSWER)

NEW QUESTION: 22
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: (SHOW ANSWER)

NEW QUESTION: 23
Create and configure the service front-end-service so it's accessible through NodePort and routes
to the existing pod named front-end.
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\8 B.JPG

NEW QUESTION: 24
Score: 7%

Task
Create a new nginx Ingress resource as follows:
* Name: ping
* Namespace: ing-internal
* Exposing service hi on path /hi using service port 5678
Answer:
See the solution below.
Explanation
Solution:
vi ingress.yaml
#
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ping
namespace: ing-internal
spec:
rules:
- http:
paths:
- path: /hi
pathType: Prefix
backend:
service:
name: hi
port:
number: 5678
#
kubectl create -f ingress.yaml

NEW QUESTION: 25
For this item, you will havetosshto the nodesik8s-master-0andik8s-node-0and complete all tasks
on thesenodes. Ensure that you return tothe base node (hostname:node-1) when you
havecompleted this item.
Context
As an administrator of a smalldevelopment team, you have beenasked to set up a Kubernetes
clusterto test the viability of a newapplication.
Task
You must usekubeadmto performthis task. Anykubeadminvocationswill require the use of the
--ignore-preflight-errors=alloption.
* Configure thenodeik8s-master-Oas a masternode. .
* Join the nodeik8s-node-otothe cluster.
Answer:
See the solution below.
Explanation
solution
You must use thekubeadmconfiguration file located at when initializingyour cluster.
You may use any CNI pluginto complete this task, but ifyou don't have your favouriteCNI plugin's
manifest URL athand, Calico is one
popularoption:https://docs.projectcalico.org/v3.14/manifests/calico.yaml Docker is already
installedon both nodes and hasbeen configured so that you caninstall the required tools.

NEW QUESTION: 26
Create a nginx pod with label env=test in engineering namespace
See the solution below.
A. kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering
--dry-run -o yaml > nginx-pod.yaml kubectl run nginx --image=nginx --restart=Never --
labels=env=test --namespace=engineering --dry-run -o yaml | kubectl create -n engineering -f -
YAML File:
apiVersion: v1
kind: Pod
metadata:
name: nginx
namespace: engineering
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
restartPolicy: Never
kubectl create -f nginx-pod.yaml
B. kubectl run nginx --image=nginx --restart=Never --labels=env=test --namespace=engineering
--dry-run -o yaml > nginx-pod.yaml kubectl run nginx --image=nginx --restart=Never --
labels=env=test --namespace=engineering --dry-run -o yaml | kubectl create -n engineering -f -
YAML File:
apiVersion: v1
kind: Pod
metadata:
name: nginx
namespace: engineering
labels:
env: test
spec:
containers:
- name: nginx
image: nginx
imagePullPolicy: IfNotPresent
restartPolicy: Never
kubectl create -f nginx-pod.yaml
Answer: (SHOW ANSWER)

NEW QUESTION: 27
Create a pod that having 3 containers in it? (Multi-Container)
A. image=nginx, image=redis, image=consul
Name nginx container as "nginx-container"
Name redis container as "redis-container"
Name consul container as "consul-container"
Create a pod manifest file for a container and append container
section for rest of the images
kubectl run multi-container --generator=run-pod/v1 --image=nginx --
dry-run -o yaml > multi-container.yaml
# then
vim multi-container.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: multi-container
name: multi-container
spec:
containers:
- image: nginx
name: nginx-container
- image: redis
name: redis-container
- image: consul
name: consul-container
restartPolicy: Always
B. image=nginx, image=redis, image=consul
Name nginx container as "nginx-container"
Name redis container as "redis-container"
Name consul container as "consul-container"
Create a pod manifest file for a container and append container
section for rest of the images
kubectl run multi-container --generator=run-pod/v1 --image=nginx --
dry-run -o yaml > multi-container.yaml
# then
vim multi-container.yaml
labels:
run: multi-container
name: multi-container
spec:
containers:
- image: nginx
name: nginx-container
- image: redis
name: consul-container
restartPolicy: Always
Answer: (SHOW ANSWER)

NEW QUESTION: 28
Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to
theexisting pod namedfront-end.
Answer:
See the solution below.
Explanation
solution
NEW QUESTION: 29
Watch the job that runs 10 times one by one and verify 10 pods are created and delete those
after it's completed
Answer:
kubectl get job -w kubectl get po kubectl delete job hello-job

NEW QUESTION: 30
Answer:
kubectl delete deploy webapp kubectl delete hpa webapp

NEW QUESTION: 31
A Kubernetes worker node, named .Investigate why this is the case,
andperform any appropriate steps tobring the node to a state,ensuring that any changes are
madepermanent.
You cansshto the failednode using:
[student@node-1] $ | sshWk8s-node-0
You can assume elevatedprivileges on the node with thefollowing command:
[student@w8ks-node-0] $ |sudo -i
Answer:
See the solution below.
Explanation
solution
Valid CKA Dumps shared by Fast2test.com for Helping Passing CKA Exam! Fast2test.com
now offer the newest CKA exam dumps, the Fast2test.com CKA exam questions have
been updated and answers have been corrected get the newest Fast2test.com CKA dumps
with Test Engine here: https://www.fast2test.com/CKA-premium-file.html (63 Q&As Dumps,
30%OFF Special Discount: freecram)

NEW QUESTION: 32
Score: 13%

Task
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 Ready state, ensuring that any
changes are made permanent.

Answer:
See the solution below.
Explanation
Solution:
sudo -i
systemctl status kubelet
systemctl start kubelet
systemctl enable kubelet

NEW QUESTION: 33
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:
See the solution below.
Explanation
solution
NEW QUESTION: 34
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:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\18 C.JPG
NEW QUESTION: 35
Get all the pods with label "env"
Answer:
kubectl get pods -L env

NEW QUESTION: 36
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:
See the solution below.
Explanation
Solution:
NEW QUESTION: 37
Create the service as type NodePort with the port 32767 for the nginx pod with the pod selector
app: my-nginx
Answer:
kubectl run nginx --image=nginx --restart=Never -- labels=app=nginx --port=80 --dry-run -o yaml >
nginx-pod.yaml

NEW QUESTION: 38
Perform the following tasks:
* Add an init container to hungry-bear (which has been defined in spec file
/opt/KUCC00108/pod-spec-KUCC00108.yaml)
* The init container should create an empty file named/workdir/calm.txt
* If /workdir/calm.txt is not detected, the pod should exit
Answer:
* Once the spec file has been updated with the init container definition, the pod should be created
See the solution below.
Explanation
solution
NEW QUESTION: 39
Undo the deployment with the previous version and verify
everything is Ok
Answer:
kubectl rollout undo deploy webapp kubectl rollout status deploy webapp kubectl get pods

NEW QUESTION: 40
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\10 B.JPG
F:\Work\Data Entry Work\Data Entry\20200827\CKA\10 C.JPG

NEW QUESTION: 41
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:
kubectl autoscale deploy webapp --min=10 --max=20 --cpu percent=85 kubectl get hpa kubectl
get pod -l app=webapp

NEW QUESTION: 42
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:
See the solution below.
Explanation
solution
NEW QUESTION: 43
Create a pod with image nginx called nginx and allow traffic on port 80
Answer:
kubectl run nginx --image=nginx --restart=Never --port=80

NEW QUESTION: 44
Get list of persistent volumes and persistent volume claim in the cluster
Answer:
kubectl get pv kubectl get pvc

NEW QUESTION: 45
Print pod name and start time to "/opt/pod-status" file
Answer:
kubect1 get pods -o=jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'

NEW QUESTION: 46
Updates to dynamic user group membership are automatic therefore using dynamic user groups
instead of static group objects allows you to:
A. respond to changes in user behavior or potential threats without automatic policy changes
B. respond to changes in user behavior or potential threats using manual policy changes
C. respond to changes in user behavior or potential threats without manual policy changes
D. respond to changes in user behavior and confirmed threats with manual policy changes
Answer: (SHOW ANSWER)

Valid CKA Dumps shared by Fast2test.com for Helping Passing CKA Exam! Fast2test.com
now offer the newest CKA exam dumps, the Fast2test.com CKA exam questions have
been updated and answers have been corrected get the newest Fast2test.com CKA dumps
with Test Engine here: https://www.fast2test.com/CKA-premium-file.html (63 Q&As Dumps,
30%OFF Special Discount: freecram)

NEW QUESTION: 47
List all persistent volumes sorted by capacity, saving the full kubectl output to
/opt/KUCC00102/volume_list. Use kubectl 's own functionality for sorting the output, and do not
manipulate it any further.
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\2 C.JPG

NEW QUESTION: 48
Create a deployment as follows:
Name: nginx-app
Using container nginx with version 1.11.10-alpine
The deployment should contain
Next, deploy the application with new version , by performing a rolling update.
Finally, rollback that update to the previous version
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\7 B.JPG

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


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

NEW QUESTION: 49
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: (SHOW ANSWER)

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

NEW QUESTION: 51
Create a Kubernetes secret asfollows:
* Name: super-secret
* password: bob
Create a pod namedpod-secrets-via-file Image, which mounts a secret namedsuper-secretat
/secrets.
Create a second pod namedpod-secrets-via-env Image, which exportspasswordas
CONFIDENTIAL
Answer:
See the solution below.
Explanation
solution
NEW QUESTION: 52
Given a partially-functioningKubernetes cluster, identifysymptoms of failure on the cluster.
Determine the node, the failingservice, and take actions to bring upthe failed service and restore
thehealth of the cluster. Ensure that anychanges are made permanently.
You cansshto the relevant Inodes (bk8s-master-0orbk8s-node-0) using:
[student@node-1] $ ssh<nodename>
You can assume elevatedprivileges on any node in thecluster with the followingcommand:
[student@nodename] $ | sudo -i
Answer:
See the solution below.
Explanation
solution
NEW QUESTION: 53
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:
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: 54
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: (SHOW ANSWER)
NEW QUESTION: 55
Monitor the logs of pod foo and:
* Extract log lines corresponding unable-to-access-website
* Write them to/opt/KULM00201/foo

Answer:
See the solution below.
Explanation
solution
NEW QUESTION: 56
Scale the deployment from 5 replicas to 20 replicas and verify
Answer:
kubectl scale deploy webapp --replicas=20 kubectl get deploy webapp kubectl get po -l
app=webapp

NEW QUESTION: 57
Scale the deployment webserver to
Answer:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\14 B.JPG
NEW QUESTION: 58
Add a taint to node "worker-2" with effect as "NoSchedule" and
list the node with taint effect as "NoSchedule"
A. // Add taint to node "worker-2"
kubectl taint nodes worker-2 key=value:NoSchedule
// Verify
// Using "custom-coloumns" , you can customize which coloumn to
be printed
kubectl get nodes -o customcolumns=NAME:.metadata.name,TAINTS:.spec.taints --no-headers
// Using jsonpath
kubectl get nodes -o jsonpath="{range
.items[*]}{.metadata.name} {.spec.taints[?(
@.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
{print $0}'
B. // Add taint to node "worker-2"
kubectl taint nodes worker-2 key=value:NoSchedule
.items[*]}{.metadata.name} {.spec.taints[?(
@.effect=='NoSchedule' )].effect}{\"\n\"}{end}" | awk 'NF==2
{print $0}'
Answer: (SHOW ANSWER)
NEW QUESTION: 59
Create a deployment named "myapp" that having 2 replicas with
nginx image and expose deployment as service named "myservice"
A. // Create a YAML Template
kubectl create deploy myapp --image=nginx --dry-run -o yaml >
myapp.yaml
//Update replicas=2 in myapp.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: myapp
name: myapp
spec:
replicas: 2
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- image: nginx
name: nginx
// Create deployment
kubectl create -f myapp.yaml
// Creating YAML template for service
kubectl expose deployment myapp --type=ClusterIP --port=80 --
target-port=80 --name=myservice --dry-run -o yaml >
myservice.yaml
YAML File:
apiVersion: v1
kind: Service
metadata:
labels:
app: myapp
name: myservice
spec:
ports:
- port: 80
protocol: TCP
targetPort: 80
selector:
app: myapp
type: ClusterIP
kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
AGE
kubernetes ClusterIP 10.2.0.1 <none> 443/TCP
158d
myservice ClusterIP 10.2.96.175 <none> 80/TCP
40s
B. // Create a YAML Template
kubectl create deploy myapp --image=nginx --dry-run -o yaml >
myapp.yaml
//Update replicas=2 in myapp.yaml file
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: myapp
name: myapp
spec:
replicas: 2
selector:
matchLabels:
app: myapp
template:
metadata:
labels:
app: myapp
spec:
containers:
- image: nginx
name: nginx
// Create deployment
kubectl create -f myapp.yaml
// Creating YAML template for service
kubectl expose deployment myapp --type=ClusterIP --port=60 --
target-port=60 --name=myservice --dry-run -o yaml >
myservice.yaml
YAML File:
apiVersion: v1
kind: Service
metadata:
labels:
app: myapp
name: myservice
spec:
ports:
- port: 60
protocol: TCP
targetPort: 80
selector:
app: myapp
type: ClusterIP
kubectl get svc
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S)
AGE
kubernetes ClusterIP 10.2.0.1 <none> 443/TCP
158d
myservice ClusterIP 10.2.96.175 <none> 80/TCP
40s
Answer: (SHOW ANSWER)

NEW QUESTION: 60
Answer:
See the solution below.
Explanation
image=nginx, image=redis, image=consul
Name nginx container as "nginx-container"
Name redis container as "redis-container"
Name consul container as "consul-container"
Create a pod manifest file for a container and append container
section for rest of the images
kubectl run multi-container --generator=run-pod/v1 --image=nginx --
dry-run -o yaml > multi-container.yaml
# then
vim multi-container.yaml
apiVersion: v1
kind: Pod
metadata:
labels:
run: multi-container
name: multi-container
spec:
containers:
- image: nginx
name: nginx-container
- image: redis
name: redis-container
- image: consul
name: consul-container
restartPolicy: Always

NEW QUESTION: 61
Create an nginx pod with containerPort 80 and it should check the pod running at endpoint /
healthz on port 80 and verify and delete the pod.
A. kubectl run nginx --image=nginx --restart=Always --port=80 --
dry-run -o yaml > nginx-pod.yaml
// add the livenessProbe section and create
apiVersion: v1
kind: Pod
metadata:
labels:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 60
livenessProbe:
httpGet:
path: /healthz
port: 60
restartPolicy: Always
kubectl create -f nginx-pod.yaml
// verify
kubectl describe pod nginx | grep -i readiness
kubectl delete po nginx
B. kubectl run nginx --image=nginx --restart=Always --port=80 --
dry-run -o yaml > nginx-pod.yaml
// add the livenessProbe section and create
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
ports:
- containerPort: 80
livenessProbe:
httpGet:
path: /healthz
port: 80
restartPolicy: Always
kubectl create -f nginx-pod.yaml
// verify
kubectl describe pod nginx | grep -i readiness
kubectl delete po nginx
Answer: (SHOW ANSWER)

Valid CKA Dumps shared by Fast2test.com for Helping Passing CKA Exam! Fast2test.com
now offer the newest CKA exam dumps, the Fast2test.com CKA exam questions have
been updated and answers have been corrected get the newest Fast2test.com CKA dumps
with Test Engine here: https://www.fast2test.com/CKA-premium-file.html (63 Q&As Dumps,
30%OFF Special Discount: freecram)

Valid CKA Dumps shared by Fast2test.com for Helping Passing CKA Exam! Fast2test.com
now offer the newest CKA exam dumps, the Fast2test.com CKA exam questions have
been updated and answers have been corrected get the newest Fast2test.com CKA dumps
with Test Engine here: https://www.fast2test.com/CKA-premium-file.html (63 Q&As Dumps,
30%OFF Special Discount: freecram)

You might also like