100% found this document useful (2 votes)
833 views70 pages

Cdeat Test

m du am ex id al .v w w // w s: tp ht This document contains questions and solutions for the Certified Kubernetes Application Developer (CKAD) exam. It includes 4 sample exam questions related to creating pods, secrets, and ConfigMaps in Kubernetes and consuming secrets and ConfigMaps in pods. For each question, it provides the task or scenario and the solution in 1-3 sentences. The questions cover topics like creating pods with specific images and port exposures, creating and consuming secrets as environment variables, and creating and mounting ConfigMaps as volumes.

Uploaded by

hf6275quu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
833 views70 pages

Cdeat Test

m du am ex id al .v w w // w s: tp ht This document contains questions and solutions for the Certified Kubernetes Application Developer (CKAD) exam. It includes 4 sample exam questions related to creating pods, secrets, and ConfigMaps in Kubernetes and consuming secrets and ConfigMaps in pods. For each question, it provides the task or scenario and the solution in 1-3 sentences. The questions cover topics like creating pods with specific images and port exposures, creating and consuming secrets as environment variables, and creating and mounting ConfigMaps as volumes.

Uploaded by

hf6275quu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 70

Questions and Answers PDF 1/70

Thank You for your purchase

om
Linux Foundation CKAD Exam Question & Answers
Certified Kubernetes Application Developer Exam

.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 2/70

Product Questions: 33
Version: 6.2

Question: 1

om
Refer to Exhibit.

.c
ps
m
du
am
Set Configuration Context:
ex

[student@node-1] $ | kubectl
Config use-context k8s
id

Context
al

A web application requires a specific version of redis to be used as a cache.


.v

Task
w
w

Create a pod with the following characteristics, and leave it running when complete:
• The pod must run in the web namespace.
w

The namespace has already been created


//

• The name of the pod should be cache


s:

• Use the Ifccncf/redis image with the 3.2 tag


tp

• Expose port 6379


ht

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 3/70

Question: 2

om
Refer to Exhibit.

.c
ps
m
du
am
ex
id
al
.v
w

Context
You are tasked to create a secret and consume the secret in a pod using environment variables as
w

follow:
// w

Task
s:

• Create a secret named another-secret with a key/value pair; key1/value4


• Start an nginx pod named nginx-secret using container image nginx, and add an environment
tp

variable exposing the value of the secret key key 1, using COOL_VARIABLE as the name for the
ht

environment variable inside the pod

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 4/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 5/70

om
.c
ps
m
Question: 3 du
am
Refer to Exhibit.
ex
id
al
.v
w
w
// w
s:
tp
ht

Task
You are required to create a pod that requests a certain amount of CPU and memory, so it gets
scheduled to-a node that has those resources available.

• Create a pod named nginx-resources in the pod-resources namespace that requests a minimum of
200m CPU and 1Gi memory for its container
• The pod should use the nginx image
• The pod-resources namespace has already been created

Answer: See the

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 6/70

solution below.
Explanation:

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 7/70

om
.c
ps
Question: 4

m
Refer to Exhibit.

du
am
ex
id
al
.v
w
w
// w

Context
s:

You are tasked to create a ConfigMap and consume the ConfigMap in a pod using a volume mount.
Task
tp

Please complete the following:


ht

• Create a ConfigMap named another-config containing the key/value pair: key4/value3


• start a pod named nginx-configmap containing a single container using the
nginx image, and mount the key you just created into the pod under directory /also/a/path

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 8/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 9/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Question: 5
Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 10/70

om
Context

.c
Your application’s namespace requires a specific service account to be used.

ps
Task
Update the app-a deployment in the production namespace to run as the restrictedservice service

m
account. The service account has already been created.

du Answer: See the


am
solution below.
Explanation:
ex

Solution:
id
al
.v
w
w
// w
s:
tp
ht

Question: 6

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 11/70

Refer to Exhibit.

om
.c
Set Configuration Context:

ps
[student@node-1] $ | kubectl
Config use-context k8s

m
Context

du
A pod is running on the cluster but it is not responding.
am
Task
The desired behavior is to have Kubemetes restart the pod when an endpoint returns an HTTP 500 on
ex

the /healthz endpoint. The service, probe-pod, should never send traffic to the pod while it is failing.
Please complete the following:
id

