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 Plane
is responsible for managing the cluster.-
Components
kube-apiserver
- Exposes theKubernetes API
etcd
- Consistent and highly-available key value store used as Kubernetesβ backing store for all cluster data.kube-scheduler
- Watches for newly createdPods
with no assignednode
, and selects anode
for them to run on.kube-controller-manager
- Runscontroller
processes. Eachcontroller
is 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 whennodes
go down.Job controller
: Watches for Job objects that represent one-off tasks, then createsPods
to run those tasks to completion.Endpoints controller
: Populates the Endpoints object (that is, joins Services & Pods).Service Account
&Token controllers
: Create default accounts andAPI
access tokens for newnamespaces
- Examples
cloud-controller-manager
- Embeds cloud-specific control logicNode
,Route
, andService controllers
can have cloud provider dependencies.
-
- A
Node
is aVM
or a physical computer that serves as a worker machine in aKubernetes
cluster.-
The
nodes
communicate with the control plane using theKubernetes API
-
Components
kubelet
- An agent that runs on each node in the cluster. It makes sure thatcontainers
are running in aPod
.kube-proxy
- Network proxy that runs on eachnode
in your cluster, implementing part of theKubernetes
Service concept.
Container runtime
- Software that is responsible for runningcontainers
.
-
Basic Commands
π
-
kubectl
commands-
check version of
Kubernetes
being usedkubectl version
-
get everything
kubectl get all
-
get api
resources
includes name, shortnames, api version, if namespaced, and kindkubectl api-resources
-
get kube-api
version
kubectl api-versions
- all resources in kubernetes are grouped into
API groups
-
under each
API group
areAPI resources
kubectl api-resources
API resources
are the objects that can be have verbs act on them from theKubernetes API
- verbs:
create
,get
,describe
,delete
,update
,watch
,list
- verbs:
-
-
identify
kube-apiserver
settingskubectl describe pod kube-apiserver-controlplane -n kube-system
-
-
minikube
commands-
Check the status of
minikube
minikube status
-
start
minikube
minikube start
-
stop
minikube
minikube stop
-