Post

Certified Kubernetes Administrator

Kubernetes Explained

Kubernetes (sometimes shortened to K8s with the 8 standing for the number of letters between the “K” and the “s”) is an open-source system to deploy, scale, and manage containerized applications anywhere.

Kubernetes automates operational tasks of container management and includes built-in commands for deploying applications, rolling out changes to your applications, scaling your applications up and down to fit changing needs, monitoring your applications, and making it easier to manage applications.

Kubernetes Design

Fig 2

Kubernetes Tips

  • Namespace are ways to organize cluster in kubernetes. *Resource isolation
  • IP addresses between pods will be controlled by policy. *Network policy default only ICMP. Hence, policy need to be created for pods to communicate.
  • Physical/VM machine in the cluster are defined as nodes.
  • PVC is a request for storage by a user.
  • PVs are resources in the cluster, PVCs are requests for those resources.
  • Master node specification is 2cpu, 4G ram. *One master can support up to 5000 pods.
  • Cordon, no new pods will be scheduled on that node, but existing pods will contiune to run.
  • Drain, gracefully remove a node from service, running pods are evicted.

Kubernetes Commands

    • First Step: kubectl Cheat Sheet | Kubernetes
       https://kubernetes.io/docs/reference/kubectl/cheatsheet/
    • Command: kubectl config use-context kube-system
    • Command: kubectl config get-contexts
    • Command: kubeadm join 172.31.45.168:6443 --token pqm1jm.tbv0cdbvsxf0idj5 \--discovery-token-ca-cert-hash sha256:8501c87d5269e25246a5a8406f289adf603a435bada3a440b651c49e18b93c3b --ignore-preflight-errors=all
    • Command: kubectl get nodes
    • Command: kubectl get pods
    • Command: kubectl get services
    • Command: kubectl get namespace
    • Command: kubectl run podname --image=image –labels=”label
    • Command: kubectl create namepsace namepspace
    • Command: kubectl expose pod podname –port==6666 –name servicename
    • Command: kubectl expose deployment deployname type=NodePort –port=8080 –name=servicename
    • Command: kubectl create deployment deployname –image=image –replicas=4
    • Command: kubectl replace --force -f /tmp/kubectl-edit-*****.yaml
    • Command: kubectl get nodes –o jsonpath= ‘{.items[*].status.nodeInfo.osImage}’
    • Command: kubectl auth can-i create pods --namespace=development --as john
    • Command: crictl ps - can check containers
    • Command: kubectl api-resources
    • Command: kubectl scale replicaset (name) --replicas=x
    • Command: kubectl scale deployment (name) --replicas=x
    • Command: kubectl create
    • Command: kubectl delete
    • Command: kubectl apply
    • Command: kubectl edit 
    • Command: kubectl describe
    • Command: kubectl set image deployment nginx-deployment nginx=nginx:1.7.9 --record
    • Command: kubectl rollout undo deployment nginx-deployment --to-revision=(number)
    • Command: kubectl describe nodes | grep Taints
    • Slave node command: crictl ps - can check containers
    • Slave node command: systemctl stop kubelet
    • Slave node command: systemctl enable –now kubelet
    • Slave node command: systemctl start kubelet
    • Slave node command: systemctl status kubelet

Exam Details

    • https://kubernetes.io (Exam reference page allowed)
    • https://training.linuxfoundation.org (EXAM simulator & exam registration) aka CNCF
    • 2 hours Lab-based exam, 17 questions with a passing score is 66%. Each question will have different weights.



Reference link

https://cloud.google.com/learn/what-is-kubernetes#

https://kubernetes.io - Exam reference page

https://training.linuxfoundation.org (EXAM simulator & exam registration) aka CNCF

This post is licensed under CC BY 4.0 by the author.