• The application has an endpoint, /started, that will indicate if it can accept traffic by returning an
HTTP 200. If the endpoint returns an HTTP 500, the application has not yet finished initialization.
al

• The application has another endpoint /healthz that will indicate if the application is still working as
.v

expected by returning an HTTP 200. If the endpoint returns an HTTP 500 the application is no longer
w

responsive.
• Configure the probe-pod pod provided to use these endpoints
w

• The probes should use port 8080


// w

Answer: See the


s:

solution below.
tp

Explanation:
ht

Solution:
To have Kubernetes automatically restart a pod when an endpoint returns an HTTP 500 on the
/healthz endpoint, you will need to configure liveness and readiness probes on the pod.
First, you will need to create a livenessProbe and a readinessProbe in the pod's definition yaml file.
The livenessProbe will check the /healthz endpoint, and if it returns an HTTP 500, the pod will be
restarted. The readinessProbe will check the /started endpoint, and if it returns an HTTP 500, the pod
will not receive traffic.
Here's an example of how you can configure the liveness and readiness probes in the pod definition
yaml file:
apiVersion: v1
kind: Pod

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 12/70

metadata:
name: probe-pod
spec:
containers:
- name: probe-pod
image: <image-name>
ports:
- containerPort: 8080
livenessProbe:
httpGet:
path: /healthz
port: 8080

om
initialDelaySeconds: 15
periodSeconds: 10

.c
failureThreshold: 3

ps
readinessProbe:
httpGet:

m
path: /started
port: 8080

du
initialDelaySeconds: 15
periodSeconds: 10
am
failureThreshold: 3
The httpGet specifies the endpoint to check and the port to use. The initialDelaySeconds is the
ex

amount of time the pod will wait before starting the probe. periodSeconds is the amount of time
between each probe check, and the failureThreshold is the number of failed probes before the pod is
id

considered unresponsive.
al

You can use kubectl to create the pod by running the following command:
kubectl apply -f <filename>.yaml
.v

Once the pod is created, Kubernetes will start monitoring it using the configured liveness and
w

readiness probes. If the /healthz endpoint returns an HTTP 500, the pod will be restarted. If the
w

/started endpoint returns an HTTP 500, the pod will not receive traffic.
Please note that if the failure threshold is set to 3, it means that if the probe fails 3 times
w

consecutively it will be considered as a failure.


//

The above configuration assumes that the application is running on port 8080 and the endpoints are
s:

available on the same port.


tp

Question: 7
ht

Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 13/70

om
.c
Set Configuration Context:
[student@node-1] $ | kubectl

ps
Config use-context k8s
Context

m
You sometimes need to observe a pod's logs, and write those logs to a file for further analysis.

Task
du
am
Please complete the following;
• Deploy the counter pod to the cluster using the provided YAMLspec file at
ex

/opt/KDOB00201/counter.yaml
• Retrieve all currently available application logs from the running pod and store them in the file
id

/opt/KDOB0020l/log_Output.txt, which has already been created


al

Answer: See the


.v

solution below.
w

Explanation:
w
w

Solution:
To deploy the counter pod to the cluster using the provided YAML spec file, you can use the kubectl
//

apply command. The apply command creates and updates resources in a cluster.
s:

kubectl apply -f /opt/KDOB00201/counter.yaml


tp

This command will create the pod in the cluster. You can use the kubectl get pods command to check
the status of the pod and ensure that it is running.
ht

kubectl get pods


To retrieve all currently available application logs from the running pod and store them in the file
/opt/KDOB0020l/log_Output.txt, you can use the kubectl logs command. The logs command
retrieves logs from a container in a pod.
kubectl logs -f <pod-name> > /opt/KDOB0020l/log_Output.txt
Replace <pod-name> with the name of the pod.
You can also use -f option to stream the logs.
kubectl logs -f <pod-name> > /opt/KDOB0020l/log_Output.txt &
This command will retrieve the logs from the pod and write them to the
/opt/KDOB0020l/log_Output.txt file.
Please note that the above command will retrieve all logs from the pod, including previous logs. If

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 14/70

