Kubernetes

What is Kubernetes

  • Cluster operating system
  • Container orchestrator

Kubernetes is not Docker

The application runs in a container but ...

Kubertenes takes care of where and how

manages multiple machines (virtual or physical) where containers run

Kubernetes

[note] How Kubernetes and Docker relate:

  • Docker takes care of running processes
  • Kubernetes takes care of the whole cluster [/note]

What Kubernetes is for

Cluster management tool, allocation and continuous use of resources:

  • disk space
  • CPU
  • GPU
  • network connection
  • RAM

Why Kubernetes

Your application runs containers on your cluster or cloud.

So that we can easily scale horizontally

Kubernetes for developers

  • DevOps
  • Continuous Integration - Continuous Deployment
  • Facilitate the application deployment and quality control process
  • build, test, installation, deployment

Kubernetes for managers

  • cost optimization
  • layer of compatibility between individual cloud service providers
    • easier transfer between private-public cloud

Kubernetes for administrators

  • easier management of a large number of physical resources
  • resources do not have to be in one place
  • ensuring fault tolerance

High availability

We can decommission any node in the cluster without downtime.

There is no "single point of failure"

Kubernetes is durable

against hardware or software failure.

  • If the application crashes, it restarts (possibly on another node).
  • if the whole node crashes, the load is taken over by another node.

Scaling and elasticity

  • Resources adapt to changing needs
  • we only pay for what we consume

The amount of resources required varies over time.

  • computing power
  • disk space
  • connectivity

Scalability

Horizontal scalability - we will add a new (virtual) device.

Vertical scalability - we extend the existing device (add disk, processor or memory).

Vertical Scaling

We will expand the server

  • more RAM
  • more CPU
  • server replacement

Horizontal scaling

We will buy or rent another server

Elasticity

The size of the cluster adapts to needs.

  • Runs multiple instances as needed, the system ensures load balancing (Load Balancing)
  • If the load is reduced, we can cancel the node. If the load decreases, we can cancel the node.

Kubernetes is a clustered operating system

  • Highly available
  • elastic
  • easily scalable

k8s cluster:

  • Control nodes
  • Working nodes
  • Infrastructure nodes - register, load balancer

one to thousands of nodes

Components

  • api server
  • etcd
  • scheduler
  • controller manager
  • kubelet
  • kubeproxy
  • run-time container
arch

According to official documentation

Components on control nodes

  • api server
  • etcd
  • scheduler
  • controller manager

API server

  • communication with the cluster
  • communication with nodes

It has its own URL with which we can manage the cluster.

etcd

distributed database that stores:

  • configuration
  • logs
  • condition of objects

scheduler

decides where the load will start and run

controller manager

ensures that the state of the cluster is consistent with the configuration

  • starts or cancels the load as required

Components on Work Nodes

  • kubelet
  • kubeproxy

They can also run on control nodes

kubelet

takes care of the running of the load in the container at the work node

  • starts and cancels processes (containers)

kubeproxy

mediates the connection between nodes

Public Cloud: Kubernetes Providers

Kubernetes Cluster can run on:

  • Your laptop
  • Your data center
  • At a provider such as PAAS

Private Cloud: Kubernetes Distribution

  • kubeadm / vanilla Kubernetes
  • OpenShift - Tectonic - OKD
  • Rancher
  • Ubuntu

Mini K8S Distribution

  • minicube
  • minishift
  • microk8s
  • k3s

Kuberetes na Cloud

  • Amazon Elastic Kubernetes Service EKS
  • Google Kubernetes Engine GKE
  • Microsoft Azure Kubernetes Service AKS
  • Alibaba Container Service for Kubernetes ACK

Azure Kubernetes Service

Platform as a Sevice

Can be created on request

Properties

  • Dynamic allocation of resources according to current needs.
  • Integration with CI-CD chain.
  • Integration with other services and SW from MS (Visual Studio).
  • Active Directory authentication.
  • Options for logging, securing and monitoring cloud.
  • Various types of virtual machines, including GPUs.
  • Different types of storage space (object, block, file) - Azure Disk, Azure Files

Upon request, one or more work nodes will be created in the cloud, Kubernetes is being installed.

Kubernetes

New operating system

Storage

https://docs.microsoft.com/en-us/azure/aks/concepts-storage

  • Volumes
  • PersistentVolumes
  • PersistentVolumeClaims
  • Storage Classes
Reload?