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

定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一Fs
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作ys8omjxb
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Excelmac1
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一Fs
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa494f574xmv
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一Fs
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxDyna Gilbert
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Lucknow
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Paul Calvano
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITMgdsc13
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)Christopher H Felton
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一Fs
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMartaLoveguard
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书zdzoqco
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Dana Luther
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012rehmti665
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一z xss
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Sonam Pathan
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝soniya singh
 

Recently uploaded (20)

定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
定制(UAL学位证)英国伦敦艺术大学毕业证成绩单原版一比一
 
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
Potsdam FH学位证,波茨坦应用技术大学毕业证书1:1制作
 
Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...Blepharitis inflammation of eyelid symptoms cause everything included along w...
Blepharitis inflammation of eyelid symptoms cause everything included along w...
 
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
定制(AUT毕业证书)新西兰奥克兰理工大学毕业证成绩单原版一比一
 
Film cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasaFilm cover research (1).pptxsdasdasdasdasdasa
Film cover research (1).pptxsdasdasdasdasdasa
 
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
定制(Management毕业证书)新加坡管理大学毕业证成绩单原版一比一
 
Top 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptxTop 10 Interactive Website Design Trends in 2024.pptx
Top 10 Interactive Website Design Trends in 2024.pptx
 
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja VipCall Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
Call Girls Service Adil Nagar 7001305949 Need escorts Service Pooja Vip
 
Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24Font Performance - NYC WebPerf Meetup April '24
Font Performance - NYC WebPerf Meetup April '24
 
Git and Github workshop GDSC MLRITM
Git and Github  workshop GDSC MLRITMGit and Github  workshop GDSC MLRITM
Git and Github workshop GDSC MLRITM
 
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
A Good Girl's Guide to Murder (A Good Girl's Guide to Murder, #1)
 
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
定制(Lincoln毕业证书)新西兰林肯大学毕业证成绩单原版一比一
 
Magic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptxMagic exist by Marta Loveguard - presentation.pptx
Magic exist by Marta Loveguard - presentation.pptx
 
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in  Rk Puram 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Rk Puram 🔝 9953056974 🔝 Delhi escort Service
 
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
办理多伦多大学毕业证成绩单|购买加拿大UTSG文凭证书
 
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
Packaging the Monolith - PHP Tek 2024 (Breaking it down one bite at a time)
 
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
Call Girls South Delhi Delhi reach out to us at ☎ 9711199012
 
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
办理(UofR毕业证书)罗切斯特大学毕业证成绩单原版一比一
 
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
Call Girls In The Ocean Pearl Retreat Hotel New Delhi 9873777170
 
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Uttam Nagar Delhi 💯Call Us 🔝8264348440🔝
 

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