you want to retrieve only the new logs that are generated after running the command, you can add
the --since flag to the kubectl logs command and specify a duration, for example --since=24h for logs
generated in the last 24 hours.
Also, please note that, if the pod has multiple containers, you need to specify the container name
using -c option.
kubectl logs -f <pod-name> -c <container-name> > /opt/KDOB0020l/log_Output.txt
The above command will redirect the logs of the specified container to the file.

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Question: 8
Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 15/70

om
Context

.c
It is always useful to look at the resources your applications are consuming in a cluster.

ps
Task
• From the pods running in namespace cpu-stress , write the name only of the pod that is

m
consuming the most CPU to file /opt/KDOBG030l/pod.txt, which has already been created.

du Answer: See the


am
solution below.
Explanation:
ex

Solution:
id
al
.v
w
w
// w

Question: 9
s:
tp
ht

Context
Anytime a team needs to run a container on Kubernetes they will need to define a pod within which
to run the container.
Task
Please complete the following:
• Create a YAML formatted pod manifest
/opt/KDPD00101/podl.yml to create a pod named app1 that runs a container named app1cont using
image Ifccncf/arg-output
with these command line arguments: -lines 56 -F
• Create the pod with the kubect1 command using the YAML file created in the previous step
• When the pod is running display summary data about the pod in JSON format using the kubect1
command and redirect the output to a file named /opt/KDPD00101/out1.json

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 16/70

• All of the files you need to work with have been created, empty, for your convenience

Answer: See the

om
solution below.
Explanation:

.c
Solution:

ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 17/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 18/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Question: 10
Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 19/70

om
Task

.c
Create a new deployment for running.nginx with the following parameters;

ps
• Run the deployment in the kdpd00201 namespace. The namespace has already been created

m
• Name the deployment frontend and configure with 4 replicas
• Configure the pod with a container image of lfccncf/nginx:1.13.7

du
• Set an environment variable of NGINX__PORT=8080 and also expose that port for the container
above
am
Answer: See the
ex

solution below.
id

Explanation:
al

Solution:
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 20/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 21/70

om
.c
ps
m
Question: 11

du
Refer to Exhibit.
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Context
As a Kubernetes application developer you will often find yourself needing to update a running
application.

Task
Please complete the following:
• Update the app deployment in the kdpd00202 namespace with a maxSurge of 5% and a
maxUnavailable of 2%
• Perform a rolling update of the web1 deployment, changing the Ifccncf/ngmx image version to
1.13
• Roll back the app deployment to the previous version

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 22/70

Answer: See the


solution below.
Explanation:

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 23/70

om
Question: 12
Refer to Exhibit.

.c
ps
m
du
am
ex
id
al
.v
w

Context
w

You have been tasked with scaling an existing deployment for availability, and creating a service to
w

expose the deployment within your infrastructure.


//

Task
s:

Start with the deployment named kdsn00101-deployment which has already been deployed to the
tp

namespace kdsn00101 . Edit it to:


ht

• Add the func=webFrontEnd key/value label to the pod template metadata to identify the pod for
the service definition
• Have 4 replicas
Next, create ana deploy in namespace kdsn00l01 a service that accomplishes the following:
• Exposes the service on TCP port 8080
• is mapped to me pods defined by the specification of kdsn00l01-deployment
• Is of type NodePort
• Has a name of cherry

Answer: See the


solution below.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 24/70

Explanation:

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 25/70

Question: 13
Refer to Exhibit.

om
.c
ps
m
du
am
ex

Set Configuration Context:


[student@node-1] $ | kubectl
id

Config use-context k8s


al

Context
.v

A container within the poller pod is hard-coded to connect the nginxsvc service on port 90 . As this
port changes to 5050 an additional container needs to be added to the poller pod which adapts the
w

container to connect to this new port. This should be realized as an ambassador container within the
w

pod.
w

Task
//

• Update the nginxsvc service to serve on port 5050.


s:

• Add an HAproxy container named haproxy bound to port 90 to the poller pod and deploy the
tp

enhanced pod. Use the image haproxy and inject the configuration located at
/opt/KDMC00101/haproxy.cfg, with a ConfigMap named haproxy-config, mounted into the container
ht

so that haproxy.cfg is available at /usr/local/etc/haproxy/haproxy.cfg. Ensure that you update the


