Skip to content

CKAD

โ€œThe Certified Kubernetes Application Developer exam certifies that users can design, build, configure, and expose cloud native applications for Kubernetes.โ€

Resources

  • https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/install-kubeadm/
  • https://kubernetes.io/docs/reference/command-line-tools-reference/kubelet/
  • https://kubernetes.io/docs/concepts/architecture/nodes/

Utilities

Recent Commands

kubectl -n openfaas get deployments -l โ€œrelease=openfaas, app=openfaasโ€
kubectl rollout status -n openfaas deploy/gateway
kubectl port-forward -n openfaas svc/gateway 8080:8080 &
kubectl proxy

Home Environment

kubectl proxy
  • Check out http://127.0.0.1:8001/
  • Run the following to generate a token: kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user-token | awk '{print $1}')
  • Dashboard: http://127.0.0.1:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/#/login

Imperative Commands

--dry-run

By default as soon as the command is run, the resource will be created. If you simply want to test your command, use the --dry-run=client option. This will not create the resource, instead, tell you whether the resource can be created and if your command is right.

-o yaml

This will output the resource definition in YAML format on the screen.

Examples

kubectl run nginx-pod --image=nginx:alpine
kubectl run redis --image=redis:alpine --labels=tier-db
kubectl expose pod redis --name redis-service --port 6379 --target-port 6379
kubectl describe svc redis-service
kubectl create deploynment webapp --image=kodekloud/webapp-color
kubectl scale deployment --replicas=3
kubectl run custom-nginx --image-nginx --port 8080
kubectl describe pod custom-nginx
kubectl create ns dev-ns
kubectl create deployment redis-deploy --image=redis --namespace=dev-ns
kubectl run httpd --image=httpd:alpine --port 80 --expose --dry-run=client -o yaml
kubectl run httpd --image=httpd:alpine --port 80 --expose
kubectl get pod httpd