SlideShare a Scribd company logo
{CoreOS in anger
Shaun Domingo - @sdomsta
Head of Tech and Operations @ Ninefold
The inevitable recap
Why CoreOS?
Built-in clustering
Few binaries
No packaging system
Dependent on containers for managing software and apps
Light weight, fat-free
Automatic updates
 A single, distributed init system
 Encourages small, ephemeral units / services
 Schedules units into the cluster based on declared
conflicts in systemd unit files
 Fault tolerant
 Can be managed locally or remotely by fleetctl
CoreOS building blocks
systemd
fleet
etcd
Orchestration
DIY
Kubernetes (Google)
Mesos + Marathon
(Apache)
CoreOS arsenal
etcd
fleet
flannel
docker
rocket
+---------------+ +----------------+ +----------------+
| | | | | |
| core-01 | <> | core-02 | <> | core-03 |
| | etcd | | etcd | |
+---------------+ +----------------+ +----------------+
Exercise 1:
Boot up a 3 machine coreos
cluster
 Download & install Vagrant:
 http://www.vagrantup.com/downloads.html
 Download & install Virtualbox:
 https://www.virtualbox.org/wiki/Downloads
1a: install VirtualBox
 mkdir ~/coreos; cd ~/coreos
 git clone https://github.com/coreos/coreos-
vagrant.git
1b: Clone the coreos-
vagrant repo
cd coreos-vagrant
cp config.rb.sample config.rb
vim config.rb
 change $num_instances:
$num_instances=3
 change $update_channel:
$update_channel=‘beta’
 Change $forwarded_ports:
$forwarded_ports = {8000 => 8888}
1c: modify your config.rb
We’ll use this later
You’ll get 3 CoreOS
VMs
‘alpha’ if you like
bleeding edge,
‘stable’ if you
want to stay sane.
 Visit https://discovery.etcd.io/new?size=3
 (you’ll need a new one every time you destroy a
cluster)
 Copy the entire URL provided in the body of
the response
1d: get yourself a
discovery token
4c4,6
< etcd:
---
> update:
> reboot-strategy: etcd-lock
> # etcd:
8,9c10,11
< addr: $public_ipv4:4001
< peer-addr: $public_ipv4:7001
---
> #addr: $public_ipv4:4001
> #peer-addr: $public_ipv4:7001
12c14
< #discovery: https://discovery.etcd.io/<token>
---
> discovery: https://discovery.etcd.io/YOUR_DISCOVERY_TOKEN_HERE
25,26c27,28
< - name: etcd.service
< command: start
---
> #- name: etcd.service
> # command: start
29,30c31,32
< #- name: etcd2.service
< # command: start
---
> - name: etcd2.service
> command: start
1e: modify your user-data
and turn on etcd2
Reboot after first taking a
lock in etcd
Disable etcd (version 1)
Enable etcd2.service,
disable etcd.service
Add your copied
discovery token here
 The $private_ipv4 and $public_ipv4 substitutio
n variables are fully supported in cloud-config
on Vagrant. They will map to the first statically
defined private and public networks defined in
the Vagrantfile.
A note on $private_ipv4
and $public_ipv4
substitution variables
Examine the vagrant file
vagrant up
vagrant status
1f: magic
ACHIEVEMENT UNLOCKED!
Exercise 2: Get talking to
your cluster
 https://github.com/coreos/fleet/releases
 Unzip, add the binary to your path (.bashrc /
.bash_profile / .zshrc)
PATH=$PATH:/path/to/fleetctl
 Restart your terminal
2a: Download fleetctl
cd /path/to/coreos-vagrant
eval $(ssh-agent)
# Add the correct vagrant .ssh identity
vagrant ssh-config | sed -n "s/IdentityFile//gp" |
uniq | xargs ssh-add
2b: start your engines
Ensure
ssh-agent
is running
NOTE: You’ll need to rerun these steps each time you blow away your vagrant CoreOS
cluster.
export
FLEETCTL_TUNNEL="127.0.0.1:$(vagrant ssh-
config | grep -i 'port' | awk '{print $2; exit}')"
# remove your fleet known hosts
rm ~/.fleetctl/known_hosts
2c: Prepare for takeoff
NOTE: You’ll need to rerun these steps each time you blow away your vagrant CoreOS
cluster.
fleetctl list-machines
2d: go go go
Need to tweak?
Do it all in the comfort of 127.0.0.1.
Exercise 3: Web Scale
 Containers, microservices => stateless
 Containers => spin them up quick
 Load balancing => how does it work?
