Skip to content

Instantly share code, notes, and snippets.

@benc-uk
Last active June 28, 2024 03:53
Show Gist options
  • Save benc-uk/09cd8e8db23ff3f0e901bc04e0417ea4 to your computer and use it in GitHub Desktop.
Save benc-uk/09cd8e8db23ff3f0e901bc04e0417ea4 to your computer and use it in GitHub Desktop.
CKAD Exam

Official Exam Links & Resources

The Exam Itself

Curriculum

Resources I Used

Themes & Things To Revise & Focus On

  • ConfigMaps & mounting into containers as volumes
  • More ConfigMaps, seriously it was on about three or four questions, practice all the ways of creating & using a ConfigMap DOCS LINK
  • Learn to use every variation of kubectl run and use with or without the --dry-run -o yaml flags, e.g.
    • --restart=Never will create a Pod
    • --restart=Always and --replicas will create a Deployment
    • --restart=OnFailure will create a Job
    • --restart=OnFailure and --schedule will create a CronJob
    • Pass any commands for the pod/container to run at the end of the command after --
      e.g. kubectl run webpod --image nginx --restart Never -- sleep 600
  • Memorise the volumeMount and volumes syntax of pod & container spec, you don't have time to look it up, and it comes up a lot
  • Multi container pods, experiment with deploying this, and sharing a volume using emptyDir
  • Network Policy, podSelectors both for ingress/egress rules and applying the policy
  • PV and PVC, go through creating both and a pod to use the PVC, DOCS LINK
    • Surprise! one question required SSH onto a node to create a file for PV of hostPath type
  • Ingresses are not in the exam, nor are CRDs, Helm, etc, only core, non-beta API objects
  • Editing objects directly with kubectl edit ... only do this if you're confident of the change you're making, i.e. It's something mutable and you know the syntax
    • If you save and it's wrong you're thrown back into the editor. If you're anything less than 99% sure, then export the YAML kubectl get foobar -o yaml --export > blah.yaml and edit that
    • Often the change you are making requires you to delete the object (as it's an immutable field) so kubectl edit is never going to work

Bash/Terminal Tips

Enable kubectl auto complete, very useful and part of the docs so you can copy & paste it
https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-autocomplete

Aliases. Shortening kubectl to k is a HUGE time saver! I used kn as a way to change namespaces

alias k=kubectl
alias kn='kubectl config set-context --current --namespace '

Change editor used by kubectl edit

export KUBE_EDITOR=nano

If a command like delete is taking a while, hit ctrl+z to put it to the background and carry on working

@ramkifx
Copy link

ramkifx commented Feb 18, 2020

Hi Ben, Thanks for wonderful write up the summary. i have basic question on how to switch back to base node from node, where PV question need ssh to node for hostpath.

@benc-uk
Copy link
Author

benc-uk commented Feb 18, 2020

Hi Ben, Thanks for wonderful write up the summary. i have basic question on how to switch back to base node from node, where PV question need ssh to node for hostpath.

I just typed exit in the SSH session and I was back where I needed to be to carry on with the main task

@ramkifx
Copy link

ramkifx commented Feb 18, 2020

Thank you so much Ben, Much Appreciated.

@jagamts1
Copy link

jagamts1 commented Sep 1, 2020

Hi Ben, Thanks for wonderful write up the summary. i have basic question on how to switch back to base node from node, where PV question need ssh to node for hostpath.

I just typed exit in the SSH session and I was back where I needed to be to carry on with the main task

So you were created host path on slave node and created pv and pvc from master node. Did you use node selector?

@arpitmegha1584
Copy link

For me when I tried to do SSH , i went inside though ...kubectl get all ..none of command worked

got The connection to the server localhost:8080 was refused - did you specify the right host or port?

Any way to solve this

@ahmedabuhamid
Copy link

what I understand is that we need to ssh to the worker node to create the host path dir and/or file then exit back to the master node with the correct context to continue with creating the PV, PVC and pod/deploy, am I right ?

@benc-uk
Copy link
Author

benc-uk commented Aug 11, 2021

@ahmedabuhamid yes, that's my memory of it, but it's been a while since I took the exam

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment