CKA Latest

Download as pdf or txt
Download as pdf or txt
You are on page 1of 72

All types of

Certification dumps
contact

WhatApp direct link:


https://wa.link/e3hmdc
Dumps Q&A Linux Foundation - CKA

Question #:1

Monitor the logs of pod foo and:

Extract log lines correspondingto error

unable-to-access-website

Write them to/opt/KULM00201/foo

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\1 B.JPG

Success Guaranteed, 100% Valid 1 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 2 of 70


Dumps Q&A Linux Foundation - CKA

Question #:2

Get IP address of the pod – “nginx-dev”

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

Success Guaranteed, 100% Valid 3 of 70


Dumps Q&A Linux Foundation - CKA

Question #:3

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.

See the solution below.

Explanation
solution

Success Guaranteed, 100% Valid 4 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 5 of 70


Dumps Q&A Linux Foundation - CKA

Question #:4

List pod logs named “frontend” and search for the pattern “started” and write it to a file “/opt/error-logs”

See the solution below.

Explanation
Kubectl logs frontend | grep -i “started” > /opt/error-logs

Question #:5

Create a Kubernetes secret asfollows:

Success Guaranteed, 100% Valid 6 of 70


Dumps Q&A Linux Foundation - CKA

Name: super-secret

password: bob

Create a pod namedpod-secrets-via-file, using theredisImage, which mounts a secret namedsuper-secretat


/secrets.

Create a second pod namedpod-secrets-via-env, using theredisImage, which exportspasswordas


CONFIDENTIAL

See the solution below.

Explanation

solution

Success Guaranteed, 100% Valid 7 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 8 of 70


Dumps Q&A Linux Foundation - CKA

Question #:6

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

See the solution below.

Explanation
kubectlrun nginx --image=nginx --restart=Never --port=80

Question #:7

List the nginx pod with custom columns POD_NAME and POD_STATUS

See the solution below.

Success Guaranteed, 100% Valid 9 of 70


Dumps Q&A Linux Foundation - CKA

Explanation
kubectl get po -o=custom-columns="POD_NAME:.metadata.name,

POD_STATUS:.status.containerStatuses[].state"

Question #:8

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 thestagingnamespace and the volumemust notbe persistent.

See the solution below.

Explanation

solution

Success Guaranteed, 100% Valid 10 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 11 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 12 of 70


Dumps Q&A Linux Foundation - CKA

Question #:9

Create a deployment as follows:

Name:nginx-random

Exposed via a servicenginx-random

Ensure that the service & podare accessible via theirrespective DNS records

The container(s) within anypod(s) running as a part of thisdeployment should use thenginxImage

Next, use the utilitynslookupto lookup the DNS records of the service &pod and write the output to
/opt/KUNW00601/service.dnsand/opt/KUNW00601/pod.dnsrespectively.

Success Guaranteed, 100% Valid 13 of 70


Dumps Q&A Linux Foundation - CKA

See the solution below.

Explanation

Solution:

Success Guaranteed, 100% Valid 14 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 15 of 70


Dumps Q&A Linux Foundation - CKA

Question #:10

List all the pods sorted by name

See the solution below.

Explanation
kubectl get pods --sort-by=.metadata.name

Question #:11

Create a deployment as follows:

Success Guaranteed, 100% Valid 16 of 70


Dumps Q&A Linux Foundation - CKA

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.

See the solution below.

Explanation

solution

Success Guaranteed, 100% Valid 17 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 18 of 70


Dumps Q&A Linux Foundation - CKA

Question #:12

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

See the solution below.

Explanation

solution

Success Guaranteed, 100% Valid 19 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 20 of 70


Dumps Q&A Linux Foundation - CKA

Question #:13

Create a snapshot of theetcdinstance running athttps://127.0.0.1:2379, 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

See the solution below.

Explanation

Success Guaranteed, 100% Valid 21 of 70


Dumps Q&A Linux Foundation - CKA

solution

Question #:14

Create a pod as follows:

Name:mongo

Using Image:mongo

In anew Kubernetes namespacenamed:my-website

See the solution below.

Success Guaranteed, 100% Valid 22 of 70


Dumps Q&A Linux Foundation - CKA

Explanation
solution

Question #:15

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.

See the solution below.

Explanation
kubectl run --generator=run-pod/v1 --image=nginx -- labels=env=prod nginx-prod --dry-run -o yaml >

Success Guaranteed, 100% Valid 23 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 24 of 70


Dumps Q&A Linux Foundation - CKA

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

Question #:16

Schedule a pod as follows:

Name: nginx-kusc00101

Image: nginx

Node selector: disk=ssd

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\6 B.JPG

Success Guaranteed, 100% Valid 25 of 70


Dumps Q&A Linux Foundation - CKA

Success Guaranteed, 100% Valid 26 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 27 of 70


Dumps Q&A Linux Foundation - CKA

Question #:17

List all the pods showing name and namespace with a json path expression

See the solution below.

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

'metadata.namespace']}"

Question #:18

