SlideShare a Scribd company logo
1 of 22
Download to read offline
HOW TO RIDE A WHALE
Creating a functionnal CoreOS cluster
THE SERVICE
Based on systemd
Unit or template files with basic variables
A MONGODB DATABASE
units template : mongodb@.service
[Unit]
Description=MongoDB
After=docker.service
[Service]
ExecStartPre=/usr/bin/docker pull mongo:latest
ExecStartPre=-/usr/bin/docker rm -f -v %p.%i
ExecStart=/usr/bin/docker run --rm --name %p.%i -p 27017:27017 
--volume=/home/data/mongo/latest:/data/db
--cpu-shares=4 -m="30g"
mongo:latest
ExecStartPost=/bin/etcdctl set /skydns/fr/mycloud/%p/%i '{"host":"%H", "port"
ExecStartPost=/bin/etcdctl set /databases/%p/%i '{"host":"%H", "port":27017
ExecStop=/bin/etcdctl rm /skydns/fr/mycloud/%p/%i
ExecStop=/bin/etcdctl rm /databases/%p.%i
ExecStop=-/usr/bin/docker stop %p.%i
Restart=always
FLEET
Remote control
Basic scheduler
Make services survive to machine crash
Simple command line
fleetctl submit mongodb@.service
fleetctl start mongodb@x1
fleetctl start mongodb@x2
fleetctl start mongodb@x3
fleetctl list-units
fleetctl journal -f mongodb@x1
coreos:
fleet:
public-ip: $public_ipv4
metadata: disk=ssd,hoster=ovh,location=FR
ETCD
Cluster registry
Raft consensus implementation
Use etcd2
http://thesecretlivesofdata.com/raft/
Access anywhere
# Use it via command line
> etcdctl set /skydns/fr/mycloud/mongodb/x1 {"host":"core-1", "port":27017
# Or HTTP
> curl -L http://127.0.0.1:4001/v2/keys/skydns/fr/mycloud/mongodb/x1
{"host":"core-1", "port":27017}
coreos:
etcd:
# generate a new token for each unique cluster from https://discovery.etcd.io
discovery: https://discovery.etcd.io/{token}
addr: $public_ipv4:4001
peer-addr: $public_ipv4:7001
Or etcd-browser for human beings
SKYDNS
Nameserver (@95%)
Store and read data from etcd (or consul)
Simplest DNS to administrate ever
dig *.mongodb.mycloud.fr SRV @localhost
[Unit]
Description=SkyDNS
After=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm -f skydns
ExecStart=/usr/bin/docker run --rm --name skydns 
-e ETCD_MACHINES=http://127.0.0.1:4001 
-e SKYDNS_ADDR=0.0.0.0:53 
-e SKYDNS_DOMAIN=mycloud.fr 
-e SKYDNS_NAMESERVERS=8.8.8.8:53,8.8.4.4:53 
--net=host 
skynetservices/skydns:latest
ExecStop=-/usr/bin/docker stop skydns
Restart=always
CONFD
Read etcd and write config files
Basic go template
check, and reload services
[mongodb]
port = 27017{{ range gets "/databases/mongodb/*"}}{{ $server := json .Value
servers[] = {{ $server.host }}{{end}}
[Unit]
Description=Confd
Wants=etcd.service
[Service]
ExecStartPre=-/usr/bin/mkdir -p /opt/bin
ExecStartPre=-/usr/bin/wget -N -P /opt/bin https://github.com/kelseyhightower
ExecStartPre=-/bin/rm /opt/bin/confd
ExecStartPre=-/bin/mv /opt/bin/confd-0.9.0-linux-amd64 /opt/bin/confd
ExecStartPre=-/bin/chmod +x /opt/bin/confd
ExecStart=/opt/bin/confd -backend etcd -node 127.0.0.1:4001 -interval=10
ExecStop=-/bin/kill $(pidof confd)
Restart=always
HAPROXY
TCP proxy, load balancing, health check
and mitigation since 1996
http://mycloud.fr:1000
etcdctl set /services/mywordpress.fr/scheme http
etcdctl set /services/mywordpress.fr/hosts/1 1.2.3.4:80
etcdctl set /services/mywordpress.fr/hosts/1 1.2.3.5:80
[Unit]
Description=HA proxy load balancer
After=docker.service
[Service]
ExecStartPre=-/usr/bin/docker rm -f balancer
ExecStart=/usr/bin/docker run --rm --name haproxy 
-e ETCD_NODE=127.0.0.1:4001
--volume /etc/certs:/etc/certs/ 
--net host 
cstpdk/haproxy-confd
ExecReload=/usr/bin/docker exec balancer service haproxy reload
ExecStop=/usr/bin/docker stop balancer
Restart=always
SYNCTHING
Torrent based private cloud
Neat web interface
[Unit]
Description=Syncthing
[Service]
ExecStartPre=-/usr/bin/docker rm -f -v syncthing
ExecStartPre=-/usr/bin/docker pull istepanov/syncthing:latest
ExecStart=/usr/bin/docker run --rm --name syncthing 
-p 9080:8080 -p 22000:22000 -p 21025:21025/udp 
-v /etc/syncthing:/home/syncthing/.config/syncthing 
-v /home/data/sync:/home/syncthing/Sync 
istepanov/syncthing
ExecStop=-/usr/bin/docker stop syncthing
Restart=always
DATADOG
plug everything in easily
StatsD Graphite on vitamins
Monitoring and Alerting
Or cadvisor+heapster+fluentd or prometheus
[Unit]
Description=Datadog monitoring
[Service]
ExecStartPre=-/usr/bin/docker rm -f datadog
ExecStartPre=-/usr/bin/docker pull datadog/docker-dd-agent
ExecStart=/usr/bin/docker run --rm --name datadog 
-v /etc/datadog/conf.d:/etc/dd-agent/conf.d 
-v /var/run/docker.sock:/var/run/docker.sock 
-v /proc/mounts:/host/proc/mounts:ro 
-v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro 
-e API_KEY=GET-IT-ON-DATADOG 
--net=host 
datadog/docker-dd-agent
ExecStop=-/usr/bin/docker stop datadog
Restart=always
CLOUD INIT
BareMetal (ovh, online)
Virtual machines (Ganeti, Openstack)
Cloud providers (AWS, DO, GC ...)
#cloud-config
coreos:
update:
reboot-strategy: best-effort
group: stable
fleet:
public-ip: $public_ipv4
units:
- name: haproxy.service
command: start
content: |
[Unit]
....
write_files:
-
path: /etc/resolv.conf
owner: root:root
content: |
QUESTIONS ?
git clone https://github.com/Vinceveve/achab
cd achab
vagrant up
https://coreos.com/blog/managing-coreos-with-ansible/
http://www.freedesktop.org/software/systemd/man/systemd.service.html
https://github.com/kelseyhightower/confd/blob/master/docs/templates.md
http://cbonte.github.io/haproxy-dconv/configuration-1.5.html
https://www.digitalocean.com/community/tutorials/how-to-set-up-a-coreos-cluster-on-
digitalocean

More Related Content

What's hot

ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale Subbu Allamaraju
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUNCong Zhang
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-apiEric Ahn
 
OpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvmOpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvmJooho Lee
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on HerokuNaoyuki Kakuda
 
Quay 3.3 installation
Quay 3.3 installationQuay 3.3 installation
Quay 3.3 installationJooho Lee
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabricandymccurdy
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Walter Heck
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...Willian Molinari
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X ServerYasuhiro Asaka
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for BeginnersArie Bregman
 
Scaling FastAGI Applications with Go
Scaling FastAGI Applications with GoScaling FastAGI Applications with Go
Scaling FastAGI Applications with GoDigium
 
Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersJosh Braegger
 
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk pptShahroz Khan
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbSmartTools
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talkLocaweb
 

What's hot (20)

ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale ql.io: Consuming HTTP at Scale
ql.io: Consuming HTTP at Scale
 
Nginx-lua
Nginx-luaNginx-lua
Nginx-lua
 
Using ngx_lua in UPYUN
Using ngx_lua in UPYUNUsing ngx_lua in UPYUN
Using ngx_lua in UPYUN
 
Docker remote-api
Docker remote-apiDocker remote-api
Docker remote-api
 
Comets notes
Comets notesComets notes
Comets notes
 
OpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvmOpenShift4 Installation by UPI on kvm
OpenShift4 Installation by UPI on kvm
 
Clojure + MongoDB on Heroku
Clojure + MongoDB on HerokuClojure + MongoDB on Heroku
Clojure + MongoDB on Heroku
 
Quay 3.3 installation
Quay 3.3 installationQuay 3.3 installation
Quay 3.3 installation
 
DevOps with Fabric
DevOps with FabricDevOps with Fabric
DevOps with Fabric
 
Deployment with Fabric
Deployment with FabricDeployment with Fabric
Deployment with Fabric
 
Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012Puppet User Group Presentation - 15 March 2012
Puppet User Group Presentation - 15 March 2012
 
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
How we used ruby to build locaweb's cloud (http://presentations.pothix.com/ru...
 
EC2
EC2EC2
EC2
 
Gitosis on Mac OS X Server
Gitosis on Mac OS X ServerGitosis on Mac OS X Server
Gitosis on Mac OS X Server
 
Ansible for Beginners
Ansible for BeginnersAnsible for Beginners
Ansible for Beginners
 
Scaling FastAGI Applications with Go
Scaling FastAGI Applications with GoScaling FastAGI Applications with Go
Scaling FastAGI Applications with Go
 
Docker & CoreOS at Utah Gophers
Docker & CoreOS at Utah GophersDocker & CoreOS at Utah Gophers
Docker & CoreOS at Utah Gophers
 
Coroutines talk ppt
Coroutines talk pptCoroutines talk ppt
Coroutines talk ppt
 
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonbСтажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
Стажировка 2016-07-27 02 Денис Нелюбин. PostgreSQL и jsonb
 
Lua tech talk
Lua tech talkLua tech talk
Lua tech talk
 

Similar to How to ride a whale

MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on DockerDaniel Ku
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopLorin Hochstein
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHPfwso
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endEzequiel Maraschio
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slidesharetomcopeland
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...Dexter Horthy
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtTimo Derstappen
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REXSaewoong Lee
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングYuji ODA
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...Puppet
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configurationlutter
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdRichard Lister
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes Zhichao Liang
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Cosimo Streppone
 

Similar to How to ride a whale (20)

MeaNstack on Docker
MeaNstack on DockerMeaNstack on Docker
MeaNstack on Docker
 
Vagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptopVagrant, Ansible, and OpenStack on your laptop
Vagrant, Ansible, and OpenStack on your laptop
 
Introduction to MongoDB with PHP
Introduction to MongoDB with PHPIntroduction to MongoDB with PHP
Introduction to MongoDB with PHP
 
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp KrennJavantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
Javantura v2 - Replication with MongoDB - what could go wrong... - Philipp Krenn
 
Centos config
Centos configCentos config
Centos config
 
Fullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-endFullstack conf 2017 - Basic dev pipeline end-to-end
Fullstack conf 2017 - Basic dev pipeline end-to-end
 
Dev ops
Dev opsDev ops
Dev ops
 
Railsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshareRailsconf2011 deployment tips_for_slideshare
Railsconf2011 deployment tips_for_slideshare
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
 
Ansible : what's ansible & use case by REX
Ansible :  what's ansible & use case by REXAnsible :  what's ansible & use case by REX
Ansible : what's ansible & use case by REX
 
CoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリングCoreOSによるDockerコンテナのクラスタリング
CoreOSによるDockerコンテナのクラスタリング
 
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
PuppetConf 2016: The Challenges with Container Configuration – David Lutterko...
 
Challenges of container configuration
Challenges of container configurationChallenges of container configuration
Challenges of container configuration
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
CoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love SystemdCoreOS, or How I Learned to Stop Worrying and Love Systemd
CoreOS, or How I Learned to Stop Worrying and Love Systemd
 
青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes 青云CoreOS虚拟机部署kubernetes
青云CoreOS虚拟机部署kubernetes
 
Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013Puppet at Opera Sofware - PuppetCamp Oslo 2013
Puppet at Opera Sofware - PuppetCamp Oslo 2013
 
Phd3
Phd3Phd3
Phd3
 

Recently uploaded

Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...tanu pandey
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdfMatthew Sinclair
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...nirzagarg
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋nirzagarg
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445ruhi
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdfMatthew Sinclair
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdfMatthew Sinclair
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"growthgrids
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...tanu pandey
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceDelhi Call girls
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...SUHANI PANDEY
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrHenryBriggs2
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Bookingdharasingh5698
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)Delhi Call girls
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...SUHANI PANDEY
 

Recently uploaded (20)

Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf20240508 QFM014 Elixir Reading List April 2024.pdf
20240508 QFM014 Elixir Reading List April 2024.pdf
 
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men  🔝mehsana🔝   Escorts...
➥🔝 7737669865 🔝▻ mehsana Call-girls in Women Seeking Men 🔝mehsana🔝 Escorts...
 
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
💚😋 Bilaspur Escort Service Call Girls, 9352852248 ₹5000 To 25K With AC💚😋
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
20240507 QFM013 Machine Intelligence Reading List April 2024.pdf
 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
 
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Pollachi 7001035870 Whatsapp Number, 24/07 Booking
 
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency""Boost Your Digital Presence: Partner with a Leading SEO Agency"
"Boost Your Digital Presence: Partner with a Leading SEO Agency"
 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
Pirangut | Call Girls Pune Phone No 8005736733 Elite Escort Service Available...
 
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
📱Dehradun Call Girls Service 📱☎️ +91'905,3900,678 ☎️📱 Call Girls In Dehradun 📱
 
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrStory Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
Story Board.pptxrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
 
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
(INDIRA) Call Girl Pune Call Now 8250077686 Pune Escorts 24x7
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
WhatsApp 📞 8448380779 ✅Call Girls In Mamura Sector 66 ( Noida)
 
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
Sarola * Female Escorts Service in Pune | 8005736733 Independent Escorts & Da...
 

How to ride a whale

  • 1. HOW TO RIDE A WHALE Creating a functionnal CoreOS cluster
  • 2. THE SERVICE Based on systemd Unit or template files with basic variables
  • 3. A MONGODB DATABASE units template : mongodb@.service [Unit] Description=MongoDB After=docker.service [Service] ExecStartPre=/usr/bin/docker pull mongo:latest ExecStartPre=-/usr/bin/docker rm -f -v %p.%i ExecStart=/usr/bin/docker run --rm --name %p.%i -p 27017:27017 --volume=/home/data/mongo/latest:/data/db --cpu-shares=4 -m="30g" mongo:latest ExecStartPost=/bin/etcdctl set /skydns/fr/mycloud/%p/%i '{"host":"%H", "port" ExecStartPost=/bin/etcdctl set /databases/%p/%i '{"host":"%H", "port":27017 ExecStop=/bin/etcdctl rm /skydns/fr/mycloud/%p/%i ExecStop=/bin/etcdctl rm /databases/%p.%i ExecStop=-/usr/bin/docker stop %p.%i Restart=always
  • 4. FLEET Remote control Basic scheduler Make services survive to machine crash
  • 5. Simple command line fleetctl submit mongodb@.service fleetctl start mongodb@x1 fleetctl start mongodb@x2 fleetctl start mongodb@x3 fleetctl list-units fleetctl journal -f mongodb@x1 coreos: fleet: public-ip: $public_ipv4 metadata: disk=ssd,hoster=ovh,location=FR
  • 6. ETCD Cluster registry Raft consensus implementation Use etcd2 http://thesecretlivesofdata.com/raft/
  • 7. Access anywhere # Use it via command line > etcdctl set /skydns/fr/mycloud/mongodb/x1 {"host":"core-1", "port":27017 # Or HTTP > curl -L http://127.0.0.1:4001/v2/keys/skydns/fr/mycloud/mongodb/x1 {"host":"core-1", "port":27017} coreos: etcd: # generate a new token for each unique cluster from https://discovery.etcd.io discovery: https://discovery.etcd.io/{token} addr: $public_ipv4:4001 peer-addr: $public_ipv4:7001 Or etcd-browser for human beings
  • 8.
  • 9. SKYDNS Nameserver (@95%) Store and read data from etcd (or consul) Simplest DNS to administrate ever
  • 10. dig *.mongodb.mycloud.fr SRV @localhost [Unit] Description=SkyDNS After=docker.service [Service] ExecStartPre=-/usr/bin/docker rm -f skydns ExecStart=/usr/bin/docker run --rm --name skydns -e ETCD_MACHINES=http://127.0.0.1:4001 -e SKYDNS_ADDR=0.0.0.0:53 -e SKYDNS_DOMAIN=mycloud.fr -e SKYDNS_NAMESERVERS=8.8.8.8:53,8.8.4.4:53 --net=host skynetservices/skydns:latest ExecStop=-/usr/bin/docker stop skydns Restart=always
  • 11. CONFD Read etcd and write config files Basic go template check, and reload services
  • 12. [mongodb] port = 27017{{ range gets "/databases/mongodb/*"}}{{ $server := json .Value servers[] = {{ $server.host }}{{end}} [Unit] Description=Confd Wants=etcd.service [Service] ExecStartPre=-/usr/bin/mkdir -p /opt/bin ExecStartPre=-/usr/bin/wget -N -P /opt/bin https://github.com/kelseyhightower ExecStartPre=-/bin/rm /opt/bin/confd ExecStartPre=-/bin/mv /opt/bin/confd-0.9.0-linux-amd64 /opt/bin/confd ExecStartPre=-/bin/chmod +x /opt/bin/confd ExecStart=/opt/bin/confd -backend etcd -node 127.0.0.1:4001 -interval=10 ExecStop=-/bin/kill $(pidof confd) Restart=always
  • 13. HAPROXY TCP proxy, load balancing, health check and mitigation since 1996
  • 14.
  • 15. http://mycloud.fr:1000 etcdctl set /services/mywordpress.fr/scheme http etcdctl set /services/mywordpress.fr/hosts/1 1.2.3.4:80 etcdctl set /services/mywordpress.fr/hosts/1 1.2.3.5:80 [Unit] Description=HA proxy load balancer After=docker.service [Service] ExecStartPre=-/usr/bin/docker rm -f balancer ExecStart=/usr/bin/docker run --rm --name haproxy -e ETCD_NODE=127.0.0.1:4001 --volume /etc/certs:/etc/certs/ --net host cstpdk/haproxy-confd ExecReload=/usr/bin/docker exec balancer service haproxy reload ExecStop=/usr/bin/docker stop balancer Restart=always
  • 16. SYNCTHING Torrent based private cloud Neat web interface
  • 17. [Unit] Description=Syncthing [Service] ExecStartPre=-/usr/bin/docker rm -f -v syncthing ExecStartPre=-/usr/bin/docker pull istepanov/syncthing:latest ExecStart=/usr/bin/docker run --rm --name syncthing -p 9080:8080 -p 22000:22000 -p 21025:21025/udp -v /etc/syncthing:/home/syncthing/.config/syncthing -v /home/data/sync:/home/syncthing/Sync istepanov/syncthing ExecStop=-/usr/bin/docker stop syncthing Restart=always
  • 18. DATADOG plug everything in easily StatsD Graphite on vitamins Monitoring and Alerting Or cadvisor+heapster+fluentd or prometheus
  • 19. [Unit] Description=Datadog monitoring [Service] ExecStartPre=-/usr/bin/docker rm -f datadog ExecStartPre=-/usr/bin/docker pull datadog/docker-dd-agent ExecStart=/usr/bin/docker run --rm --name datadog -v /etc/datadog/conf.d:/etc/dd-agent/conf.d -v /var/run/docker.sock:/var/run/docker.sock -v /proc/mounts:/host/proc/mounts:ro -v /sys/fs/cgroup/:/host/sys/fs/cgroup:ro -e API_KEY=GET-IT-ON-DATADOG --net=host datadog/docker-dd-agent ExecStop=-/usr/bin/docker stop datadog Restart=always
  • 20. CLOUD INIT BareMetal (ovh, online) Virtual machines (Ganeti, Openstack) Cloud providers (AWS, DO, GC ...)
  • 21. #cloud-config coreos: update: reboot-strategy: best-effort group: stable fleet: public-ip: $public_ipv4 units: - name: haproxy.service command: start content: | [Unit] .... write_files: - path: /etc/resolv.conf owner: root:root content: |
  • 22. QUESTIONS ? git clone https://github.com/Vinceveve/achab cd achab vagrant up https://coreos.com/blog/managing-coreos-with-ansible/ http://www.freedesktop.org/software/systemd/man/systemd.service.html https://github.com/kelseyhightower/confd/blob/master/docs/templates.md http://cbonte.github.io/haproxy-dconv/configuration-1.5.html https://www.digitalocean.com/community/tutorials/how-to-set-up-a-coreos-cluster-on- digitalocean