Considerations at scale
 When we start a unit, auto-add it to the web
cluster
 When we destroy a unit, auto-remove it from
the web cluster
 When a container is flakey, don’t use it
 Spin up lots of my units without a hassle
Desired
+----------------------------+
| |
| Web server / RP |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| App server |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| Database |
| |
+----------------------------+
Standard 3-tier architecture
+----------------------------+
| |
| Web server / RP |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| App server |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| Database |
| |
+----------------------------+
… just won’t work here.
Needs to scale,
be fault
tolerant, have
speed and be
nearby.
+----------------------------+
| |
| Web server / RP |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| App server |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| Database |
| |
+----------------------------+
… just won’t work here.
Needs to be
stateless, needs
to focus on
dynamic
workloads.
+----------------------------+
| |
| Web server / RP |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| App server |
| |
+-------------+--------------+
|
+-------------+--------------+
| |
| Database |
| |
+----------------------------+
… just won’t work here.
Needs to
handle caching,
should really be
a CDN, should
be great at
delivering
static content.
 CDN is a must – S3 for asset sync
 Cache as much as you can – varnish,
CloudFront
 Load balancing
 Web server as a RP
 App server / runtime
 Database as a service
 Key/value store – e.g. redis, cache as much as
you can
To achieve true web scale
 Tonight’s example:
Wordpress at (localhost) scale
A traditional app, not written with containers and
true scale in mind. Yet it is still incredibly popular
as a blogging and web platform worldwide.
Localhost scale
+---------80----------+ +------------+
| | | CDN |<-+
| Load Balancer | +------------+ |
| | |
+--------8888---------+ |
/ |  |
/ |  |
+-------8888---------+ +--------8888---------+ +-------8888---------+ |
| | | | | | |
| VM1 | | VM2 | | VM3 | |
| | | | | | |
+--------------------+ +---------------------+ +--------------------+ |
| | | | | | |
| Workload balancer | | Workload balancer | | Workload balancer | |
| | | | | | |
+---+---+---+---+---++ +---+---+---+---+---+-+ +--+---+----+---+----+ |
| | | | | | | | | | | | | | | |
+---+---+---+-+-+---+ +--+---+---+---+---+ +-+---+----+---+---+-+ |
| wp| wp| wp| wp| wp| |wp| wp| wp| wp| wp| | wp | wp| wp| wp| wp| ---+
+-------------------+ +------------------+ +--------------------+
Exercise 3 goal
+---------80----------+
| |
| Load Balancer |
| |
+--------8888---------+
/ | 
/ | 
+-------8888---------+ +--------8888--------+ +-------8888---------+
| | | | | |
| core-01 | | core-02 | | core-03 |
| | | | | |
+--------------------+ +--------------------+ +--------------------+
| vulcand | | vulcand | | vulcand |
+--------------------+ +--------------------+ +--------------------+
| discovery sidekick | | discovery sidekick | | discovery sidekick |
+--------------------+---+--------------------+--+--------------------+
| wp wp wp wp wp wpn | | wp wp wp wp wp wpn | | wp wp wp wp wp wpn |
+--------------------+ +--------------------+ +--------------------+
How we’ll solve it
Imagine everything above
the line is solvable with
haproxy … it is.
fleetunits
As wp units are
started, discovery
notifies vulcand
by writing to etcd
mkdir ~/coreos; cd ~/coreos
git clone git@github.com:shaundomingo/coreos-
units.git
3a: Clone my repo
Modify the following files to add details of your database
server and S3 bucket and AWS keys:
coreos-units/clusterable-
wordpress/wordpress/wordpress@.service
and
coreos-units/clusterable-wordpress/wordpress/wordpress-
admin.service
3b: Add config
Either follow clusterable-wordpress/README.md for
instructions on how to run, or if you’re like me and like to
cheat:
cd coreos-units/clusterable-wordpress
./wordpress-up.sh
There’ll be some errors/warnings … that’s normal.
3c: Run *.*
3d: Observe your mighty
cluster firing up
fleetctl journal -f discovery@1.service
Watch as it finds wordpress containers and adds locations
into etcd for vulcan.
3e: Check out some logs
3f: Play with your
wordpress site
Go to this URL in your browser:
http://wordpress.local:8888
 Our docker units really scale … even if your