Success Guaranteed, 100% Valid 28 of 70


Dumps Q&A Linux Foundation - CKA

A Kubernetes worker node, namedwk8s-node-0is in stateNotReady.Investigate why this is the case,


andperform any appropriate steps tobring the node to aReadystate,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

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\20 C.JPG

Success Guaranteed, 100% Valid 29 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\20 D.JPG

Success Guaranteed, 100% Valid 30 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\20 E.JPG

Success Guaranteed, 100% Valid 31 of 70


Dumps Q&A Linux Foundation - CKA

Question #:19

Create and configure the servicefront-end-serviceso it's accessiblethroughNodePortand routes to theexisting


pod namedfront-end.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\8 B.JPG

Success Guaranteed, 100% Valid 32 of 70


Dumps Q&A Linux Foundation - CKA

Question #:20

Create an nginx pod and list the pod with different levels of verbosity

See the solution below.

Explanation
// create a pod

kubectl run nginx --image=nginx --restart=Never --port=80

// List the pod with different verbosity

kubectl get po nginx --v=7

Success Guaranteed, 100% Valid 33 of 70


Dumps Q&A Linux Foundation - CKA

kubectl get po nginx --v=8

kubectl get po nginx --v=9

Question #:21

List all the pods sorted by created timestamp

See the solution below.

Explanation
kubect1 get pods--sort-by=.metadata.creationTimestamp

Question #:22

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

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\4 B.JPG

Success Guaranteed, 100% Valid 34 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 35 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 36 of 70


Dumps Q&A Linux Foundation - CKA

Question #:23

Check the image version in pod without the describe command

See the solution below.

Explanation

kubectl get po nginx -o

jsonpath='{.spec.containers[].image}{"\n"}'

Question #:24

Success Guaranteed, 100% Valid 37 of 70


Dumps Q&A Linux Foundation - CKA

Create a persistent volume with nameapp-data, of capacity2Giandaccess modeReadWriteMany. Thetype of


volume ishostPathand itslocation is/srv/app-data.

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 namedapp-data, with access modeReadWriteMany, storage classname


shared,2Giof storage capacity and the host path/srv/app-data.

Success Guaranteed, 100% Valid 38 of 70


Dumps Q&A Linux Foundation - CKA

2. Save the file and create the persistent volume.

Image for post

Success Guaranteed, 100% Valid 39 of 70


Dumps Q&A Linux Foundation - CKA

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:app-data

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.

Success Guaranteed, 100% Valid 40 of 70


Dumps Q&A Linux Foundation - CKA

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: "/srv/app-data"name: configpvc

Question #:25

List the nginx pod with custom columns POD_NAME and POD_STATUS

See the solution below.

Explanation
kubectl get po -o=custom-columns="POD_NAME:.metadata.name,

POD_STATUS:.status.containerStatuses[].state"

Question #:26

Create a pod with environment variables as var1=value1.Check the environment variable in pod

See the solution below.

Explanation
kubectl run nginx --image=nginx --restart=Never --env=var1=value1

# then

kubectl exec -it nginx -- env

# or

kubectl exec -it nginx -- sh -c 'echo $var1'

# or

Success Guaranteed, 100% Valid 41 of 70


Dumps Q&A Linux Foundation - CKA

kubectl describe po nginx | grep value1

Question #:27

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.

See the solution below.

Explanation

solution

You must use thekubeadmconfiguration file located at/etc/kubeadm.confwhen 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 andapthasbeen configured so that you caninstall the required tools.

Question #:28

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

See the solution below.

Explanation
kubectl create namespace development

kubectl run nginx --image=nginx --restart=Never -n development

Question #:29

Success Guaranteed, 100% Valid 42 of 70


Dumps Q&A Linux Foundation - CKA

List all the pods sorted by name

See the solution below.

Explanation
kubect1 get pods --sort-by=.metadata.name

Question #:30

List “nginx-dev” and “nginx-prod” pod and delete those pods

See the solution below.

Explanation
kubect1 get pods -o wide

kubectl delete po “nginx-dev”kubectl delete po “nginx-prod”

Question #:31

Scale the deploymentwebserverto6pods.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\14 B.JPG

Success Guaranteed, 100% Valid 43 of 70


Dumps Q&A Linux Foundation - CKA

Question #:32

List all persistent volumes sorted bycapacity, saving the fullkubectloutput to


/opt/KUCC00102/volume_list. Usekubectl 's own functionality forsorting the output, and do not
manipulate it any further.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\2 C.JPG

Success Guaranteed, 100% Valid 44 of 70


Dumps Q&A Linux Foundation - CKA

Question #:33

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.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\5 B.JPG

Success Guaranteed, 100% Valid 45 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\5 C.JPG

Success Guaranteed, 100% Valid 46 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\5 D.JPG

Success Guaranteed, 100% Valid 47 of 70


Dumps Q&A Linux Foundation - CKA

Question #:34

Get list of all pods in all namespaces and write it to file “/opt/pods-list.yaml”

See the solution below.

