Kubernetes Zero To Pro β¨

βοΈ βA stone is broken by the last stroke of the hammer. This does not mean that the first stroke was useless. Success is the result of continuous effort.β βοΈ
Table of Contents π
- ποΈ resources
- π§ core concepts
- π pods
- π― replica sets and replication controllers
- π deployments
- π§ networking
- ποΈ services
- ποΈ microservice architecture
- βοΈ cloud
- π namespaces
- π§ imperative commands
- βοΈ configuration
- π£ container arguments
- πΊοΈ configmaps
- π΅οΈ secrets
- π service accounts
- πΎ resource requirements
- β’οΈ taints and tolerations
- π node selectors and affinity
- π³π³ multi-container pods
- π³π³ multi-container pods
- π₯ init containers
- π¬ observability
- πΈ readiness and liveness probes
- π container logging
- πΈοΈ monitor and debug apps
- π pod design
- π·οΈ labels selectors and annotations
- π jobs
- β³ cron jobs
- π€― advanced services and networking
- βοΈ ingress networking
- π€ network policies
- ποΈ state persistence
- πΎ volumes
- π° persistent volumes
- π© persistent volume claims
- π¦ storage classes
- π stateful sets
- π§ headless service
Kubernetes Architecture ποΈ
Kubernetes coordinates a highly available cluster of computers that are connected to work as a single unit.
-
The
Control Planeis responsible for managing the cluster.-
Components
kube-apiserver- Exposes theKubernetes APIetcd- Consistent and highly-available key value store used as Kubernetesβ backing store for all cluster data.kube-scheduler- Watches for newly createdPodswith no assignednode, and selects anodefor them to run on.kube-controller-manager- Runscontrollerprocesses. Eachcontrolleris a separate process but to keep things simple they are compiled together and run in a single process- Examples
Node controller: Responsible for noticing and responding whennodesgo down.Job controller: Watches for Job objects that represent one-off tasks, then createsPodsto run those tasks to completion.Endpoints controller: Populates the Endpoints object (that is, joins Services & Pods).Service Account&Token controllers: Create default accounts andAPIaccess tokens for newnamespaces
- Examples
cloud-controller-manager- Embeds cloud-specific control logicNode,Route, andService controllerscan have cloud provider dependencies.
-
- A
Nodeis aVMor a physical computer that serves as a worker machine in aKubernetescluster.-
The
nodescommunicate with the control plane using theKubernetes API -
Components
kubelet- An agent that runs on each node in the cluster. It makes sure thatcontainersare running in aPod.kube-proxy- Network proxy that runs on eachnodein your cluster, implementing part of theKubernetesService concept.
Container runtime- Software that is responsible for runningcontainers.
-
Basic Commands π
-
kubectlcommands
-
check version of
Kubernetesbeing usedkubectl version -
get everything
kubectl get all -
get api
resourcesincludes name, shortnames, api version, if namespaced, and kindkubectl api-resources -
get kube-api
versionkubectl api-versions - all resources in kubernetes are grouped into
API groups-
under each
API groupareAPI resourceskubectl api-resourcesAPI resourcesare the objects that can be have verbs act on them from theKubernetes API- verbs:
create,get,describe,delete,update,watch,list
- verbs:
-
-
identify
kube-apiserversettingskubectl describe pod kube-apiserver-controlplane -n kube-system
-
-
minikubecommands
-
Check the status of
minikubeminikube status -
start
minikubeminikube start -
stop
minikubeminikube stop
-