2024 Latest CKA Exam Dumps Recently Updated 68 Questions [Q29-Q49]

Share

2024 Latest CKA Exam Dumps Recently Updated 68 Questions

Linux Foundation CKA Real 2024 Braindumps Mock Exam Dumps

NEW QUESTION # 29
Create an nginx pod and list the pod with different levels of verbosity

  • A. // create a pod
    kubectl run nginx --image=nginx --restart=Never --port=80
    // List the pod with different verbosity
    kubectl get po nginx --v=7
    kubectl get po nginx --v=6
    kubectl get po nginx --v=9
  • B. // create a pod
    kubectl run nginx --image=nginx --restart=Never --port=80
    // List the pod with different verbosity
    kubectl get po nginx --v=7
    kubectl get po nginx --v=8
    kubectl get po nginx --v=9

Answer: B


NEW QUESTION # 30
Get the memory and CPU usage of all the pods and find out top 3 pods which have the highest usage and put them into the cpuusage.txt file

  • A. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -3 > cpu-usage.txt
    // verify
    cat cpu-usage.txt
  • B. // Get the top 3 pods
    kubectl top pod --all-namespaces | sort --reverse --key 3 --
    numeric | head -8
    // putting into file
    kubectl top pod --all-namespaces | sort --reverse --key 6 --
    numeric | head -6 > cpu-usage.txt
    // verify
    cat cpu-usage.txt

Answer: A


NEW QUESTION # 31
Create a pod that having 3 containers in it? (Multi-Container)

Answer:

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 # 32
A bootstrap USB flash drive has been prepared using a Linux workstation to load the initial configuration of a Palo Alto Networks firewall. The USB flash drive was formatted using file system ntfs and the initial configuration is stored in a file named init-cfg.txt.
The contents of Init-cfg.txt in the USB flash drive are as follows:
type=static
ip-address=10.5.107.19
default-gateway=10.5.107.1
netmask=255.255.255.0
Ipv6-address=2001:400:100::1/64
ipv6-default-gateway=2001:400:100::2
hostname=Ca-FW-DC1
panorama-server=10.5.107.20
panorama-server-2=10.5.107.21
tplname=FINANCE TG4
dgname=finance_dg
dns-primary=10.5.6.6
op-command-modes multi-vsys.jumbo-frame
dhcp-send-hostname=no
dhcp-send-client-id=no
dhcp-accept-server-hostname=no
dhcp-accept-server-domain=no
The USB flash drive has been inserted in the firewalls' USB port, and the firewall has been powered on.Upon boot, the firewall fails to begin the bootstrapping process. The failure is caused because:

  • A. The USB must be formatted using the ext4 file system
  • B. The USB drive has been formatted with an unsupported file system
  • C. nit-cfg bit is an incorrect filename the correct filename should be init-ofg.xml
  • D. The bootstrap.xml file is a required file, but it is missing
  • E. There must be commas between the parameter names and their values instead of the equal symbols

Answer: A


NEW QUESTION # 33
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:

Explanation:
See the solution below.
Explanation
solution



NEW QUESTION # 34
Score: 7%

Task
Given an existing Kubernetes cluster running version 1.20.0, upgrade all of the Kubernetes control plane and node components on the master node only to version 1.20.1.
Be sure to drain the master node before upgrading it and uncordon it after the upgrade.

You are also expected to upgrade kubelet and kubectl on the master node.

Answer:

Explanation:
See the solution below.
Explanation
SOLUTION:
[student@node-1] > ssh ek8s
kubectl cordon k8s-master
kubectl drain k8s-master --delete-local-data --ignore-daemonsets --force apt-get install kubeadm=1.20.1-00 kubelet=1.20.1-00 kubectl=1.20.1-00 --disableexcludes=kubernetes kubeadm upgrade apply 1.20.1 --etcd-upgrade=false systemctl daemon-reload systemctl restart kubelet kubectl uncordon k8s-master


NEW QUESTION # 35
List "nginx-dev" and "nginx-prod" pod and delete those pods

  • A. kubect1 get pods -o wide
    kubectl delete po "nginx-dev" kubectl delete po "nginx-prod"
  • B. kubect1 get pods -o wide
    kubectl delete po "nginx-dev" kubectl delete po "nginx-prod"

Answer: A


NEW QUESTION # 36
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 # 37
Get list of PVs and order by size and write to file - /opt/pvlist.txt

Answer:

Explanation:
kubectl get pv --sort-by=.spec.capacity.storage > /opt/pvlist.txt


NEW QUESTION # 38
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:
Solution:
Task should be complete on node k8s -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 # 39
Clean the cluster by deleting deployment and hpa you just created

Answer:

Explanation:
kubectl delete deploy webapp kubectl delete hpa webapp


NEW QUESTION # 40
Create a pod namedkucc8with asingle app container for each of the
following images running inside(there may be between 1 and 4images specified):
nginx + redis + memcached.

Answer:

Explanation:
See the solution below.
Explanation
solution



NEW QUESTION # 41
Check logs of each container that "busyboxpod-{1,2,3}"

  • A. kubectl logs busybox -c busybox-container-1
    kubectl logs busybox -c busybox-container-3
    kubectl logs busybox -c busybox-container-3
  • B. kubectl logs busybox -c busybox-container-1
    kubectl logs busybox -c busybox-container-2
    kubectl logs busybox -c busybox-container-3

Answer: B


NEW QUESTION # 42
Create a pod that echo "hello world" and then exists. Have the pod deleted automatically when it's completed

Answer:

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 # 43
Get the pods with labels env=dev and env=prod and output the labels as well

Answer:

Explanation:
kubectl get pods -l 'env in (dev,prod)' --show-labels


NEW QUESTION # 44
Create a nginx pod with label env=test in engineering namespace

Answer:

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


NEW QUESTION # 45
Get the list of pods of webapp deployment

  • A. // Get the label of the deployment
    kubectl get deploy --show-labels
    kubectl get pods -l app=webapp
  • B. // Get the label of the deployment
    kubectl get deploy --show-labels
    // Get the pods with that label
    kubectl get pods -l app=webapp

Answer: B


NEW QUESTION # 46
Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to theexisting pod namedfront-end.

Answer:

Explanation:
See the solution below.
Explanation
solution


NEW QUESTION # 47
Create and configure the service front-end-service so it's accessible through NodePort and routes to the existing pod named front-end.

Answer:

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


NEW QUESTION # 48
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 # 49
......

Verified CKA Exam Dumps Q&As - Provide CKA with Correct Answers: https://examcompass.topexamcollection.com/CKA-vce-collection.html