Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery. Kubernetes builds upon 15 years of experience of running production workloads at Google, combined with best-of-breed ideas and practices from the community.
2. “A Cloudy History of Time”
1940
1950
1960
1970
1980
1990
2000
Timesharing Companies
& Data Processing Industry
Grids
Peer to peer systems
Clusters
The first datacenters!
PCs
(not distributed!)
Clouds and datacenters
2012
2
10. Mesos/Marathon Architecture
• Apache Mesos is a resource manager and provides a
datacenter view of a cluster of machines.
• Works in a Master/Slave architecture.
• Master schedules job on slaves which is executed by an
executor.
• Masters are connected to service registry such as Zookeeper
for leader election and HA.
• Offers resources to any framework connected on top of it.
• Marathon is a scheduler/framework providing orchestration
capabilities.
Mesos Master
Assigns jobs to slaves and make resource offers to framework
Mesos Slave
Runs Mesos agents. Executes tasks and provides resource
capacity to master
Zookeeper
Leader election of Masters
Framework
Selects and schedules tasks via resource offers. Deploys
executors on agents to execute scheduled tasks
11. Docker Swarm Architecture
docker swarm init <<options>>
docker swarm join <<options>>
• Directly available within Docker engine from docker 1.12.
• Enable cluster setup in swarm mode with simple commands
• Create services instead of containers.
• Managers talk to workers to schedule tasks on the worker.
• Managers use Raft algorithm for leader election.
• Worker nodes communicate through gossip protocol.
• In built support for Service Registry and discovery.
• No need for external services like consul, etcd.
• In built Load balancing.
• Multi host container networking via Overlay networks
• Secured by default via TLS.
• Automatic reconciliation to desired state of cluster.
Master
Schedules tasks on slaves and exposes service commands.
Slave
Executes containers
Internal Key Value Store
Inbuilt key values store for master leader election using Raft
algorithm
12. CoreOS
• Linux distribution
• Rolling upgrades
• Minimal OS
• Docker support
• etcd and fleet tools
to manage distributed
applications based on
containers.
• Cloud-init support
• Systemd units
23. K8s provides container-centric infrastructure
Once specific containers are no longer bound to specific machines/VMs,
host-centric infrastructure no longer works
• Scheduling: Decide where my containers should run
• Lifecycle and health: Keep my containers running despite failures
• Scaling: Make sets of containers bigger or smaller
• Naming and discovery: Find where my containers are now
• Load balancing: Distribute traffic across a set of containers
• Storage volumes: Provide data to containers
• Logging and monitoring: Track what’s happening with my containers
• Debugging and introspection: Enter or attach to containers
• Identity and authorization: Control who can do things to my containers
23
24. K8s API Objects
● API Objects:
○ Abstraction of system state
○ Spec: desired state
○ Status: current state
○ Operations
○ Create/Delete/Update/Get/List
○ Basic Objects:
○ Pod, Volume, Service, Namespace
○ High-level abstractions (controllers):
○ ReplicationSet, StatefulSet, DaemonSet, etc.
● Control Plane:
○ Make cluster’s current state match the desired state
apiVersion: v1
kind: Node
spec:
externalID: "3877693740656810196"
podCIDR: 10.100.0.0/24
status:
addresses:
- address: 10.128.0.2
type: InternalIP
- address: 104.198.141.183
type: ExternalIP
capacity:
cpu: "1"
memory: 3794520Ki
pods: "110"
storage: 16310120Ki
conditions:
- lastHeartbeatTime: 2017-06-07T02:38:14Z
message: RouteController created a route
reason: RouteCreated
status: "False"
API Object Example: Node
24