Filters
Zo zoek je
  • Gewone woorden vinden namen, teksten en voorbeelden.
  • "twee woorden" vindt precies die zin.
  • --naam of -x vindt een optie.
  • #woord zoekt alleen in commando's.
  • @grep vindt lessen en labs die grep gebruiken.
  • Filters: cat:network · in:labs · in:notes · level:rhcsa · ch:8 · root:yes. Zet ! voor een woord om het weg te laten. OR tussen woorden betekent één ervan.
  • ↑ ↓ bewegen · Enter openen · Esc sluiten · / zoeken

Hoofdstuk 13Naam in de cursus: Exam preparation

Work fast in the CKA exam

The CKA is about speed and accuracy: 15 – 20 hands-on tasks in 2 hours, in a remote desktop, with only the Kubernetes docs. These habits save the most time.

  • 5 Lessen
  • 6 Commando's

Dit deel is nog niet vertaald. Je ziet de Engelse tekst.

$ als gewone gebruiker# als root (of met sudo)

13.1

Set up the terminal once

A few aliases and variables at the start pay back in every task.

alias k=kubectl
complete -o default -F __start_kubectl k
export do="--dry-run=client -o yaml"
export now="--force --grace-period 0"
echo 'set ts=2 sw=2 et ai' >> ~/.vimrc
k run tmp --image=nginx $do > pod.yaml
k delete pod tmp $now

13.2

Use imperative commands

Most objects can be created in one line, or generated as YAML to edit.

ObjectCommand
Podk run web --image=nginx --port=80 --labels=app=web
Deploymentk create deploy web --image=nginx --replicas=3
Servicek expose deploy web --port=80 --target-port=8080
ConfigMapk create cm cfg --from-literal=k=v --from-file=f.conf
Secretk create secret generic s --from-literal=pw=x
Role / bindingk create role r --verb=get,list --resource=pods; k create rolebinding …
Job / CronJobk create job j --image=busybox -- echo hi; k create cronjob …
Ingressk create ingress i --rule="host/path=svc:port"
HPAk autoscale deploy web --min=2 --max=5 --cpu-percent=70

13.3

Find things in the docs fast

kubectl explain is faster than the docs for field names; the docs search is best for full YAML examples.

k explain pod.spec.containers.securityContext
k explain networkpolicy.spec.ingress --recursive | head -30
k api-resources --namespaced=true | grep -i quota

Op het werk

Bookmark nothing (not allowed), but know the doc page titles: "Network Policies", "Configure a Security Context", "Operating etcd clusters", "Upgrading kubeadm clusters", "Persistent Volumes", "Ingress".

13.4

Work through the tasks

Points per task are shown. Do quick tasks first, flag long ones, come back later.

  1. Read the task fully; run the context command it gives.
  2. Note the namespace — most wrong answers are in the wrong namespace.
  3. Make it, then verify (get, describe, auth can-i, curl from a pod).
  4. Move on after 7 – 8 minutes; come back at the end.

Commando's in deze les

13.5

Practise the classic tasks

These appear in some form in almost every exam — do each one many times.

TaskLesson
etcd backup and restoreBack up etcd
Upgrade control plane and a workerUpgrade
Fix a NotReady nodeDebug a node
RBAC for a user or service accountRBAC
NetworkPolicy between namespacesNetworkPolicies
PVC + pod with a mountStorage
Rollout and rollbackWorkloads
Ingress or Gateway routesIngress
Taints, tolerations, node affinityScheduling
Install with HelmHelm

Onthoud

Use killer.sh (2 sessions come with the exam) in the last two weeks. It is harder than the real exam — 60 – 70 % there is a good sign.

Alle commando's in dit hoofdstuk