/ #kubernetes #docker 

Kubernetes Basics

Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.


What is Kubernetes?

The name Kubernetes originates from Greek, meaning “helmsman” or “pilot”, and is the root of “governor” and “cybernetic”.

K8s is an abbreviation derived by replacing the 8 letters “ubernete” with 8.

With Kubernetes you can deploy a full cluster of multi-tiered containers (frontend, backend, etc.) with a single configuration file and a single command.

Kubernetes is an open-source platform for automating deployment, scaling, and operations of application containers across clusters of hosts, providing container-centric infrastructure.

With Kubernetes, you are able to quickly and efficiently respond to customer demand:

  • Deploy your applications quickly and predictably.
  • Scale your applications on the fly.
  • Seamlessly roll out new features.
  • Optimize use of your hardware by using only the resources you need

Kubernetes is:

  • portable: public, private, hybrid, multi-cloud
  • extensible: modular, pluggable, hookable, composable
  • self-healing: auto-placement, auto-restart, auto-replication, auto-scaling

TL;DR Kubernetes

  • Container orchestrator
  • Runs and manages containers
  • Supports multiple cloud and bare-metal environments
  • Inspired and informed by Google’s experiences and internal systems
  • 100% Open source, written in Go
  • Manage applications, not machines

Architecture

A running Kubernetes cluster contains node agents (kubelet) and master components (apiserver, scheduler, etc), on top of a distributed storage solution.

K8s Node

Worker / Minion

The Kubernetes node has the services necessary to run application containers and be managed from the master systems.

Each node runs container engine e.g. Docker. This engine takes care of the details of downloading images and running containers.

kubelet

The kubelet manages pods and their containers, their images, their volumes, etc.

kube-proxy

Each node also runs a simple network proxy and load balancer. This reflects services as defined in the Kubernetes API (apiserver) on each node and can do simple TCP and UDP stream forwarding (round robin) across a set of backends.

K8s Master

Control Plane

The Kubernetes control plane is split into a set of components. Currently they all run on a single master node. These components work together to provide a unified view of the cluster.

etcd

All persistent master state is stored in an instance of etcd. This provides a great way to store configuration data reliably. With watch support, coordinating components can be notified very quickly of changes.

API Server

The apiserver serves up the Kubernetes API. It is intended to be a CRUD-y server, with most/all business logic implemented in separate components or in plug-ins. It mainly processes REST operations, validates them, and updates the corresponding objects in etcd (and eventually other stores).

Scheduler

The scheduler binds unscheduled pods to nodes via the /binding API. The scheduler is pluggable, support for multiple cluster schedulers and user-provided schedulers in the plan.

Controller Manager

All other cluster-level functions are currently performed by the Controller Manager.

For instance, Endpoints objects are created and updated by the endpoints controller, and nodes are discovered, managed, and monitored by the node controller. These could eventually be split into separate components to make them independently pluggable. The replicationcontroller is a mechanism that is layered on top of the simple pod API.

Parts & Components

  • Containers: Base Asset
  • Pods: A pod is a co-located group of containers …
  • Pods with Volumes: A pod is a co-located group of containers and volumes. A volume is a directory, possibly with some data in it, which is accessible to a Container as part of its filesystem. Kubernetes volumes build upon Docker Volumes, adding provisioning of the volume directory and/or device.
  • Labels: A label is a key/value pair that is attached to a resource, such as a pod, to convey a user-defined identifying attribute. Labels can be used to organize and to select subsets of resources.
  • Replication Controllers: A replication controller ensures that a specified number of pod replicas are running at any one time. It both allows for easy scaling of replicated systems and handles re-creation of a pod when the machine it is on reboots or otherwise fails.
  • Services: A service defines a set of pods and a means by which to access them, such as single stable IP address and corresponding DNS name.
Author

Eueung Mulyana

Engineer. Lecturer. Programmer. Open Source Enthusiast.