args of the poller container to connect to localhost instead of nginxsvc so that the connection is
correctly proxied to the new service endpoint. You must not modify the port of the endpoint in
poller's args . The spec file used to create the initial poller pod is available in
/opt/KDMC00101/poller.yaml

Answer: See the


solution below.
Explanation:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 26/70

Solution:
To update the nginxsvc service to serve on port 5050, you will need to edit the service's definition
yaml file. You can use the kubectl edit command to edit the service in place.
kubectl edit svc nginxsvc
This will open the service definition yaml file in your default editor. Change the targetPort of the
service to 5050 and save the file.
To add an HAproxy container named haproxy bound to port 90 to the poller pod, you will need to
edit the pod's definition yaml file located at /opt/KDMC00101/poller.yaml.
You can add a new container to the pod's definition yaml file, with the following configuration:
containers:
- name: haproxy
image: haproxy

om
ports:
- containerPort: 90

.c
volumeMounts:

ps
- name: haproxy-config
mountPath: /usr/local/etc/haproxy/haproxy.cfg

m
subPath: haproxy.cfg
args: ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]

du
This will add the HAproxy container to the pod and configure it to listen on port 90. It will also mount
the ConfigMap haproxy-config to the container, so that haproxy.cfg is available at
am
/usr/local/etc/haproxy/haproxy.cfg.
To inject the configuration located at /opt/KDMC00101/haproxy.cfg to the container, you will need to
ex

create a ConfigMap using the following command:


kubectl create configmap haproxy-config --from-file=/opt/KDMC00101/haproxy.cfg
id

You will also need to update the args of the poller container so that it connects to localhost instead of
al

nginxsvc. You can do this by editing the pod's definition yaml file and changing the args field to args:
["poller","--host=localhost"].
.v

Once you have made these changes, you can deploy the updated pod to the cluster by running the
w

following command:
w

kubectl apply -f /opt/KDMC00101/poller.yaml


This will deploy the enhanced pod with the HAproxy container to the cluster. The HAproxy container
w

will listen on port 90 and proxy connections to the nginxsvc service on port 5050. The poller
//

container will connect to localhost instead of nginxsvc, so that the connection is correctly proxied to
s:

the new service endpoint.


tp

Please note that, this is a basic example and you may need to tweak the haproxy.cfg file and the args
based on your use case.
ht

Question: 14
Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 27/70

om
.c
Context

ps
Developers occasionally need to submit pods that run periodically.

m
Task

du
Follow the steps below to create a pod that will start at a predetermined time and]which runs to
completion only once each time it is started:
am
• Create a YAML formatted Kubernetes manifest /opt/KDPD00301/periodic.yaml that runs the
ex

following shell command: date in a single busybox container. The command should run every minute
and must complete within 22 seconds or be terminated oy Kubernetes. The Cronjob namp and
id

container name should both be hello


• Create the resource in the above manifest and verify that the job executes successfully at least
al

once
.v
w

Answer: See the


w

solution below.
w

Explanation:
//

Solution:
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 28/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w

Question: 15
//
s:

Refer to Exhibit.
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 29/70

Task
A deployment is falling on the cluster due to an incorrect image being specified. Locate the
deployment, and fix the problem.

Answer: See the


solution below
Explanation:

create deploy hello-deploy --image=nginx --dry-run=client -o yaml > hello-deploy.yaml


Update deployment image to nginx:1.17.4: kubectl set image deploy/hello-

om
deploy nginx=nginx:1.17.4

.c
Question: 16

ps
Refer to Exhibit.

m
du
am
ex
id
al
.v
w
w
w

Set Configuration Context:


//

[student@node-1] $ | kubectl
s:

Config use-context k8s


tp

Task
You have rolled out a new pod to your infrastructure and now you need to allow it to communicate
ht

with the web and storage pods but nothing else. Given the running pod kdsn00201 -newpod edit it to
use a network policy that will allow it to send and receive traffic only to and from the web and
storage pods.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 30/70

om
.c
ps
m
du
am
ex
id

Answer: See the


al

solution below.
.v

Explanation:
w

To allow a pod to send and receive traffic only to and from specific pods, you can use network
w

policies in Kubernetes.
w

First, you will need to create a network policy that defines the allowed traffic. You can create a
network policy yaml file with the following rules:
//

