1. Kubernetes Basic
  2. Installing Kubernetes with Kubeadm
  3. Kubernetes Basic Apps Deployment
  4. Understanding K8S Ingress in Simple Way
  5. Understanding K8S Ingress in Simple Way Part 2
  6. Kubernetes Volumes with PV and PVC
  7. Kubernetes Using Your Own NFS Server for Dynamic PVC
  8. Avoid Hitting Docker Rate Limit
  9. How to Safely Drain Your Kubernetes Cluster
  10. How to Accesing Your Kubernetes Dashboard
  11. QuickStart for Calico in Kubernetes

Enable Insecure metrics-server in Kubernetes

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl edit deployment.apps -n kube-system metrics-server

      - args:
        - --kubelet-insecure-tls #add-this

kubectl top node
NAME                            CPU(cores)   CPU%   MEMORY(bytes)   MEMORY%   
sequel.master.kubernetes.id     580m         14%    1914Mi          49%       
sequel.worker01.kubernetes.id   229m         5%     1368Mi          35%       
sequel.worker02.kubernetes.id   230m         5%     1477Mi          38%          

Remove the Taint on the Master for Scheduling Pods

kubectl taint nodes --all node-role.kubernetes.io/master-
kubectl patch node MASTER_NAME -p "{\"spec\":{\"unschedulable\":false}}"

kubectl untaint nodes --all node-role.kubernetes.io/master-

Find Out What Container Runtime is Used on a Node

kubectl --insecure-skip-tls-verify get nodes -o wide
tr \\0 ' ' < /proc/"$(pgrep kubelet)"/cmdline
/usr/bin/kubelet --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf --config=/var/lib/kubelet/config.yaml --container-runtime=remote --container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --pod-infra-containe

EKS: Changing Instance Type For Your Kubernetes Cluster

kubectl cordon [node-name]
kubectl drain  [node-name] --ignore-daemonsets --delete-emptydir-data --disable-eviction

Notes: nfs konfig for this

cat /etc/exports

Handling container error/crashloopback after rebooting master node


Kubeadm reset (clean up messed up k8s preparation)

kubeadm reset
rm -rf /etc/cni /etc/kubernetes /var/lib/dockershim /var/lib/etcd /var/lib/kubelet /var/run/kubernetes ~/.kube/*
iptables -F && iptables -X
iptables -t nat -F && iptables -t nat -X
iptables -t raw -F && iptables -t raw -X
iptables -t mangle -F && iptables -t mangle -X
systemctl restart docker

Kubernetes missing config

sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

Cat ~/.zshrc

alias k='kubectl'
alias kgp='kubectl get pod'
alias klogs='kubectl logs'
alias kgd='kubectl get deployment'
alias kg='kubectl get'
alias k-pod-status='while true; do kgp -A; sleep 10; done'
alias aws-check-id='aws sts get-caller-identity'
alias ekskonfig='aws eks --region us-west-2 update-kubeconfig --name'