SlideShare a Scribd company logo
Kubernetes on CloudStack 
with coreOS 
Sebastien Goasguen 
@sebgoa 
Nov 11th 2014 
London, England
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
Today’s 
talk
Ugly slide #1 
Docker 
containers 
Docker 
containers 
Docker 
containers 
KK** Docker KK** KK** 
containers 
Docker 
containers 
ccoorreeOOSS ccoorreeOOSS ccoorreeOOSS 
Cloud (e.g CloudStack Cloud (e.g CloudStack b baasseedd = = e exxoossccaalele)) 
Docker 
containers 
API calls to 
Kubernetes API
• Linux container (LXC +) 
• Application deployment 
• PaaS 
• Portability 
• Image sharing via 
DockerHub 
• Ease of packaging 
applications
Building docker images 
Fair use from http://blog.octo.com/en/docker-registry-first-steps/
+ config mgmt
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
coreOS “OEM” 
http://github.com/coreos/coreos-overlay
coreOS “OEM” 
http://github.com/coreos/coreos-overlay
The cloudinit magic
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”
“coreOS is the first cloud OS dedicated to 
docker based application workloads”
“Where are you going to run coreOS ?”
IaaS 
Landscape
CloudStack clouds
Data Center Orchestrator 
AAPPII ((EECC22 && CCSS)) SSeellff--sseerrvviiccee PPoorrttaall MMeetteerriinngg 
IImmaaggee MMggmmtt.. DDaasshhbbooaarrdd IIddeennttiittyy MMggmmtt.. 
LLooaadd BBaallaanncceerrss FFWWss && VVPPNNss 
SSttoorraaggee CCoommppuuttee NNeettwwoorrkk
• IaaS Public cloud 
• Switzerland based 
• Apache CloudStack 
• Security groups, ssh key 
pairs 
• Offers coreOS 
templates (+ Debian, 
ubuntu, CentOS and 
even Windows)
CoreOS on exoscale
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
Kubernetes 
• Docker application 
orchestration 
• Google GCE, rackspace, 
Azure providers 
• Deployable on CoreOS 
• Container replication 
• HA services
Kubernetes API
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" 
} 
}
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
CClolouudd A APPI I 
Libcloud startup 
scripts 
Etcd cluster 
5 nodes 
Etcd cluster 
5 nodes 
Discovery service to 
Discovery service to 
bootstrap 
bootstrap 
PR welcome: 
https://github.com/runseb/kubernetes-Kubernetes cluster 
Kubernetes cluster 
5 nodes 
5 nodes 
Start Kube* services via fleet 
Run guestbook example 
Start Kube* services via fleet 
Run guestbook example
Docker 
container 
Docker 
container 
Docker 
container 
KK** Docker KK** KK** 
container 
Docker 
container 
ccoorreeOOSS ccoorreeOOSS ccoorreeOOSS 
Cloud (e.g CloudStack Cloud (e.g CloudStack b baasseedd = = e exxoossccaalele)) 
Docker 
container 
API calls to 
Kubernetes API
Questions and Thanks 
Sebastien Goasguen 
@sebgoa

More Related Content

Kubernetes on CloudStack with coreOS

  • 1. Kubernetes on CloudStack with coreOS Sebastien Goasguen @sebgoa Nov 11th 2014 London, England
  • 2. 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
  • 4. Ugly slide #1 Docker containers Docker containers Docker containers KK** Docker KK** KK** containers Docker containers ccoorreeOOSS ccoorreeOOSS ccoorreeOOSS Cloud (e.g CloudStack Cloud (e.g CloudStack b baasseedd = = e exxoossccaalele)) Docker containers API calls to Kubernetes API
  • 5. • Linux container (LXC +) • Application deployment • PaaS • Portability • Image sharing via DockerHub • Ease of packaging applications
  • 6. Building docker images Fair use from http://blog.octo.com/en/docker-registry-first-steps/
  • 8. 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
  • 12. 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”
  • 13. “coreOS is the first cloud OS dedicated to docker based application workloads”
  • 14. “Where are you going to run coreOS ?”
  • 17. Data Center Orchestrator AAPPII ((EECC22 && CCSS)) SSeellff--sseerrvviiccee PPoorrttaall MMeetteerriinngg IImmaaggee MMggmmtt.. DDaasshhbbooaarrdd IIddeennttiittyy MMggmmtt.. LLooaadd BBaallaanncceerrss FFWWss && VVPPNNss SSttoorraaggee CCoommppuuttee NNeettwwoorrkk
  • 18. • IaaS Public cloud • Switzerland based • Apache CloudStack • Security groups, ssh key pairs • Offers coreOS templates (+ Debian, ubuntu, CentOS and even Windows)
  • 20. 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
  • 21. Kubernetes • Docker application orchestration • Google GCE, rackspace, Azure providers • Deployable on CoreOS • Container replication • HA services
  • 23. 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" } }
  • 24. 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
  • 25. CClolouudd A APPI I Libcloud startup scripts Etcd cluster 5 nodes Etcd cluster 5 nodes Discovery service to Discovery service to bootstrap bootstrap PR welcome: https://github.com/runseb/kubernetes-Kubernetes cluster Kubernetes cluster 5 nodes 5 nodes Start Kube* services via fleet Run guestbook example Start Kube* services via fleet Run guestbook example
  • 26. Docker container Docker container Docker container KK** Docker KK** KK** container Docker container ccoorreeOOSS ccoorreeOOSS ccoorreeOOSS Cloud (e.g CloudStack Cloud (e.g CloudStack b baasseedd = = e exxoossccaalele)) Docker container API calls to Kubernetes API
  • 27. Questions and Thanks Sebastien Goasguen @sebgoa