Ckadv5 0
Ckadv5 0
Exam CKAD
Certified Kubernetes Application
[ Total Questions: 33 ]
Certify For Sure with IT Exam Dumps
1. Exhibit:
Task
You have rolled out a new pod to your infrastructure and now you need to allow it to communicate 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.
Answer:
Explanation:
metadata:
- Egress
- Ingress ingress:
- {}
1
Certify For Sure with IT Exam Dumps
egress:
- to:
- to:
- podSelector: matchLabels:
- ports:
2. Exhibit:
Context
As a Kubernetes application developer you will often find yourself needing to update a running application.
Task
• 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
Answer:
Explanation:
Solution:
2
Certify For Sure with IT Exam Dumps
3
Certify For Sure with IT Exam Dumps
3. Exhibit:
Given a container that writes a log file in format A and a container that converts log files from format A to
format B, create a deployment that runs both containers such that the log files from the first container are
Task:
•Includes a primary
•Mounts a shared volume /tmp/log on both containers, which does not persist when the pod is deleted
which should output logs to /tmp/log/input.log in plain text format, with example values:
• The adapter-zen sidecar container should read /tmp/log/input.log and output the data to /tmp/log/output.*
in Fluentd JSON format. Note that no knowledge of Fluentd is required to complete this task: all you will
need to achieve this is to create the ConfigMap from the spec file provided at
sidecar container
Answer:
4
Certify For Sure with IT Exam Dumps
Explanation:
Solution:
5
Certify For Sure with IT Exam Dumps
6
Certify For Sure with IT Exam Dumps
4. Exhibit:
Task
• Run the deployment in the kdpd00201 namespace. The namespace has already been created
• Set an environment variable of NGINX PORT=8080 and also expose that port for the container above
Answer:
Explanation:
Solution:
7
Certify For Sure with IT Exam Dumps
8
Certify For Sure with IT Exam Dumps
5. Exhibit:
Task:
The pod for the Deployment named nosql in the craytisn namespace fails to start because its container runs
out of resources.
Answer:
Explanation:
Solution:
9
Certify For Sure with IT Exam Dumps
10
Certify For Sure with IT Exam Dumps
6. Exhibit:
Context
You have been tasked with scaling an existing deployment for availability, and creating a service to expose
Task
Start with the deployment named kdsn00101-deployment which has already been deployed to the
• 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:
11
Certify For Sure with IT Exam Dumps
• is mapped to me pods defined by the specification of kdsn00l01-deployment
• Is of type NodePort
Answer:
Explanation:
Solution:
12
Certify For Sure with IT Exam Dumps
7. Exhibit:
Task:
Modify the existing Deployment named broker-deployment running in namespace quetzal so that its
containers.
Answer:
Explanation: Solution:
13
Certify For Sure with IT Exam Dumps
8. Exhibit:
Context
14
Certify For Sure with IT Exam Dumps
• Find the broken pod and store its name and namespace to /opt/KDOB00401/broken.txt in the format:
• 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
Answer:
Explanation:
Solution:
-f http://k8s.io/docs/tasks/configure-pod-container/
exec-liveness.yaml
Within 30 seconds, view the Pod events: kubectl describe pod liveness-exec
15
Certify For Sure with IT Exam Dumps
"gcr.io/google_containers/busybox"
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Pulled Successfully pulled image
"gcr.io/google_containers/busybox"
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Created Created container with docker id
86849c15382e; Security:[seccomp=unconfined]
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Started Started container with docker id
86849c15382e
After 35 seconds, view the Pod events again: kubectl describe pod liveness-exec
At the bottom of the output, there are messages indicating that the liveness probes have failed, and the
"gcr.io/google_containers/busybox"
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Pulled Successfully pulled image
"gcr.io/google_containers/busybox"
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Created Created container with docker id
86849c15382e; Security:[seccomp=unconfined]
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Started Started container with docker id
86849c15382e
2s 2s 1 {kubelet worker0} spec.containers{liveness} Warning Unhealthy Liveness probe failed: cat: can't
Wait another 30 seconds, and verify that the Container has been restarted: kubectl get pod liveness-exec
9. Exhibit:
16
Certify For Sure with IT Exam Dumps
Task:
Create a Pod named nginx resources in the existing pod resources namespace. Specify a single container
Specify a resource request of 300m cpus and 1G1 of memory for the Pod’s container.
Answer:
Explanation:
Solution:
17
Certify For Sure with IT Exam Dumps
10. Exhibit:
Task:
A pod within the Deployment named buffale-deployment and in namespace gorilla is logging errors.
Find errors, including User “system:serviceaccount:gorilla:default” cannot list resource “deployment” […] in
18
Certify For Sure with IT Exam Dumps
Answer:
Explanation:
Solution:
11. Exhibit:
Context
Follow the steps below to create a pod that will start at a predetermined time and]which runs to completion
• Create a YAML formatted Kubernetes manifest /opt/KDPD00301/periodic.yaml that runs the 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 container name
19
Certify For Sure with IT Exam Dumps
should both be hello
• Create the resource in the above manifest and verify that the job executes successfully at least once
Answer:
Explanation:
Solution:
20
Certify For Sure with IT Exam Dumps
12. Exhibit:
Context
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 container to
connect to this new port. This should be realized as an ambassador container within the pod.
Task
• Add an HAproxy container named haproxy bound to port 90 to the poller pod and deploy the 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 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:
Explanation:
Solution:
selector:
- containerPort: 90
21
Certify For Sure with IT Exam Dumps
This makes it accessible from any node in your cluster. Check the nodes the Pod is running on: kubectl
apply -f ./run-my-nginx.yaml
my-nginx-3800858182-kna2y 1/1 Running 0 13s 10.244.2.5 kubernetes-minion-ljyd Check your pods' IPs:
podIP: 10.244.2.5
13. Exhibit:
Context
Task
Update the app-a deployment in the production namespace to run as the restrictedservice service account.
Answer:
Explanation:
Solution:
22
Certify For Sure with IT Exam Dumps
14. Exhibit:
Task
A Deployment named backend-deployment in namespace staging runs a web application on port 8081.
Answer:
Explanation: Solution:
23
Certify For Sure with IT Exam Dumps
24
Certify For Sure with IT Exam Dumps
15. Exhibit:
Context
A project that you are working on has a requirement for persistent data to be available. Task
• 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
• Create a PefsissentVolumeClaim named task-pv-claim that requests a volume of at least 100Mi and
• Create a pod that uses the PersistentVolmeClaim as a volume with a label app: my-storage-app mounting
25
Certify For Sure with IT Exam Dumps
Answer:
Explanation:
Solution:
26
Certify For Sure with IT Exam Dumps
27
Certify For Sure with IT Exam Dumps
16. Exhibit:
Context
You are tasked to create a ConfigMap and consume the ConfigMap in a pod using a volume mount. Task
28
Certify For Sure with IT Exam Dumps
• Create a ConfigMap named another-config containing the key/value pair: key4/value3
nginx image, and mount the key you just created into the pod under directory /also/a/path
Answer:
Explanation:
Solution:
29
Certify For Sure with IT Exam Dumps
30
Certify For Sure with IT Exam Dumps
17. Exhibit:
Task:
Answer:
Explanation: Solution:
31
Certify For Sure with IT Exam Dumps
18. Exhibit:
Task:
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:
Explanation:
Solution:
32
Certify For Sure with IT Exam Dumps
19. Exhibit:
Context
The desired behavior is to have Kubemetes restart the pod when an endpoint returns an HTTP 500 on the
/healthz endpoint. The service, probe-pod, should never send traffic to the pod while it is failing. Please
• 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.
• The application has another endpoint /healthz that will indicate if the application is still working as
expected by returning an HTTP 200. If the endpoint returns an HTTP 500 the application is no longer
responsive.
33
Certify For Sure with IT Exam Dumps
• The probes should use port 8080
Answer:
Explanation:
Solution:
test: liveness
name: liveness-exec
spec: containers:
- name: liveness
image: k8s.gcr.io/busybox
args:
- /bin/sh
- -c
- cat
- /tmp/healthy
initialDelaySeconds: 5
periodSeconds: 5
In the configuration file, you can see that the Pod has a single Container. The periodSeconds field specifies
that the kubelet should perform a liveness probe every 5 seconds. The initialDelaySeconds field tells the
kubelet that it should wait 5 seconds before performing the first probe. To perform a probe, the kubelet
executes the command cat /tmp/healthy in the target container. If the command succeeds, it returns 0, and
the kubelet considers the container to be alive and healthy. If the command returns a non-zero value, the
For the first 30 seconds of the container's life, there is a /tmp/healthy file. So during the first 30 seconds, the
command cat /tmp/healthy returns a success code. After 30 seconds, cat /tmp/healthy returns a failure co
34
Certify For Sure with IT Exam Dumps
Create the Pod:
events:
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Pulling pulling image "k8s.gcr.io/busybox"
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Pulled Successfully pulled image
"k8s.gcr.io/busybox"
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Created Created container with docker id
86849c15382e; Security:[seccomp=unconfined]
23s 23s 1 {kubelet worker0} spec.containers{liveness} Normal Started Started container with docker id
86849c15382e
After 35 seconds, view the Pod events again: kubectl describe pod liveness-exec
At the bottom of the output, there are messages indicating that the liveness probes have failed, and the
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Pulling pulling image "k8s.gcr.io/busybox"
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Pulled Successfully pulled image
"k8s.gcr.io/busybox"
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Created Created container with docker id
86849c15382e; Security:[seccomp=unconfined]
36s 36s 1 {kubelet worker0} spec.containers{liveness} Normal Started Started container with docker id
86849c15382e
2s 2s 1 {kubelet worker0} spec.containers{liveness} Warning Unhealthy Liveness probe failed: cat: can't
35
Certify For Sure with IT Exam Dumps
Wait another 30 seconds, and verify that the container has been restarted: kubectl get pod liveness-exec
The output shows that RESTARTS has been incremented: NAME READY STATUS RESTARTS AGE
20. Exhibit:
Task
You are required to create a pod that requests a certain amount of CPU and memory, so it gets scheduled
• Create a pod named nginx-resources in the pod-resources namespace that requests a minimum of 200m
Answer:
Explanation:
Solution:
36
Certify For Sure with IT Exam Dumps
37
Certify For Sure with IT Exam Dumps
21. Exhibit:
Context
It is always useful to look at the resources your applications are consuming in a cluster. Task
• From the pods running in namespace cpu-stress , write the name only of the pod that is consuming the
Answer:
Explanation:
Solution:
22. Exhibit:
38
Certify For Sure with IT Exam Dumps
Task:
Role userUI
Answer:
Explanation:
Solution:
39
Certify For Sure with IT Exam Dumps
40
Certify For Sure with IT Exam Dumps
41
Certify For Sure with IT Exam Dumps
23. Exhibit:
Task
A deployment is falling on the cluster due to an incorrect image being specified. Locate the deployment,
Answer:
Explanation:
nginx=nginx:1.17.4
24. Exhibit:
Context
You sometimes need to observe a pod's logs, and write those logs to a file for further analysis. Task
• Deploy the counter pod to the cluster using the provided YAMLspec file at /opt/KDOB00201/counter.yaml
• Retrieve all currently available application logs from the running pod and store them in the file
Answer:
42
Certify For Sure with IT Exam Dumps
Explanation:
Solution:
25. Exhibit:
43
Certify For Sure with IT Exam Dumps
Task:
1- Update the Propertunel scaling configuration of the Deployment web1 in the ckad00015 namespace
2- Update the web1 Deployment to use version tag 1.13.7 for the Ifconf/nginx container image. 3- Perform a
Answer:
Explanation: Solution:
44
Certify For Sure with IT Exam Dumps
26. Exhibit:
Context
You are tasked to create a secret and consume the secret in a pod using environment variables as follow:
Task
• Start an nginx pod named nginx-secret using container image nginx, and add an environment variable
exposing the value of the secret key key 1, using COOL_VARIABLE as the name for the environment
Answer:
Explanation:
Solution:
45
Certify For Sure with IT Exam Dumps
46
Certify For Sure with IT Exam Dumps
27. 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
/opt/KDPD00101/podl.yml to create a pod named app1 that runs a container named app1cont using image
Ifccncf/arg-output
• 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
• All of the files you need to work with have been created, empty, for your convenience
Answer:
47
Certify For Sure with IT Exam Dumps
See the solution below.
Explanation:
Solution:
48
Certify For Sure with IT Exam Dumps
49
Certify For Sure with IT Exam Dumps
28. Exhibit:
Task:
Answer:
Explanation:
Solution:
50
Certify For Sure with IT Exam Dumps
29. Exhibit:
51
Certify For Sure with IT Exam Dumps
Context
Create a pod with the following characteristics, and leave it running when complete:
• The pod must run in the web namespace. The namespace has already been created
Answer:
Explanation:
Solution:
30. Exhibit:
Task:
Key3: value1
52
Certify For Sure with IT Exam Dumps
Add an environment variable named BEST_VARIABLE consuming the value of the secret key3.
Answer:
Explanation: Solution:
31. Exhibit:
53
Certify For Sure with IT Exam Dumps
Task:
Create a Deployment named expose in the existing ckad00014 namespace running 6 replicas of a Pod.
Add an environment variable named NGINX_PORT with the value 8001 to the container then expose port
8001
Answer:
Explanation:
Solution:
54
Certify For Sure with IT Exam Dumps
32. Exhibit:
55
Certify For Sure with IT Exam Dumps
Context
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 named
current-krill-deployment
56
Certify For Sure with IT Exam Dumps
Answer:
Explanation:
Solution:
33. Exhibit:
57
Certify For Sure with IT Exam Dumps
Task:
Update the Deployment app-1 in the frontend namespace to use the existing ServiceAccount app.
Answer:
Explanation: Solution:
58