Introduction to Kubernetes

Agenda

  • Project context

  • What is kubernetes ?

  • Architecture

  • Work units

  • Demo

Project context

Objenious, why to move Google Cloud Platform

 

Firsts components will be released in production in early january

I'll assume you already know the basics of Docker 

Before starting ...

What is kubernetes ?

 

  • A system for container management in a clustered environment (open sourced by Google)

 

  • Multiple container engines (Docker, rkt, OCI), mainly based on Docker.

 

  • Provides grouping, load balancing, scaling and scheduling features

 

    Current version v1.4,

    (1.5 planned by the end of the year)

Master components

  • API Server : The main management endpoint for the cluster (RESTful interface)

 

  • Controller Manager: Handles replication management

 

  • Scheduler Server : Assigns workloads to specific nodes

 

  • etcd : A distributed key-value store for sharing configuration

Node components

  • Docker : A Container system which runs on a dedicated network

 

  • Kubelet : Is responsible for the communication with the master server

 

  • Proxy : Used for network forwarding and load balancing

Work units

  • Pod:

A colocated group of containers (one-to-many) with shared resources. e.g. network, volumes.

It can be viewed as a "logical host".

 

Work units

 

  • Service:

An interface to a group of containers, which acts as load-balancer and provides an abstraction layer - no need to worry about containers location.

Work units

  • ReplicaSets :

Ensures that the number of desired pods "replicas" are running at any time.

 

  • Deployments :

Declarative way to describe the desired state of the application (pods, replica sets).

 

  • Many volumes  plugins:

Configmaps, Secrets, HostPath, AWS EBS ...

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx
  labels:
    k8s-app: nginx
    kubernetes.io/cluster-service: "true"
spec:
  replicas: 3
  selector:
    matchLabels:
      k8s-app: nginx
  template:
    metadata:
      labels:
        k8s-app: nginx
        kubernetes.io/cluster-service: "true"
    spec:
      containers:
      - name: nginx
        image: nginx
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 80

Workload example

kubectl create -f nginx-rc.yaml

Networking

 

  • The pods are scheduled on a flat shared network accross all nodes.

 

  • Each pod can communicate without proxies and translations (NAT) with other pods within the cluster.

 

  • Several implementations are available: L2 networks, Flannel, Weave, OpenVswitch, Calico

Links

Kubernetes documentation :

http://kubernetes.io/v1.1/index.html

 

kubespray repositories :

https://github.com/kubespray

 

Cloud Native Computing Paris meetup :

http://www.meetup.com/fr-FR/Cloud-Native-Computing-Paris/

 

Thank you

Introduction to Kubernetes

By Smaine Kahlouch

Introduction to Kubernetes

Install a kubernetes cluster and deploy new applications.

  • 1,811