100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CKAD Code Examples Questions with Solutions $16.49   Add to cart

Exam (elaborations)

CKAD Code Examples Questions with Solutions

 3 views  0 purchase
  • Course
  • CKAD
  • Institution
  • CKAD

Exam of 11 pages for the course CKAD at CKAD (CKAD Code Examples)

Preview 2 out of 11  pages

  • August 7, 2024
  • 11
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CKAD
  • CKAD
avatar-seller
Dreamer252
CKAD Code Examples


Equality-based label requirement - answer=,==,!=

Set-based label requirements - answerin,notin,exists

kubectl imperative cmds - answerscale, annotate, label, set <field>, edit, patch

Using --edit to modify objects before creation - answerkubectl create --edit -f
/tmp/srv.yaml

configuration file for a Pod that has the annotation imageregistry:
https://hub.docker.com/ - answerapiVersion: v1 kind: Pod metadata: name: annotations-
demo annotations: imageregistry: "https://hub.docker.com/" spec: containers: - name:
nginx image: nginx:1.14.2 ports: - containerPort: 80

https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/

Field selectors, ex: filter pods by name "foo" + status.phase "Pending" - answerlet you
select Kubernetes resources based on the value of one or more resource fields with
equality ops & can chain with comma-seperated

ex: kubectl get pods --field-selector metadata.name=foo,status.phase=Pending

Deployment that creates ReplicaSet w/ 3 nginx Pods - answerapiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
labels:
app: nginx
spec:
replicas: 3
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:

, - name: nginx
image: nginx:1.14.2
ports:
- containerPort: 80

https://kubernetes.io/docs/concepts/workloads/controllers/deployment/

main parts: replicas, selector, template

create Job with command, Never restart policy, 4 retrys, 3 completions, 2 parallel runs,
finish in 5s - answerapiVersion: batch/v1
kind: Job
metadata:
name: pi
spec:
template:
spec:
containers:
- name: pi
image: perl
command: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"]
restartPolicy: Never
backoffLimit: 4
completions: 3
parallelism: 2
activeDeadlineSeconds: 5

main parts: spec.template.spec.containers, command, restartPolicy, backoffLimit,
activeDeadlineSeconds

https://kubernetes.io/docs/concepts/workloads/controllers/job/#running-an-example-job

create CronJob w/ arg & print time every minute - answerapiVersion: batch/v1beta1
kind: CronJob
metadata:
name: hello
spec:
schedule: "*/1 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: hello
image: busybox
args:

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller Dreamer252. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $16.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

80364 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$16.49
  • (0)
  Add to cart