apiVersion: networking.k8s.io/v1
s:

kind: NetworkPolicy
tp

metadata:
name: newpod-network-policy
ht

namespace: default
spec:
podSelector:
matchLabels:
app: kdsn00201-newpod
ingress:
- from:
- podSelector:
matchLabels:
app: web
- podSelector:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 31/70

matchLabels:
app: storage
This policy will only allow incoming traffic to the pod with the label app=kdsn00201-newpod from
pods with the label app=web or app=storage. If you have different labels on your web and storage
pods please update the matchLabels accordingly.
Once you have created the network policy, you can apply it to the cluster by running the following
command:
kubectl apply -f <network-policy-file>.yaml
This will apply the network policy to the cluster, and the newpod will only be able to send and
receive traffic to and from the web and storage pods.
Please note that, NetworkPolicy resource is not available by default, you need to enable the
NetworkPolicy feature on your Kubernetes cluster. This feature is enabled by default on some

om
clusters and must be explicitly enabled on others. You can check if NetworkPolicy is available by
running the command kubectl api-versions | grep networking

.c
Also, you need to ensure that the pods that you want to allow traffic to and from are running on the

ps
same namespace.

m
Question: 17

du
Refer to Exhibit. am
ex
id
al
.v
w
w
// w
s:
tp

Set Configuration Context:


[student@node-1] $ | kubectl
ht

Config use-context k8s


Context
A user has reported an aopticauon is unteachable due to a failing livenessProbe .

Task
Perform the following tasks:
• Find the broken pod and store its name and namespace to /opt/KDOB00401/broken.txt in the
format:
<namespace>/<pod>

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 32/70

The output file has already been created

• Store the associated error events to a file /opt/KDOB00401/error.txt, The output file has already
been created. You will need to use the -o wide output specifier with your command
• Fix the issue.

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w

Answer: See the


//

solution below.
s:

Explanation:
tp

To find the broken pod and store its name and namespace to /opt/KDOB00401/broken.txt, you can
ht

use the kubectl get pods command and filter the output by the status of the pod.
kubectl get pods --field-selector=status.phase=Failed -o
jsonpath='{.items[*].metadata.namespace}/{.items[*].metadata.name}' >
/opt/KDOB00401/broken.txt
This command will list all pods with a status of Failed and output their names and namespaces in the
format <namespace>/<pod>. The output is then written to the /opt/KDOB00401/broken.txt file.
To store the associated error events to a file /opt/KDOB00401/error.txt, you can use the kubectl
describe command to retrieve detailed information about the pod, and the grep command to filter
the output for error events.
kubectl describe pods <pod-name> --namespace <pod-namespace> | grep -i error -B5 -A5 >
/opt/KDOB00401/error.txt

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 33/70

Replace <pod-name> and <pod-namespace> with the name and namespace of the broken pod you
found in the previous step.
This command will output detailed information about the pod, including error events. The grep
command filters the output for lines containing "error" and also prints 5 lines before and after the
match.
To fix the issue, you need to analyze the error events and find the root cause of the issue.
It could be that the application inside the pod is not running, the container image is not available,
the pod has not enough resources, or the liveness probe configuration is incorrect.
Once you have identified the cause, you can take appropriate action, such as restarting the
application, updating the container image, increasing the resources, or modifying the liveness probe
configuration.
After fixing the issue, you can use the kubectl get pods command to check the status of the pod and

om
ensure

.c
Question: 18

ps
Refer to Exhibit.

m
du
am
ex
id
al
.v
w
w
// w

Context
s:

A project that you are working on has a requirement for persistent data to be available.
tp

Task
ht

To facilitate this, perform the following tasks:

• Create a file on node sk8s-node-0 at /opt/KDSP00101/data/index.html with the content


Acct=Finance
• Create a PersistentVolume named task-pv-volume using hostPath and allocate 1Gi to it, specifying
that the volume is at /opt/KDSP00101/data on the cluster's node. The configuration should specify
the access mode of ReadWriteOnce . It should define the StorageClass name exam for the
PersistentVolume , which will be used to bind PersistentVolumeClaim requests to this
PersistenetVolume.
• Create a PefsissentVolumeClaim named task-pv-claim that requests a volume of at least 100Mi

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 34/70