local machine doesn’t
Scale
Success
Demo: vulcand
 Built a CoreOS cluster in the complete privacy
of our own laptops… well except for docker, and github, and, OH …
 Brought to life the complexities of container
management and scale
 Made you a CoreOS genius in a few minutes
What have we done?
There was a bit of work to
get this going
 Unit file automation
 Vulcanproxy persistence
 Monitoring
 Autoscale
 Appc
Where to next?
 Let’s talk – you have software, we have … a
great virtualisation layer.
 Steak knives come free
Are you looking to deploy
containers to prod?
 @sdomsta
 @ninefold
Follow me, make
me famous
Deploy on Ninefold,
we’ll look after you.
Servers from $7 month.

More Related Content

What's hot

Open vpn server_linux
Open vpn server_linuxOpen vpn server_linux
Open vpn server_linux
Tola LENG
 
Network Manual
Network ManualNetwork Manual
Network Manual
Jason Myers
 
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Redis Labs
 
Ad, dns, dhcp, file server
Ad, dns, dhcp, file serverAd, dns, dhcp, file server
Ad, dns, dhcp, file server
Tola LENG
 
Replacing Squid with ATS
Replacing Squid with ATSReplacing Squid with ATS
Replacing Squid with ATS
Kit Chan
 
Basic security &amp; info
Basic security &amp; infoBasic security &amp; info
Basic security &amp; info
Tola LENG
 
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola LENG
 
Failsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo HomepageFailsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo Homepage
Kit Chan
 
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Codemotion
 
System Engineer: OpenLDAP and Samba Server
System Engineer: OpenLDAP and Samba ServerSystem Engineer: OpenLDAP and Samba Server
System Engineer: OpenLDAP and Samba Server
Tola LENG
 
DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)
Tola LENG
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
Laurent Bernaille
 
Introduction to HTTP/2 and How To Use It
Introduction to HTTP/2 and How To Use ItIntroduction to HTTP/2 and How To Use It
Introduction to HTTP/2 and How To Use It
ArcBlock
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_public
Saewoong Lee
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
wonyong hwang
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
Laurent Bernaille
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
Laurent Bernaille
 
Configure DHCP Server and DHCP-Relay
Configure DHCP Server and DHCP-RelayConfigure DHCP Server and DHCP-Relay
Configure DHCP Server and DHCP-Relay
Tola LENG
 
How to configure IPA-Server & Client-Centos 7
How to configure IPA-Server & Client-Centos 7How to configure IPA-Server & Client-Centos 7
How to configure IPA-Server & Client-Centos 7
Tola LENG
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
Laurent Bernaille
 

What's hot (20)

Open vpn server_linux
Open vpn server_linuxOpen vpn server_linux
Open vpn server_linux
 
Network Manual
Network ManualNetwork Manual
Network Manual
 
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
Real Time Health Analytics With WebSockets Python 3 and Redis PubSub: Benjami...
 
Ad, dns, dhcp, file server
Ad, dns, dhcp, file serverAd, dns, dhcp, file server
Ad, dns, dhcp, file server
 
Replacing Squid with ATS
Replacing Squid with ATSReplacing Squid with ATS
Replacing Squid with ATS
 
Basic security &amp; info
Basic security &amp; infoBasic security &amp; info
Basic security &amp; info
 
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_Tola.leng mail server (sq_mail &amp; rcmail)_q5_
Tola.leng mail server (sq_mail &amp; rcmail)_q5_
 
Failsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo HomepageFailsafe Mechanism for Yahoo Homepage
Failsafe Mechanism for Yahoo Homepage
 
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
Functional Reactive Programming with Kotlin on Android - Giorgio Natili - Cod...
 
System Engineer: OpenLDAP and Samba Server
System Engineer: OpenLDAP and Samba ServerSystem Engineer: OpenLDAP and Samba Server
System Engineer: OpenLDAP and Samba Server
 
DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)DNS windows server(2008R2) & linux(SLES 11)
DNS windows server(2008R2) & linux(SLES 11)
 
Discovering OpenBSD on AWS
Discovering OpenBSD on AWSDiscovering OpenBSD on AWS
Discovering OpenBSD on AWS
 
Introduction to HTTP/2 and How To Use It
Introduction to HTTP/2 and How To Use ItIntroduction to HTTP/2 and How To Use It
Introduction to HTTP/2 and How To Use It
 
Fluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_publicFluentd 20150918 no_demo_public
Fluentd 20150918 no_demo_public
 
kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Deep dive in Docker Overlay Networks
Deep dive in Docker Overlay NetworksDeep dive in Docker Overlay Networks
Deep dive in Docker Overlay Networks
 
Deep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay NetworksDeep Dive in Docker Overlay Networks
Deep Dive in Docker Overlay Networks
 
Configure DHCP Server and DHCP-Relay
Configure DHCP Server and DHCP-RelayConfigure DHCP Server and DHCP-Relay
Configure DHCP Server and DHCP-Relay
 
How to configure IPA-Server & Client-Centos 7
How to configure IPA-Server & Client-Centos 7How to configure IPA-Server & Client-Centos 7
How to configure IPA-Server & Client-Centos 7
 
Deeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay NetworksDeeper dive in Docker Overlay Networks
Deeper dive in Docker Overlay Networks
 

Similar to CoreOS in anger : firing up wordpress across a 3 machine CoreOS cluster

Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
Puppet
 
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean WinnCouch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Trevor Roberts Jr.
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013
Trevor Roberts Jr.
 
(NET301) New Capabilities for Amazon Virtual Private Cloud
(NET301) New Capabilities for Amazon Virtual Private Cloud(NET301) New Capabilities for Amazon Virtual Private Cloud
(NET301) New Capabilities for Amazon Virtual Private Cloud
Amazon Web Services
 
Development Workflows on AWS
Development Workflows on AWSDevelopment Workflows on AWS
Development Workflows on AWS
Amazon Web Services
 
Dockercon 14
Dockercon 14Dockercon 14
Dockercon 14
John Fiedler
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQ
Docker, Inc.
 
Cloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCECloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCE
ShapeBlue
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
Kickstat File_Draft_ESXI5.1_Template
Kickstat File_Draft_ESXI5.1_TemplateKickstat File_Draft_ESXI5.1_Template
Kickstat File_Draft_ESXI5.1_Template
Luca Viscomi
 
Operating CloudStack: the easy way (automation!)
Operating CloudStack: the easy way (automation!)Operating CloudStack: the easy way (automation!)
Operating CloudStack: the easy way (automation!)
Remi Bergsma
 
How to build and run oci containers
How to build and run oci containersHow to build and run oci containers
How to build and run oci containers
Spyros Trigazis
 
Rfc 3412
Rfc 3412Rfc 3412
Rfc 3412
Saurabh Maggo
 
Couch to OpenStack: Nova - July, 30, 2013
Couch to OpenStack: Nova - July, 30, 2013Couch to OpenStack: Nova - July, 30, 2013
Couch to OpenStack: Nova - July, 30, 2013
Trevor Roberts Jr.
 
Bare-metal and Virtual Provisioning with Razor
Bare-metal and Virtual Provisioning with RazorBare-metal and Virtual Provisioning with Razor
Bare-metal and Virtual Provisioning with Razor
Kristian Reese
 
Streaming Data from Scylla to Kafka
Streaming Data from Scylla to KafkaStreaming Data from Scylla to Kafka
Streaming Data from Scylla to Kafka
ScyllaDB
 
