kubernetes architecture

19
Kubernetes Architecture Janakiram MSV Analyst | Advisor | Architect Janakiram & Associates Google Developer Expert

Upload: janakiram-msv

Post on 11-Jan-2017

322 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Kubernetes architecture

Kubernetes ArchitectureJanakiram MSVAnalyst | Advisor | ArchitectJanakiram & AssociatesGoogle Developer Expert

Page 2: Kubernetes architecture

Announcing The Kubernetes Webinar Series

● Monthly webinar focused on helping you get started with Kubernetes● Delivered by the experts from the container ecosystem● Each webinar introduces a concept to accelerate your learning● No specific prerequisites

○ Basic understanding of Docker will help

● All attendees will get $100 Google Cloud Platform Credits● Win free annual and monthly subscriptions of MAPT eBook library● The recording of this webinar will be available at Kubernetes.live

Page 3: Kubernetes architecture

Objectives

● A closer look at Kubernetes cluster● Master components● Node components● Pods● Labels & Selectors● Replication Controllers● Services

Page 4: Kubernetes architecture

Kubernetes Architecture

KubernetesMaster

Node 1API

UI

CLI

Node 2

Node n

Node 3

Registry

Page 5: Kubernetes architecture

Kubernetes Master

API Server Scheduler Controller

etcd

API

UI

CLI

Page 6: Kubernetes architecture

Kubernetes Node

kube-proxyDocker kubelet

Supervisord

fluentd

PodPodPod

PodPod

Pod

Pod

Pod

KubernetesMaster

AddonsDNS UI

Page 7: Kubernetes architecture

A Simple Containerized Application

PythonWeb App

Redis Database

Client

Page 8: Kubernetes architecture

Kubernetes Pod

● Group of one or more containers that are always co-located, co-scheduled, and run in a shared context

● Containers in the same pod have the same hostname● Each pod is isolated by

○ Process ID (PID) namespace○ Network namespace○ Interprocess Communication (IPC) namespace○ Unix Time Sharing (UTS) namespace

● Alternative to a VM with multiple processes

Page 9: Kubernetes architecture

Labels & Selectors

● Key/value pairs associated with Kubernetes objects● Used to organize and select subsets of objects● Attached to objects at creation time but modified at any time.● Labels are the essential glue to associate one API object with other

○ Replication Controller -> Pods○ Service -> Pods○ Pods -> Nodes

Page 10: Kubernetes architecture

Deploying a Pod

Pod DefinitionMaster

kube-proxyDocker kubelet

Supervisord

fluentdWeb Pod

Node

DB Pod

Pod Definition

Python

Redis

Page 11: Kubernetes architecture

Services

● An abstraction to define a logical set of Pods bound by a policy by to access them

● Services are exposed through internal and external endpoints ● Services can also point to non-Kubernetes endpoints through a

Virtual-IP-Bridge● Supports TCP and UDP● Interfaces with kube-proxy to manipulate iptables● Service can be exposed internal or external to the cluster

Page 12: Kubernetes architecture

Exposing Services

DB PodWebPod

2

WebPod

1

WebPod

3

ClientNode Port

ClusterIP

Page 13: Kubernetes architecture

DemoCreating Pods & Services

Python Web App & Redis DB

Page 14: Kubernetes architecture

Replication Controller

● Ensures that a Pod or homogeneous set of Pods are always up and available

● Always maintains desired number of Pods○ If there are excess Pods, they get killed○ New pods are launched when they fail, get deleted, or terminated

● Creating a replication controller with a count of 1 ensures that a Pod is always available

● Replication Controller and Pods are associated through Labels

Page 15: Kubernetes architecture

kube-proxyDocker kubelet

Supervisord

fluentd

WebPod

1

Scaling Pods with Replication Controller

RC Definition

Master

Node

Web Pod

2

WebPod

3

3

DB Pod

Page 16: Kubernetes architecture

DemoScaling Pods with Replication Controller

Page 17: Kubernetes architecture

Summary

● Kubernetes Master runs the API, Scheduler and Controller services● Each Node is responsible for running one or more Pods● Pods are the unit of deployment in Kubernetes● Labels associate one Kubernetes object with the other ● Replication Controller ensures high availability of Pods● Services expose Pods to internal and external consumers

Page 18: Kubernetes architecture

Upcoming WebinarA Closer Look at Kubernetes Pods9 AM PST, 26th October

This session will discuss the best practices of creating, deploying, and managing Pods. We will take a closer look at the storage and networking architecture of containers running in the same Pod.

Register at kubernetes.live for the upcoming webinars

Page 19: Kubernetes architecture

Thank You!Send your Feedback / Questions / Comments [email protected]