What is Kubernetes on DevOps Toolkit
Kubernetes Manages Kubernetes Clusters
Kubernetes cluster consists of
Control plane – typically 3 control plane nodes
Worker node – any numner
External resource – can be anything, but usually storage & external load balancer
Control Plane
Makes global decisions about (& beyond) the cluster.
Components:
o API server: front end of k8. How we access k8 & allocate resources
o Scheduler: watching for resource capacity & assigning workload to nodes. Listens to API
(just like everything else in k8) for direction
o Controller manager – Makes sure shared state operating as expected. Oversees various
controllers (mostly in worker nodes)
o Key Value store – distributed, contains state of cluster, typically etcd
Worker Nodes
Kubelet – tracking state of pods. Ensuring all containers in a pod are running
Kube Proxy – maintains network rules
Container runtime – running containers themselves
Containers – software package to run applications
Pods – can’t run containers directly in Kubernetes. We run them grouped into pods.
o Most pods contain containers plus sidecars
o Sidecars – perform additional helper functions
Controllers – type of application that manages at least one type of resource. Control loop
compares present state to desired state continuously. Some controllers are included in
Kubernetes
o Managed resources might not be inside same kubernetes cluster, or even in Kubernetes
at all
o Controllers are also containers inside pods.
Use cases
Manage applications inside Kubernetes clusters
Example:
o Create “Deployment” resource, which creates …
o Replica Sets – make sure that a specific number of replicas of an application are running.
Those replicas are all pods
o Pods – where application is truly running. A physical computer.
o To deploy a new release of an application:
We instruct Deployment to create a second ReplicaSet
ReplicaSet creates one pod. When pod is running healthy, it starts replacing old
pods with new release pods.
What is Kubernetes on DevOps Toolkit
Kubernetes Manages Application Infrastructure
Example: Cluster, containing Pods of Application A and Application B. A and B communicate
through Service. When we want to access apps from outside, we create Ingress.
Ingress creates an external load balancer, managing resources outside of the cluster itself.
Kubernetes Manages Virtual Machines
Kubernetes can create a virtual machine (via Cuber Vert or other options). Some run inside containers,
some run directly on nodes of the cluster.
Kubernetes Manages External Resources
Kubernetes can instruct other resources via their APIs to create & manage other resources – virtual
machine, database, anything accessible by an API (theoretically). It can even request that an external K8
create a K8 cluster.