Skip to content
/ my-cka-journey Public template

This is what I have done to achieve the CKA

Notifications You must be signed in to change notification settings

jandroav/my-cka-journey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 

Repository files navigation

my-cka-journey

Prepare your exam

Exam tips

  1. Set the following before starting the examn:

    alias k=kubectl                         # will already be pre-configured
    export do="--dry-run=client -o yaml"    # k get pod x $do
    export now="--force --grace-period 0"   # k delete pod x $now
  2. Create the file ~/.vimrc with the following content:

    set tabstop=2
    set expandtab
    set shiftwidth=2
  3. Open 2 tabs with the following:

  4. When you have to fix a component (like kubelet) in one cluster, just check how its setup on another node in the same or even another cluster. You can copy config files over etc.

Vim tips

  • :set number followed by Enter to toggle line numbers
  • :set paste to paste fromated yaml
  • Copy&paste
    • Mark lines: Esc+V (then arrow keys)
    • Copy marked lines: y
    • Cut marked lines: d
    • Past lines: p or P

Fast commands

  • Get pod base yaml: k -n namespace run p2-pod --image=nginx:1.21.3-alpine $do > p2-pod.yaml
  • Get pod labels: k -n namespace get pod -L app
  • Create service pod: k -n namespace expose pod p2-pod --name p2-service --port 3000 --target-port 80
  • Filter by labels: k get svc,ep -l app=check-ip

Important paths & config files

  • /etc/systemd/system/kubelet.service.d/10-kubeadm.conf: Kubelete config file
  • /etc/kubernetes/pki: Certificates
  • cat /etc/kubernetes/manifests/kube-apiserver.yaml | grep etcd: Check etcd config
  • Change CIDR -> /etc/kubernetes/manifests/kube-apiserver.yaml and /etc/kubernetes/manifests/kube-controller-manager.yaml (at --service-cluster-ip-range)

Usefull stuff

Schedule pods in Control Plane nodes (tolerations)

spec:
  tolerations:                            
  - effect: NoSchedule                    
    key: node-role.kubernetes.io/master   

Confirm k8s services are running

  • crictl ps | grep kube-proxy

  • iptables-save | grep p2-service

About

This is what I have done to achieve the CKA

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published