Fosscon 2012 firewall workshop
Fosscon 2012 firewall workshopFosscon 2012 firewall workshop
Fosscon 2012 firewall workshop
jvehent
 
Puppet Data Mining
Puppet Data MiningPuppet Data Mining
Puppet Data Mining
Gareth Rushgrove
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
Steve Smith
 
Complex stories about Sqooping PostgreSQL data
Complex stories about Sqooping PostgreSQL dataComplex stories about Sqooping PostgreSQL data
Complex stories about Sqooping PostgreSQL data
NTT DATA OSS Professional Services
 

Similar to CoreOS in anger : firing up wordpress across a 3 machine CoreOS cluster (20)

Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
Cloudy with a Chance of Fireballs: Provisioning and Certificate Management in...
 
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean WinnCouch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
Couch to OpenStack: Neutron (Quantum) - August 13, 2013 Featuring Sean Winn
 
Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013Couch to OpenStack: Glance - July, 23, 2013
Couch to OpenStack: Glance - July, 23, 2013
 
(NET301) New Capabilities for Amazon Virtual Private Cloud
(NET301) New Capabilities for Amazon Virtual Private Cloud(NET301) New Capabilities for Amazon Virtual Private Cloud
(NET301) New Capabilities for Amazon Virtual Private Cloud
 
Development Workflows on AWS
Development Workflows on AWSDevelopment Workflows on AWS
Development Workflows on AWS
 
Dockercon 14
Dockercon 14Dockercon 14
Dockercon 14
 
Docker at RelateIQ
Docker at RelateIQDocker at RelateIQ
Docker at RelateIQ
 
Cloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCECloudstack interfaces to EC2 and GCE
Cloudstack interfaces to EC2 and GCE
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
 
Kickstat File_Draft_ESXI5.1_Template
Kickstat File_Draft_ESXI5.1_TemplateKickstat File_Draft_ESXI5.1_Template
Kickstat File_Draft_ESXI5.1_Template
 
Operating CloudStack: the easy way (automation!)
Operating CloudStack: the easy way (automation!)Operating CloudStack: the easy way (automation!)
Operating CloudStack: the easy way (automation!)
 
How to build and run oci containers
How to build and run oci containersHow to build and run oci containers
How to build and run oci containers
 
Rfc 3412
Rfc 3412Rfc 3412
Rfc 3412
 
Couch to OpenStack: Nova - July, 30, 2013
Couch to OpenStack: Nova - July, 30, 2013Couch to OpenStack: Nova - July, 30, 2013
Couch to OpenStack: Nova - July, 30, 2013
 
Bare-metal and Virtual Provisioning with Razor
Bare-metal and Virtual Provisioning with RazorBare-metal and Virtual Provisioning with Razor
Bare-metal and Virtual Provisioning with Razor
 
Streaming Data from Scylla to Kafka
Streaming Data from Scylla to KafkaStreaming Data from Scylla to Kafka
Streaming Data from Scylla to Kafka
 
Fosscon 2012 firewall workshop
Fosscon 2012 firewall workshopFosscon 2012 firewall workshop
Fosscon 2012 firewall workshop
 
Puppet Data Mining
Puppet Data MiningPuppet Data Mining
Puppet Data Mining
 
DeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to DockerDeveloperWeek 2015: A Practical Introduction to Docker
DeveloperWeek 2015: A Practical Introduction to Docker
 
Complex stories about Sqooping PostgreSQL data
Complex stories about Sqooping PostgreSQL dataComplex stories about Sqooping PostgreSQL data
Complex stories about Sqooping PostgreSQL data
 

Recently uploaded

Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
Miro Wengner
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
operationspcvita
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
Antonios Katsarakis
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
Safe Software
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
Edge AI and Vision Alliance
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Alpen-Adria-Universität
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
Neo4j
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
Edge AI and Vision Alliance
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
AstuteBusiness
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Neo4j
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
Fwdays
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
Pablo Gómez Abajo
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
Fwdays
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
Ajin Abraham
 

Recently uploaded (20)

Artificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic WarfareArtificial Intelligence and Electronic Warfare
Artificial Intelligence and Electronic Warfare
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
JavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green MasterplanJavaLand 2024: Application Development Green Masterplan
JavaLand 2024: Application Development Green Masterplan
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
The Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptxThe Microsoft 365 Migration Tutorial For Beginner.pptx
The Microsoft 365 Migration Tutorial For Beginner.pptx
 
Dandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity serverDandelion Hashtable: beyond billion requests per second on a commodity server
Dandelion Hashtable: beyond billion requests per second on a commodity server
 
Essentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation ParametersEssentials of Automations: Exploring Attributes & Automation Parameters
Essentials of Automations: Exploring Attributes & Automation Parameters
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
“Temporal Event Neural Networks: A More Efficient Alternative to the Transfor...
 
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing InstancesEnergy Efficient Video Encoding for Cloud and Edge Computing Instances
Energy Efficient Video Encoding for Cloud and Edge Computing Instances
 
Leveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and StandardsLeveraging the Graph for Clinical Trials and Standards
Leveraging the Graph for Clinical Trials and Standards
 
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
“How Axelera AI Uses Digital Compute-in-memory to Deliver Fast and Energy-eff...
 
Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |Astute Business Solutions | Oracle Cloud Partner |
Astute Business Solutions | Oracle Cloud Partner |
 
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and BioinformaticiansBiomedical Knowledge Graphs for Data Scientists and Bioinformaticians
Biomedical Knowledge Graphs for Data Scientists and Bioinformaticians
 
"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota"Choosing proper type of scaling", Olena Syrota
"Choosing proper type of scaling", Olena Syrota
 
Mutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented ChatbotsMutation Testing for Task-Oriented Chatbots
Mutation Testing for Task-Oriented Chatbots
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk"Frontline Battles with DDoS: Best practices and Lessons Learned",  Igor Ivaniuk
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor Ivaniuk
 
AppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSFAppSec PNW: Android and iOS Application Security with MobSF
AppSec PNW: Android and iOS Application Security with MobSF
 

