100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CKAD Study Exam Questions & Answers 2024/2025

Rating
-
Sold
-
Pages
10
Grade
A+
Uploaded on
26-08-2024
Written in
2024/2025

CKAD Study Exam Questions & Answers 2024/2025 Command to start a pod - ANSWERSkubectl run nginx --image=nginx --restart=Never Command to change image of a pod - ANSWERSkubectl set image pod/nginx nginx=nginx:1.7.1 Sequence to ping a pod from busybox - ANSWERSkubectl run busybox --image=busybox --restart=Never --rm -it -- sh # / wget -O- <pod_ip>:80 #/ exit Output nice yaml from a resource - ANSWERSkubectl get pod nginx -o yaml --export Get logs of a previous version of a pod - ANSWERSkubectl logs nginx -p Attach a process to a running pod - ANSWERSkubectl exec -it nginx -- /bin/sh Set an environment variable from command line - ANSWERSkubectl run nginx --image=nginx --env=var1=val1 Multi-container pod - ANSWERSkubectl run busybox --image=busybox -o yaml --dry-run -- /bin/sh -c 'echo hello;' > # vi , Copy + Paste container list and rename the container kubectl create -f kubectl exec -it busybox -c busybox2 -- /bin/bash # Connect to second container Create a pod with labels - ANSWERSkubectl run --image... --restart=Never --labels=app=v1,label2=val2

Show more Read less
Institution
CKAD
Course
CKAD









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CKAD
Course
CKAD

Document information

Uploaded on
August 26, 2024
Number of pages
10
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CKAD Study Exam Questions & Answers
2024/2025

Command to start a pod - ANSWERSkubectl run nginx --image=nginx --restart=Never



Command to change image of a pod - ANSWERSkubectl set image pod/nginx nginx=nginx:1.7.1



Sequence to ping a pod from busybox - ANSWERSkubectl run busybox --image=busybox --restart=Never
--rm -it -- sh

# / wget -O- <pod_ip>:80

#/ exit



Output nice yaml from a resource - ANSWERSkubectl get pod nginx -o yaml --export



Get logs of a previous version of a pod - ANSWERSkubectl logs nginx -p



Attach a process to a running pod - ANSWERSkubectl exec -it nginx -- /bin/sh



Set an environment variable from command line - ANSWERSkubectl run nginx --image=nginx --
env=var1=val1



Multi-container pod - ANSWERSkubectl run busybox --image=busybox -o yaml --dry-run -- /bin/sh -c
'echo hello;' > pod.yaml

# vi pod.yaml, Copy + Paste container list and rename the container

kubectl create -f pod.yaml

kubectl exec -it busybox -c busybox2 -- /bin/bash # Connect to second container



Create a pod with labels - ANSWERSkubectl run --image... --restart=Never --labels=app=v1,label2=val2

, Show labels on pods / resource - ANSWERSkubectl get pods --show-labels



Label a running pod - ANSWERSkubectl label po nginx app=v2 --overwrite



Get all pods with a certain label - ANSWERSkubectl get po -lapp



Remove a label from a running pod - ANSWERSkubectl label nginx{1..3} app-



Get documentation for a pod spec - ANSWERSkubectl explain po.spec



Annotate a running pod - ANSWERSkubectl annotate po nginx description='test description'

kubectl annotate po nginx description- # Remove



Create pod with 2 replicas and open port 80 from yaml - ANSWERSkubectl create deploy nginx --
image=... --dry-run -oyaml > deploy.yaml

vi deploy.yaml

# Change replicas: 2

# Under containers list add following

ports:

- containerPort: 80



kubectl create -f deploy.yaml



Check status and history of a deployment - ANSWERSkubectl rollout status deploy nginx

kubectl rollout history deploy nginx



Up replicas of a deployment to 5 - ANSWERSkubectl scale deploy nginx --replicas=5

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Bensuda Oxford University
View profile
Follow You need to be logged in order to follow users or courses
Sold
835
Member since
3 year
Number of followers
445
Documents
20956
Last sold
4 days ago
ECONOMICS,NURSING,BIOLOGY AND ALL REVISION MATERIALS

DEDICATED TO PROVIDE YOU WITH THE BEST LEARNING MATERIALS THAT WILL IMPROVE YOUR GRADES ,WELCOME TO ALIZGRADES AND LETS DO IT TOGETHER!!! GOODLUCK!!!!!!!

3.7

156 reviews

5
72
4
24
3
25
2
11
1
24

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions