[May 18, 2024] New 2024 Linux Foundation CKA Exam Dumps with PDF from TrainingDumps (Updated 68 Questions) [Q39-Q61]

Share

New 2024 CKA exam questions Welcome to download the newest TrainingDumps CKA PDF dumps (68 Q&As)

P.S. Free 2024 Kubernetes Administrator CKA dumps are available on Google Drive shared by TrainingDumps

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

Explanation:
See the solution below.
Explanation
solution
F:\Work\Data Entry Work\Data Entry\20200827\CKA\2 C.JPG


NEW QUESTION # 41
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.5"
    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.4"
    limits:
    cpu: "1"
    restartPolicy: Always
    kubectl apply -f nginx-pod.yaml
    // verify
    kubectl top pod

Answer: A


NEW QUESTION # 42
Get IP address of the pod - "nginx-dev"

  • A. Kubect1 get po -o wide
    Using JsonPath
    kubect1 get pods -o=jsonpath='{range
    .items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'
  • B. Kubect1 get po -o wide
    Using JsonPath
    kubect1 get pods
    .items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'

Answer: A


NEW QUESTION # 43
Get IP address of the pod - "nginx-dev"

Answer:

Explanation:
See the solution below.
Explanation
Kubect1 get po -o wide
Using JsonPath
kubect1 get pods -o=jsonpath='{range
items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'


NEW QUESTION # 44
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:
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 # 45
To protect your firewall and network from single source denial of service (DoS) attacks that can overwhelm its packet buffer and cause legitimate traffic to drop, you can configure:

  • A. BGP (Border Gateway Protocol)
  • B. PGP (Packet Gateway Protocol)
  • C. PBP (Protocol Based Protection)
  • D. PBP (Packet Buffer Protection)

Answer: C


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

Answer:

Explanation:
See the solution below.
Explanation
solution



NEW QUESTION # 47
Deploy a pod with image=redis on a node with label disktype=ssd

  • A. // Get list of nodes
    kubectl get nodes
    //Get node with the label disktype=ssd
    kubectl get no -l disktype=ssd
    // Create a sample yaml file
    kubectl run node-redis --generator=run-pod/v1 --image=redis --dry
    run -o yaml > test-redis.yaml
    // Edit test-redis.yaml file and add nodeSelector
    vim test-redis.yaml
    apiVersion: v1
    - name: node-redis
    image: redis
    imagePullPolicy: IfNotPresent
    kubectl apply -f test-redis.yaml
    / // Verify
    K kubectl get po -o wide
  • B. // Get list of nodes
    kubectl get nodes
    //Get node with the label disktype=ssd
    kubectl get no -l disktype=ssd
    // Create a sample yaml file
    kubectl run node-redis --generator=run-pod/v1 --image=redis --dry
    run -o yaml > test-redis.yaml
    // Edit test-redis.yaml file and add nodeSelector
    vim test-redis.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    name: redis
    spec:
    nodeSelector:
    disktype: ssd
    containers:
    - name: node-redis
    image: redis
    imagePullPolicy: IfNotPresent
    kubectl apply -f test-redis.yaml
    / // Verify
    K kubectl get po -o wide

Answer: B


NEW QUESTION # 48
Perform the following tasks:
Add an init container to hungry-bear defined in spec file
/opt/KUCC00108/pod-spec-KUC
The init container should create /workdir/calm.txt
If /workdir/calm.txt is not
Once the spec file has been definition, the pod should be created

Answer:

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

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

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


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




NEW QUESTION # 50
Task Weight: 4%

Task
Schedule a Pod as follows:
* Name: kucc1
* App Containers: 2
* Container Name/Images:
o nginx
o consul

Answer:

Explanation:
Solution:



NEW QUESTION # 51
Check the Image version of nginx-dev pod using jsonpath

Answer:

Explanation:
See the solution below.
Explanation
kubect1 get po nginx-dev -o
jsonpath='{.spec.containers[].image}{"\n"}'


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

Explanation:
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 # 53
List all the pods showing name and namespace with a json path expression

Answer:

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


NEW QUESTION # 54
Resume the rollout of the deployment

Answer:

Explanation:
kubectl rollout resume deploy webapp


NEW QUESTION # 55
List all the pods sorted by name

Answer:

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


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

Explanation:
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 # 57
Create a pod that having 3 containers in it? (Multi-Container)

Answer:

Explanation:
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 # 58
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: B


NEW QUESTION # 59
Get list of all pods in all namespaces and write it to file "/opt/pods-list.yaml"

Answer:

Explanation:
See the solution below.
Explanation
kubectl get po -all-namespaces > /opt/pods-list.yaml


NEW QUESTION # 60
Create a Pod with main container busybox and which executes this
"while true; do echo 'Hi I am from Main container' >>
/var/log/index.html; sleep 5; done" and with sidecar container
with nginx image which exposes on port 80. Use emptyDir Volume
and mount this volume on path /var/log for busybox and on path
/usr/share/nginx/html for nginx container. Verify both containers
are running.

  • A. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - name: var-logs
    emptyDir: {}
    containers:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    - containerPort: 80
    volumeMounts:
    - name: var-logs
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods
  • B. // create an initial yaml file with this
    kubectl run multi-cont-pod --image=busbox --restart=Never --
    dry-run -o yaml > multi-container.yaml
    // edit the yml as below and create it
    kubectl create -f multi-container.yaml
    vim multi-container.yaml
    apiVersion: v1
    kind: Pod
    metadata:
    labels:
    run: multi-cont-pod
    name: multi-cont-pod
    spec:
    volumes:
    - image: busybox
    command: ["/bin/sh"]
    args: ["-c", "while true; do echo 'Hi I am from Main
    container' >> /var/log/index.html; sleep 5;done"]
    name: main-container
    volumeMounts:
    - name: var-logs
    mountPath: /var/log
    - image: nginx
    name: sidecar-container
    ports:
    mountPath: /usr/share/nginx/html
    restartPolicy: Never
    // Create Pod
    kubectl apply -f multi-container.yaml
    //Verify
    kubectl get pods

Answer: A


NEW QUESTION # 61
......

CKA exam questions from TrainingDumps dumps: https://www.trainingdumps.com/CKA_exam-valid-dumps.html (68 Q&As)

Free 2024 Kubernetes Administrator CKA dumps are available on Google Drive shared by TrainingDumps: https://drive.google.com/open?id=1WyqaUnEcJ7tRrtISuXtdIja5HgPmOZVm