and specifies an access mode of ReadWriteOnce


• Create a pod that uses the PersistentVolmeClaim as a volume with a label app: my-storage-app
mounting the resulting volume to a mountPath /usr/share/nginx/html inside the pod

om
.c
ps
m
du
am
Answer: See the
ex

solution below.
id

Explanation:
al

Solution:
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 35/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 36/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 37/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp

Question: 19
ht

Refer to Exhibit.

Given a container that writes a log file in format A and a container that converts log files from format

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 38/70

A to format B, create a deployment that runs both containers such that the log files from the first
container are converted by the second container, emitting logs in format B.

Task:
• Create a deployment named deployment-xyz in the default namespace, that:
• Includes a primary
lfccncf/busybox:1 container, named logger-dev
• includes a sidecar Ifccncf/fluentd:v0.12 container, named adapter-zen
• Mounts a shared volume /tmp/log on both containers, which does not persist when the pod
is deleted
• Instructs the logger-dev
container to run the command

om
.c
ps
m
du
am
which should output logs to /tmp/log/input.log in plain text format, with example values:
ex
id
al

• The adapter-zen sidecar container should read /tmp/log/input.log and output the data to
.v

/tmp/log/output.* in Fluentd JSON format. Note that no knowledge of Fluentd is required to


w

complete this task: all you will need to achieve this is to create the ConfigMap from the spec file
w

provided at /opt/KDMC00102/fluentd-configma p.yaml , and mount that ConfigMap to /fluentd/etc


in the adapter-zen sidecar container
// w

Answer: See the


s:

solution below.
tp

Explanation:
ht

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 39/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 40/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 41/70

om
Question: 20

.c
ps
Refer to Exhibit.

m
du
am
ex
id
al
.v

Task
w

A Deployment named backend-deployment in namespace staging runs a web application on port


w

8081.
// w
s:
tp
ht

Answer: See the


solution below.
Explanation:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 42/70

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 43/70

om
.c
ps
m
Question: 21

Refer to Exhibit.
du
am
ex
id
al
.v
w
w
w

Task:
//

Update the Deployment app-1 in the frontend namespace to use the existing ServiceAccount app.
s:
tp

Answer: See the


ht

solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 44/70

om
.c
ps
m
du
Question: 22
Refer to Exhibit.
am
ex
id
al
.v
w
w
// w
s:

Task:
A pod within the Deployment named buffale-deployment and in namespace gorilla is logging errors.
tp

1) Look at the logs identify errors messages.


ht

Find errors, including User “system:serviceaccount:gorilla:default” cannot list resource “deployment”


[…] in the namespace “gorilla”

2) Update the Deployment buffalo-deployment to resolve the errors in the logs of the Pod.
The buffalo-deployment ‘S manifest can be found at -/prompt/escargot/buffalo-deployment.yaml

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 45/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 46/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 47/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 48/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 49/70

om
.c
ps
m
du
am
Question: 23

Refer to Exhibit.
ex
id
al
.v
w
w
// w
s:
tp

Task:
ht

1) First update the Deployment cka00017-deployment in the ckad00017 namespace:


*To run 2 replicas of the pod
*Add the following label on the pod:
Role userUI
2) Next, Create a NodePort Service named cherry in the ckad00017 nmespace exposing the
ckad00017-deployment Deployment on TCP port 8888

Answer: See the


solution below.
Explanation:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 50/70

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 51/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 52/70

om
.c
ps
m
du
Question: 24
Refer to Exhibit.
am
ex
id
al
.v
w
w
// w

Task:
s:

Create a Pod named nginx resources in the existing pod resources namespace.
tp

Specify a single container using nginx:stable image.


Specify a resource request of 300m cpus and 1G1 of memory for the Pod’s container.
ht

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 53/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Question: 25

Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 54/70

om
Task:
Create a Deployment named expose in the existing ckad00014 namespace running 6 replicas of a
Pod. Specify a single container using the ifccncf/nginx: 1.13.7 image

.c
Add an environment variable named NGINX_PORT with the value 8001 to the container then expose

ps
port 8001

m
Answer: See the

du
solution below.
am
Explanation:

Solution:
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 55/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

