Top Banner
Kubernetes on CloudStack with coreOS Sebastien Goasguen @sebgoa Nov 11 th 2014 London, England
27

Kubernetes on CloudStack with coreOS

Jun 19, 2015

Download

Technology

Intro to coreOS linux distributions and how it can be used to run docker based workloads in the cloud.
coreOS instances can be started in a cloudstack cloud, it makes use of cloud-init basics to
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Kubernetes on CloudStack with coreOS

Kubernetes on CloudStackwith coreOSSebastien Goasguen

@sebgoaNov 11th 2014

London, England

Page 2: Kubernetes on CloudStack with coreOS

Who am I ?• Apache CloudStack and

licloud committer + PMC member

• Looking at techs and how they work together

• Half dev, half community manager, + half event planner

Page 3: Kubernetes on CloudStack with coreOS

Today’s talk

Page 4: Kubernetes on CloudStack with coreOS

Cloud (e.g CloudStack based = exoscale)Cloud (e.g CloudStack based = exoscale)

coreOScoreOS coreOScoreOS coreOScoreOS

K*K* K*K* K*K*Docker containers

Docker containers

Docker containers

Docker containers

Docker containers

Docker containers

API calls to Kubernetes API

Ugly slide #1

Page 5: Kubernetes on CloudStack with coreOS

• Linux container (LXC +)• Application deployment• PaaS• Portability• Image sharing via

DockerHub• Ease of packaging

applications

Page 6: Kubernetes on CloudStack with coreOS

Building docker images

Fair use from http://blog.octo.com/en/docker-registry-first-steps/

Page 7: Kubernetes on CloudStack with coreOS

+ config mgmt

Page 8: Kubernetes on CloudStack with coreOS

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

Page 9: Kubernetes on CloudStack with coreOS

coreOS “OEM”

http://github.com/coreos/coreos-overlay

Page 10: Kubernetes on CloudStack with coreOS

coreOS “OEM”

http://github.com/coreos/coreos-overlay

Page 11: Kubernetes on CloudStack with coreOS

The cloudinit magic

Page 12: Kubernetes on CloudStack with coreOS

CoreOS clustering• etcd HA key value store– Raft election algorithm– Writes when majority in cluster has committed

update– e.g 5 nodes, tolerates 2 nodes failure

• fleet distributed init system (schedules systemd units in a cluster)– Submits systemd units cluster wide– Affinity, anti-affinity, global “scheduling”

Page 13: Kubernetes on CloudStack with coreOS

“coreOS is the first cloud OS dedicated to docker based application workloads”

Page 14: Kubernetes on CloudStack with coreOS

“Where are you going to run coreOS ?”

Page 15: Kubernetes on CloudStack with coreOS

IaaS Landscape

Page 16: Kubernetes on CloudStack with coreOS

CloudStack clouds

Page 17: Kubernetes on CloudStack with coreOS

Load BalancersLoad Balancers

FWs & VPNsFWs & VPNs

DashboardDashboard

Identity Mgmt.Identity Mgmt.

Image Mgmt.Image Mgmt.

ComputeCompute

StorageStorage

NetworkNetwork

MeteringMeteringAPI (EC2 & CS)API (EC2 & CS) Self-service PortalSelf-service Portal

Data Center Orchestrator

Page 18: Kubernetes on CloudStack with coreOS

• IaaS Public cloud• Switzerland based• Apache CloudStack• Security groups, ssh key

pairs• Offers coreOS

templates (+ Debian, ubuntu, CentOS and even Windows)

Page 19: Kubernetes on CloudStack with coreOS

CoreOS on exoscale

Page 20: Kubernetes on CloudStack with coreOS

Starting containers#cloud-config

coreos:

units:

- name: docker.service

command: start

- name: es.service

command: start

content: |

[Unit]

After=docker.service

Requires=docker.service

Description=starts ElasticSearch container

[Service]

TimeoutStartSec=0

ExecStartPre=/usr/bin/docker pull dockerfile/elasticsearch

ExecStart=/usr/bin/docker run -d -p 9200:9200 -p 9300:9300 dockerfile/elasticsearch

Page 21: Kubernetes on CloudStack with coreOS

Kubernetes• Docker application

orchestration• Google GCE, rackspace,

Azure providers• Deployable on CoreOS• Container replication• HA services

Page 22: Kubernetes on CloudStack with coreOS

Kubernetes API

Page 23: Kubernetes on CloudStack with coreOS

Kubernetes{

"id": "redis-master-2",

"kind": "Pod",

"apiVersion": "v1beta1",

"desiredState": {

"manifest": {

"version": "v1beta1",

"id": "redis-master-2",

"containers": [{

"name": "master",

"image": "dockerfile/redis",

"ports": [{

"containerPort": 6379,

"hostPort": 6379

"labels": {

"name": "redis-master"

}

}

Page 24: Kubernetes on CloudStack with coreOS

Kubernetes on CloudStack

• Find a CloudStack cloud that supports CoreOS• Then use:

https://github.com/runseb/kubernetes-exoscale

• Libcloud to start nodes with coreOS template• User data to pass cloud-configs• Then start Kube* Service units with fleet

Page 25: Kubernetes on CloudStack with coreOS

Cloud API Cloud API

Libcloud startup scripts

Etcd cluster5 nodes

Discovery service to bootstrap

Etcd cluster5 nodes

Discovery service to bootstrap

Kubernetes cluster5 nodes

Start Kube* services via fleetRun guestbook example

Kubernetes cluster5 nodes

Start Kube* services via fleetRun guestbook example

PR welcome:https://github.com/runseb/kubernetes-exoscale

Page 26: Kubernetes on CloudStack with coreOS

Cloud (e.g CloudStack based = exoscale)Cloud (e.g CloudStack based = exoscale)

coreOScoreOS coreOScoreOS coreOScoreOS

K*K* K*K* K*K*Docker container

Docker container

Docker container

Docker container

Docker container

Docker container

API calls to Kubernetes API

Page 27: Kubernetes on CloudStack with coreOS

Questions and Thanks

Sebastien Goasguen@sebgoa