Explanation
kubectl get po –all-namespaces > /opt/pods-list.yaml

Question #:35

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.

Success Guaranteed, 100% Valid 48 of 70


Dumps Q&A Linux Foundation - CKA

UseDaemonSetto complete thistask and useds-kusc00201asDaemonSet name.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\3 B.JPG

F:\Work\Data Entry Work\Data Entry\abc\CKA\3 C.JPG

Success Guaranteed, 100% Valid 49 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\3 D.JPG

Success Guaranteed, 100% Valid 50 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\3 E.JPG

Success Guaranteed, 100% Valid 51 of 70


Dumps Q&A Linux Foundation - CKA

Question #:36

Print pod name and start time to “/opt/pod-status” file

See the solution below.

Explanation
kubect1 get pods -o=jsonpath='{range

items[*]}{.metadata.name}{"\t"}{.status.podIP}{"\n"}{end}'

Question #:37

Success Guaranteed, 100% Valid 52 of 70


Dumps Q&A Linux Foundation - CKA

Create a pod that having 3 containers in it? (Multi-Container)

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

Success Guaranteed, 100% Valid 53 of 70


Dumps Q&A Linux Foundation - CKA

name: consul-container

restartPolicy: Always

Question #:38

Get list of all the pods showing name and namespace with a jsonpath expression.

See the solution below.

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

, 'metadata.namespace']}"

Question #:39

Create a pod that echo “hello world” and then exists. Have the pod deleted automatically when it’s completed

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"

Question #:40

Create a busybox pod that runs the command “env” and save the output to “envpod” file

See the solution below.

Explanation
kubectl run busybox --image=busybox --restart=Never –-rm -it -- env > envpod.yaml

Question #:41

Create a file:

/opt/KUCC00302/kucc00302.txtthatlists all pods that implement servicebazin namespacedevelopment.

Success Guaranteed, 100% Valid 54 of 70


Dumps Q&A Linux Foundation - CKA

The format of the file should be onepod name per line.

See the solution below.

Explanation
solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\11 B.JPG

F:\Work\Data Entry Work\Data Entry\abc\CKA\11 C.JPG

Success Guaranteed, 100% Valid 55 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\11 D.JPG

Success Guaranteed, 100% Valid 56 of 70


Dumps Q&A Linux Foundation - CKA

Question #:42

Check to see how many worker nodes are ready (not including nodes taintedNoSchedule) and write the
number to/opt/KUCC00104/kucc00104.txt.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\15 B.JPG

Success Guaranteed, 100% Valid 57 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\15 C.JPG

Success Guaranteed, 100% Valid 58 of 70


Dumps Q&A Linux Foundation - CKA

Question #:43

Create a busybox pod and add “sleep 3600” command

See the solution below.

Explanation
kubectl run busybox --image=busybox --restart=Never -- /bin/sh -c

"sleep 3600"

Question #:44

Success Guaranteed, 100% Valid 59 of 70


Dumps Q&A Linux Foundation - CKA

Configure the kubelet systemd-managed service, on the nodelabelled withname=wk8s-node-1, tolaunch a pod
containing a singlecontainer of Imagehttpdnamedwebtoolautomatically. Any spec filesrequired should be
placed in the/etc/kubernetes/manifestsdirectoryon the node.

You canssh to theappropriate node using:

[student@node-1] $ sshwk8s-node-1

You can assume elevatedprivileges on the node with thefollowing command:

[student@wk8s-node-1] $ |sudo –i

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\21 C.JPG

Success Guaranteed, 100% Valid 60 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\21 D.JPG

Success Guaranteed, 100% Valid 61 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 62 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 63 of 70


Dumps Q&A Linux Foundation - CKA

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

Success Guaranteed, 100% Valid 64 of 70


Dumps Q&A Linux Foundation - CKA

Question #:45

Create a nginx pod with label env=test in engineering namespace

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:

Success Guaranteed, 100% Valid 65 of 70


Dumps Q&A Linux Foundation - CKA

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

Question #:46

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

See the solutionbelow.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\23 C.JPG

Success Guaranteed, 100% Valid 66 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\23 D.JPG

Success Guaranteed, 100% Valid 67 of 70


Dumps Q&A Linux Foundation - CKA

F:\Work\Data Entry Work\Data Entry\abc\CKA\23 E.JPG

Success Guaranteed, 100% Valid 68 of 70


Dumps Q&A Linux Foundation - CKA

Question #:47

Set the node namedek8s-node-1asunavailable and reschedule all thepods running on it.

See the solution below.

Explanation

solution

F:\Work\Data Entry Work\Data Entry\abc\CKA\19 B.JPG

Success Guaranteed, 100% Valid 69 of 70


Dumps Q&A Linux Foundation - CKA

Question #:48

Check the Image version of nginx-dev pod using jsonpath

See the solution below.

Explanation
kubect1 get po nginx-dev -o

jsonpath='{.spec.containers[].image}{"\n"}'

Success Guaranteed, 100% Valid 70 of 70

You might also like