Question: 26
Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 56/70

om
Task:
1) Fix any API depreciation issues in the manifest file -/credible-mite/www.yaml so that this
application can be deployed on cluster K8s.

.c
ps
m
du
2) Deploy the application specified in the updated manifest file -/credible-mite/www.yaml in
namespace cobra
am
Answer: See the
ex

solution below.
Explanation:
id
al

Solution:
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 57/70

om
.c
ps
m
du
Question: 27
Refer to Exhibit.
am
ex
id
al
.v
w
w
// w

Task:
s:

1) Create a secret named app-secret in the default namespace containing the following single key-
tp

value pair:
Key3: value1
ht

2) Create a Pod named ngnix secret in the default namespace.Specify a single container using the
nginx:stable image.
Add an environment variable named BEST_VARIABLE consuming the value of the secret key3.

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 58/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w

Question: 28
s:

Refer to Exhibit.
tp
ht

Task:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 59/70

1- Update the Propertunel scaling configuration of the Deployment web1 in the ckad00015
namespace setting maxSurge to 2 and maxUnavailable to 59
2- Update the web1 Deployment to use version tag 1.13.7 for the Ifconf/nginx container image.
3- Perform a rollback of the web1 Deployment to its previous version

Answer: See the


solution below.
Explanation:

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 60/70

om
.c
ps
m
du
Question: 29
Refer to Exhibit.
am
ex
id
al
.v
w
w
// w
s:
tp

Task:
ht

Modify the existing Deployment named broker-deployment running in namespace quetzal so that its
containers.
1) Run with user ID 30000 and
2) Privilege escalation is forbidden
The broker-deployment is manifest file can be found at:

Answer: See the


solution below.
Explanation:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 61/70

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w

Question: 30
//

Refer to Exhibit.
s:
tp
ht

Task:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 62/70

Update the Pod ckad00018-newpod in the ckad00018 namespace to use a NetworkPolicy allowing
the Pod to send and receive traffic only to and from the pods web and db

Answer: See the


solution below.

om
Explanation:

Solution:

.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp

Question: 31
ht

Refer to Exhibit.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 63/70

Context

om
You are asked to prepare a Canary deployment for testing a new application release.
Task:
A Service named krill-Service in the goshark namespace points to 5 pod created by the Deployment

.c
named current-krill-deployment

ps
m
du
am
ex
id
al
.v
w
w
// w
s:

1) Create an identical Deployment named canary-kill-deployment, in the same namespace.


tp

2) Modify the Deployment so that:


-A maximum number of 10 pods run in the goshawk namespace.
ht

-40% of the krill-service ‘s traffic goes to the canary-krill-deployment pod(s)

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 64/70

om
.c
ps
m
du
am
ex

Answer: See the


id

solution below.
Explanation:
al
.v

Solution:
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 65/70

om
.c
ps
m
du
Question: 32 am
Refer to Exhibit.
ex
id
al
.v
w
w
// w
s:
tp

Task:
The pod for the Deployment named nosql in the craytisn namespace fails to start because its
ht

container runs out of resources.


Update the nosol Deployment so that the Pod:
1) Request 160M of memory for its Container
2) Limits the memory to half the maximum memory constraint set for the crayfah name space.

Answer: See the


solution below.

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 66/70

Explanation:

Solution:

om
.c
ps
m
du
am
ex
id
al
.v
w
w
w
//
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 67/70

om
.c
ps
m
du
Question: 33
Refer to Exhibit.
am
ex
id

Task:
A Dockerfile has been prepared at -/human-stork/build/Dockerfile
al

1) Using the prepared Dockerfile, build a container image with the name macque and lag 3.0. You
.v

may install and use the tool of your choice.


w
w
// w
s:
tp

2) Using the tool of your choice export the built container image in OC-format and store it at -
ht

/human stork/macque 3.0 tar

Answer: See the


solution below.
Explanation:

Solution:

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 68/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 69/70

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html
Questions and Answers PDF 70/70

Thank you for your visit.


To try more exams, please visit below link
https://www.validexamdumps.com/CKAD.html

om
.c
ps
m
du
am
ex
id
al
.v
w
w
// w
s:
tp
ht

https://www.validexamdumps.com/CKAD.html

You might also like