CoreOS in anger : firing up wordpress across a 3 machine CoreOS cluster

  • 1. {CoreOS in anger Shaun Domingo - @sdomsta Head of Tech and Operations @ Ninefold
  • 3. Why CoreOS? Built-in clustering Few binaries No packaging system Dependent on containers for managing software and apps Light weight, fat-free Automatic updates
  • 4.  A single, distributed init system  Encourages small, ephemeral units / services  Schedules units into the cluster based on declared conflicts in systemd unit files  Fault tolerant  Can be managed locally or remotely by fleetctl CoreOS building blocks systemd fleet etcd
  • 5. Orchestration DIY Kubernetes (Google) Mesos + Marathon (Apache) CoreOS arsenal etcd fleet flannel docker rocket
  • 6. +---------------+ +----------------+ +----------------+ | | | | | | | core-01 | <> | core-02 | <> | core-03 | | | etcd | | etcd | | +---------------+ +----------------+ +----------------+ Exercise 1: Boot up a 3 machine coreos cluster
  • 7.  Download & install Vagrant:  http://www.vagrantup.com/downloads.html  Download & install Virtualbox:  https://www.virtualbox.org/wiki/Downloads 1a: install VirtualBox
  • 8.  mkdir ~/coreos; cd ~/coreos  git clone https://github.com/coreos/coreos- vagrant.git 1b: Clone the coreos- vagrant repo
  • 9. cd coreos-vagrant cp config.rb.sample config.rb vim config.rb  change $num_instances: $num_instances=3  change $update_channel: $update_channel=‘beta’  Change $forwarded_ports: $forwarded_ports = {8000 => 8888} 1c: modify your config.rb We’ll use this later You’ll get 3 CoreOS VMs ‘alpha’ if you like bleeding edge, ‘stable’ if you want to stay sane.
  • 10.  Visit https://discovery.etcd.io/new?size=3  (you’ll need a new one every time you destroy a cluster)  Copy the entire URL provided in the body of the response 1d: get yourself a discovery token
  • 11. 4c4,6 < etcd: --- > update: > reboot-strategy: etcd-lock > # etcd: 8,9c10,11 < addr: $public_ipv4:4001 < peer-addr: $public_ipv4:7001 --- > #addr: $public_ipv4:4001 > #peer-addr: $public_ipv4:7001 12c14 < #discovery: https://discovery.etcd.io/<token> --- > discovery: https://discovery.etcd.io/YOUR_DISCOVERY_TOKEN_HERE 25,26c27,28 < - name: etcd.service < command: start --- > #- name: etcd.service > # command: start 29,30c31,32 < #- name: etcd2.service < # command: start --- > - name: etcd2.service > command: start 1e: modify your user-data and turn on etcd2 Reboot after first taking a lock in etcd Disable etcd (version 1) Enable etcd2.service, disable etcd.service Add your copied discovery token here
  • 12.  The $private_ipv4 and $public_ipv4 substitutio n variables are fully supported in cloud-config on Vagrant. They will map to the first statically defined private and public networks defined in the Vagrantfile. A note on $private_ipv4 and $public_ipv4 substitution variables
  • 16. Exercise 2: Get talking to your cluster
  • 17.  https://github.com/coreos/fleet/releases  Unzip, add the binary to your path (.bashrc / .bash_profile / .zshrc) PATH=$PATH:/path/to/fleetctl  Restart your terminal 2a: Download fleetctl
  • 18. cd /path/to/coreos-vagrant eval $(ssh-agent) # Add the correct vagrant .ssh identity vagrant ssh-config | sed -n "s/IdentityFile//gp" | uniq | xargs ssh-add 2b: start your engines Ensure ssh-agent is running NOTE: You’ll need to rerun these steps each time you blow away your vagrant CoreOS cluster.
  • 19. export FLEETCTL_TUNNEL="127.0.0.1:$(vagrant ssh- config | grep -i 'port' | awk '{print $2; exit}')" # remove your fleet known hosts rm ~/.fleetctl/known_hosts 2c: Prepare for takeoff NOTE: You’ll need to rerun these steps each time you blow away your vagrant CoreOS cluster.
  • 21. Need to tweak? Do it all in the comfort of 127.0.0.1.
  • 23.  Containers, microservices => stateless  Containers => spin them up quick  Load balancing => how does it work? Considerations at scale
  • 24.  When we start a unit, auto-add it to the web cluster  When we destroy a unit, auto-remove it from the web cluster  When a container is flakey, don’t use it  Spin up lots of my units without a hassle Desired
  • 25. +----------------------------+ | | | Web server / RP | | | +-------------+--------------+ | +-------------+--------------+ | | | App server | | | +-------------+--------------+ | +-------------+--------------+ | | | Database | | | +----------------------------+ Standard 3-tier architecture
  • 26. +----------------------------+ | | | Web server / RP | | | +-------------+--------------+ | +-------------+--------------+ | | | App server | | | +-------------+--------------+ | +-------------+--------------+ | | | Database | | | +----------------------------+ … just won’t work here. Needs to scale, be fault tolerant, have speed and be nearby.
  • 27. +----------------------------+ | | | Web server / RP | | | +-------------+--------------+ | +-------------+--------------+ | | | App server | | | +-------------+--------------+ | +-------------+--------------+ | | | Database | | | +----------------------------+ … just won’t work here. Needs to be stateless, needs to focus on dynamic workloads.
  • 28. +----------------------------+ | | | Web server / RP | | | +-------------+--------------+ | +-------------+--------------+ | | | App server | | | +-------------+--------------+ | +-------------+--------------+ | | | Database | | | +----------------------------+ … just won’t work here. Needs to handle caching, should really be a CDN, should be great at delivering static content.
  • 29.  CDN is a must – S3 for asset sync  Cache as much as you can – varnish, CloudFront  Load balancing  Web server as a RP  App server / runtime  Database as a service  Key/value store – e.g. redis, cache as much as you can To achieve true web scale
  • 30.  Tonight’s example: Wordpress at (localhost) scale A traditional app, not written with containers and true scale in mind. Yet it is still incredibly popular as a blogging and web platform worldwide. Localhost scale
  • 31. +---------80----------+ +------------+ | | | CDN |<-+ | Load Balancer | +------------+ | | | | +--------8888---------+ | / | | / | | +-------8888---------+ +--------8888---------+ +-------8888---------+ | | | | | | | | | VM1 | | VM2 | | VM3 | | | | | | | | | +--------------------+ +---------------------+ +--------------------+ | | | | | | | | | Workload balancer | | Workload balancer | | Workload balancer | | | | | | | | | +---+---+---+---+---++ +---+---+---+---+---+-+ +--+---+----+---+----+ | | | | | | | | | | | | | | | | | +---+---+---+-+-+---+ +--+---+---+---+---+ +-+---+----+---+---+-+ | | wp| wp| wp| wp| wp| |wp| wp| wp| wp| wp| | wp | wp| wp| wp| wp| ---+ +-------------------+ +------------------+ +--------------------+ Exercise 3 goal
  • 32. +---------80----------+ | | | Load Balancer | | | +--------8888---------+ / | / | +-------8888---------+ +--------8888--------+ +-------8888---------+ | | | | | | | core-01 | | core-02 | | core-03 | | | | | | | +--------------------+ +--------------------+ +--------------------+ | vulcand | | vulcand | | vulcand | +--------------------+ +--------------------+ +--------------------+ | discovery sidekick | | discovery sidekick | | discovery sidekick | +--------------------+---+--------------------+--+--------------------+ | wp wp wp wp wp wpn | | wp wp wp wp wp wpn | | wp wp wp wp wp wpn | +--------------------+ +--------------------+ +--------------------+ How we’ll solve it Imagine everything above the line is solvable with haproxy … it is. fleetunits As wp units are started, discovery notifies vulcand by writing to etcd
  • 33. mkdir ~/coreos; cd ~/coreos git clone git@github.com:shaundomingo/coreos- units.git 3a: Clone my repo
  • 34. Modify the following files to add details of your database server and S3 bucket and AWS keys: coreos-units/clusterable- wordpress/wordpress/wordpress@.service and coreos-units/clusterable-wordpress/wordpress/wordpress- admin.service 3b: Add config
  • 35. Either follow clusterable-wordpress/README.md for instructions on how to run, or if you’re like me and like to cheat: cd coreos-units/clusterable-wordpress ./wordpress-up.sh There’ll be some errors/warnings … that’s normal. 3c: Run *.*
  • 36. 3d: Observe your mighty cluster firing up
  • 37. fleetctl journal -f discovery@1.service Watch as it finds wordpress containers and adds locations into etcd for vulcan. 3e: Check out some logs
  • 38. 3f: Play with your wordpress site Go to this URL in your browser: http://wordpress.local:8888
  • 39.  Our docker units really scale … even if your local machine doesn’t Scale
  • 42.  Built a CoreOS cluster in the complete privacy of our own laptops… well except for docker, and github, and, OH …  Brought to life the complexities of container management and scale  Made you a CoreOS genius in a few minutes What have we done?
  • 43. There was a bit of work to get this going
  • 44.  Unit file automation  Vulcanproxy persistence  Monitoring  Autoscale  Appc Where to next?
  • 45.  Let’s talk – you have software, we have … a great virtualisation layer.  Steak knives come free Are you looking to deploy containers to prod?
  • 46.  @sdomsta  @ninefold Follow me, make me famous Deploy on Ninefold, we’ll look after you. Servers from $7 month.

Editor's Notes

  1. Built-in clustering support – it just works, all you need is a is a unique discovery token Few binaries – it is literally barebones No packaging system (no apt-get or yum) – which makes the machine lightweight and extremely easy to upgrade Dependent on Docker containers for managing software and apps on the OS.
  2. Flannel: a generic overlay network, that can be used as an alternative to existing software defined networking solutions. Provides each host in a cluster is given it’s own subnet (e.g. /24). Uses etcd to maintain mappings between allocated subnets and real host IPs. Perfect for container networking. Although it is shipped as a docker container … it is not shipped with CoreOS. Rocket is CoreOS’ very own container runtime. And, guess what it’s just a downloadable zip file from https://github.com/coreos/rocket. So you can run containers in a jiffy. There’s a whole demo in that component sometime.