SlideShare a Scribd company logo
Deploying Containers
with Rancher
Chris	Tankersley	
@dragonmantank	
Day	Camp	4	Developers,	Ops	for	Devs	
Day	Camp	4	Developers	-	Ops	for	Devs	 1
What Is Rancher?
Day	Camp	4	Developers	-	Ops	for	Devs	 2
Rancher and RancherOS
Day	Camp	4	Developers	-	Ops	for	Devs	 3
Why Use Rancher?
Day	Camp	4	Developers	-	Ops	for	Devs	 4
Manages your Containers
Day	Camp	4	Developers	-	Ops	for	Devs	 5
Manages your Hosts
Day	Camp	4	Developers	-	Ops	for	Devs	 6
Allows you to monitor containers
Day	Camp	4	Developers	-	Ops	for	Devs	 7
Allows you to manage your applications
Day	Camp	4	Developers	-	Ops	for	Devs	 8
Allows you to deploy your applications
Day	Camp	4	Developers	-	Ops	for	Devs	 9
Allows you to deploy your applications
Day	Camp	4	Developers	-	Ops	for	Devs	 10
Supports Docker Compose
Day	Camp	4	Developers	-	Ops	for	Devs	 11
Installation
Day	Camp	4	Developers	-	Ops	for	Devs	 12
Install Docker on a machine
Day	Camp	4	Developers	-	Ops	for	Devs	 13
Using Docker Machine
Day	Camp	4	Developers	-	Ops	for	Devs	 14
Our Setup
•  3	Machines	
•  1	Rancher	Server	
•  2	Rancher	Nodes	
•  All	running	RancherOS	
•  Docker	1.11	
Day	Camp	4	Developers	-	Ops	for	Devs	 15
docker-machine Command
docker-machine	create	-d	virtualbox		
				--virtualbox-boot2docker-url	http://releases.rancher.com/os/latest/rancheros.iso		
				--virtualbox-memory	“2048”		
				[node	name]	
Day	Camp	4	Developers	-	Ops	for	Devs	 16	
hMp://docs.rancher.com/os/running-rancheros/workstaQon/docker-machine/
Machines Build
Day	Camp	4	Developers	-	Ops	for	Devs	 17
Add rancher/server to the master
Day	Camp	4	Developers	-	Ops	for	Devs	 18	
docker	run	-d		
				--restart=always		
				-p	8080:8080		
				–name=rancher		
				rancher/server
Add rancher/agent to nodes
Day	Camp	4	Developers	-	Ops	for	Devs	 19	
docker	run	-d		
				--privileged		
				-v	/var/run/docker.sock:/var/run/docker.sock		
				rancher/agent:v0.7.9		
				http://192.168.99.100:8080/v1/scripts/[hash]
All Done!
Day	Camp	4	Developers	-	Ops	for	Devs	 20
Manual Container Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 21
Add Container to Node
Day	Camp	4	Developers	-	Ops	for	Devs	 22
Fill out Container Info
Day	Camp	4	Developers	-	Ops	for	Devs	 23
Wait for it to become active
Day	Camp	4	Developers	-	Ops	for	Devs	 24
Wait for it to become active
Day	Camp	4	Developers	-	Ops	for	Devs	 25
See it running
Day	Camp	4	Developers	-	Ops	for	Devs	 26
Visit the Container
Day	Camp	4	Developers	-	Ops	for	Devs	 27
Metrics
Day	Camp	4	Developers	-	Ops	for	Devs	 28
Viewing Container Metrics
Day	Camp	4	Developers	-	Ops	for	Devs	 29
Viewing Host Metrics
Day	Camp	4	Developers	-	Ops	for	Devs	 30
Stacks
Day	Camp	4	Developers	-	Ops	for	Devs	 31
What are Stacks?
Day	Camp	4	Developers	-	Ops	for	Devs	 32
Adding a Service
Day	Camp	4	Developers	-	Ops	for	Devs	 33
Adding a Service
Day	Camp	4	Developers	-	Ops	for	Devs	 34
Adding a Service
Day	Camp	4	Developers	-	Ops	for	Devs	 35
Adding a Service
Day	Camp	4	Developers	-	Ops	for	Devs	 36
Adding a Service
Day	Camp	4	Developers	-	Ops	for	Devs	 37
Rancher Auto-Deploys
Day	Camp	4	Developers	-	Ops	for	Devs	 38
Add an Apache/PHP Service
Day	Camp	4	Developers	-	Ops	for	Devs	 39
Let it deploy
Day	Camp	4	Developers	-	Ops	for	Devs	 40
Visit the web server
Day	Camp	4	Developers	-	Ops	for	Devs	 41
Check Deployments in Infrastructure
Day	Camp	4	Developers	-	Ops	for	Devs	 42
Custom Repositories
Day	Camp	4	Developers	-	Ops	for	Devs	 43
Adding Private/Custom Registry
Day	Camp	4	Developers	-	Ops	for	Devs	 44
Type in Auth Info
Day	Camp	4	Developers	-	Ops	for	Devs	 45
All the nodes can use it!
Day	Camp	4	Developers	-	Ops	for	Devs	 46
Deploying Upgrades
Day	Camp	4	Developers	-	Ops	for	Devs	 47
Deployment Types
•  Blue-Green	Deployments	
•  Rolling	Deployments	
Day	Camp	4	Developers	-	Ops	for	Devs	 48
Blue-Green Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 49	
Router	
App	v1	 App	v2
Blue-Green Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 50	
Router	
App	v3	 App	v2
Blue-Green Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 51	
Router	
App	v3	 App	v2
Rolling Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 52	
App	v1
Rolling Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 53	
App	v2
Rolling Deployments
Day	Camp	4	Developers	-	Ops	for	Devs	 54	
App	v2
New Container for Web Server
#	Dockerfile	
FROM	php:apache	
	
COPY	index.php	/var/www/html	
Day	Camp	4	Developers	-	Ops	for	Devs	 55
Push to Docker Hub
Day	Camp	4	Developers	-	Ops	for	Devs	 56
Upgrade Webserver Container
Day	Camp	4	Developers	-	Ops	for	Devs	 57
Upgrade Webserver Container
Day	Camp	4	Developers	-	Ops	for	Devs	 58
Rancher Upgrades it
Day	Camp	4	Developers	-	Ops	for	Devs	 59
Rancher lets us know it’s done
Day	Camp	4	Developers	-	Ops	for	Devs	 60
Check Container once Upgraded
Day	Camp	4	Developers	-	Ops	for	Devs	 61
Rollback or Finish
Day	Camp	4	Developers	-	Ops	for	Devs	 62
Do it again
•  Edit	My	Code	
•  Build	My	Image	
•  Push	to	Docker	Hub	
•  Upgrade	the	Service	
Day	Camp	4	Developers	-	Ops	for	Devs	 63
Rancher CLI
Day	Camp	4	Developers	-	Ops	for	Devs	 64
What is it?
•  Rancher	has	an	API!	
•  Small	executable	that	interacts	with	Rancher	API	
•  Kind	of	like	a	custom	docker-compose	
Day	Camp	4	Developers	-	Ops	for	Devs	 65
Get an API Key
Day	Camp	4	Developers	-	Ops	for	Devs	 66
Get an API Key
Day	Camp	4	Developers	-	Ops	for	Devs	 67
Download Rancher CLI
Day	Camp	4	Developers	-	Ops	for	Devs	 68
Export Stack Config
Day	Camp	4	Developers	-	Ops	for	Devs	 69
Two Config Files
Day	Camp	4	Developers	-	Ops	for	Devs	 70
docker-compose.yml
Day	Camp	4	Developers	-	Ops	for	Devs	 71
Deploy Script
Day	Camp	4	Developers	-	Ops	for	Devs	 72	
ACCESS_KEY="C4F407CE1D8C59EB53BE"	
SECRET="daNENHR241Jzm5Z9iw6VsujD9hWfjHWrDzkKmKiA"	
RANCHER_URL="http://192.168.99.100:8080"	
	
./rancher-compose	--secret-key=${SECRET}	--access-key=${ACCESS_KEY}	--url=${RANCHER_URL}	--
file=docker-compose.yml	--rancher-file=rancher-compose.yml	-p	phptest	up	--upgrade	-d
Edit and Deploy
Day	Camp	4	Developers	-	Ops	for	Devs	 73
Edit and Deploy
Day	Camp	4	Developers	-	Ops	for	Devs	 74
Finish Upgrade
Day	Camp	4	Developers	-	Ops	for	Devs	 75
Storage Pools
Day	Camp	4	Developers	-	Ops	for	Devs	 76
What do they do?
•  Convoy	
•  Plugins	that	allow	distributed	volumes	
•  GlusterFS,	NFS	
Day	Camp	4	Developers	-	Ops	for	Devs	 77
Networking
Day	Camp	4	Developers	-	Ops	for	Devs	 78
Key Features
•  Deployments	keep	links	intact	
•  Networks	can	span	hosts	
Day	Camp	4	Developers	-	Ops	for	Devs	 79
Thanks!
-  Docker	for	Developers	
-  LearningContainers.com	
-  hMp://ctankersley.com	
-  @dragonmantank	
-  chris@ctankersley.com	
Day	Camp	4	Developers	-	Ops	for	Devs	 80	
Rate	this	talk	on	Joind.in	
hMps://joind.in/talk/ce080

More Related Content

PPTX
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
PPTX
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
PPTX
More tips and tricks for running containers like a pro - Rancher Online MEetu...
PPTX
Introducing Project Longhorn - April 2016 Rancher Online Meetup
PPTX
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
PPTX
Storage for containers and cloud-native deployments - Rancher Online Meetup -...
PPTX
Introducing Kubernetes Clusters in Rancher - February 2016 Online Meetup
PPTX
Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...
Next Gen Storage and Networking in Container Environments - September 2016 Ra...
Rancher March 2016 Online Meetup Containers-as-a-Service with Rancher 1.0
More tips and tricks for running containers like a pro - Rancher Online MEetu...
Introducing Project Longhorn - April 2016 Rancher Online Meetup
Running Rancher and Docker on Dev Machines - Rancher Online Meetup - May 2016
Storage for containers and cloud-native deployments - Rancher Online Meetup -...
Introducing Kubernetes Clusters in Rancher - February 2016 Online Meetup
Tips, Tricks and Tools for Running Containers Like a Pro - Rancher Labs April...

What's hot (20)

PPTX
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
PPTX
Securing Container Deployments from Build to Ship to Run - August 2017 - Ranc...
PPTX
Dear IT...I'd Like A Kubernetes Cluster
PPTX
Building an Enterprise CaaS with Kubernetes and Rancher 2.0
PPTX
Building a Scalable CI Platform using Docker, Drone and Rancher
PPTX
Supercharging CI/CD with GitLab and Rancher - June 2017 Online Meetup
PPTX
Hands-on with Rancher 2.0 and Kubernetes - October 2017 Rancher Online Meetup
PDF
An Introduction to Rancher
PPTX
Rancher presentation august 2017
PPTX
Infrasturcure-as-code with Kubernetes and Rancher - September 2019 Online Meetup
PDF
Automate CI/CD with Rancher
PPTX
Rancher 2.0 - Complete Container Management Platform
PDF
Rancher Labs - Your own PaaS in action
PDF
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
PDF
Rancher 2.0 Technical Deep Dive
PDF
Spinnaker Summit 2019: Where are we heading? The Future of Continuous Delivery
PDF
Rancher 2.x first step before deep dive
PDF
What's rancher v2.1.0 JA
PDF
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
PDF
Docker @ RelateIQ Presentation
Introducing Apache Mesos environments in Rancher - June 2016 Online Meetup
Securing Container Deployments from Build to Ship to Run - August 2017 - Ranc...
Dear IT...I'd Like A Kubernetes Cluster
Building an Enterprise CaaS with Kubernetes and Rancher 2.0
Building a Scalable CI Platform using Docker, Drone and Rancher
Supercharging CI/CD with GitLab and Rancher - June 2017 Online Meetup
Hands-on with Rancher 2.0 and Kubernetes - October 2017 Rancher Online Meetup
An Introduction to Rancher
Rancher presentation august 2017
Infrasturcure-as-code with Kubernetes and Rancher - September 2019 Online Meetup
Automate CI/CD with Rancher
Rancher 2.0 - Complete Container Management Platform
Rancher Labs - Your own PaaS in action
Spinnaker Summit 2018: CI/CD Patterns for Kubernetes with Spinnaker
Rancher 2.0 Technical Deep Dive
Spinnaker Summit 2019: Where are we heading? The Future of Continuous Delivery
Rancher 2.x first step before deep dive
What's rancher v2.1.0 JA
JUC Europe 2015: Jenkins Pipeline for Continuous Delivery of Big Data Projects
Docker @ RelateIQ Presentation
Ad

Viewers also liked (14)

PPTX
Intro to Docker and clustering with Rancher from scratch
PDF
WTF Is Rancher?
PPTX
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
PPTX
Docker for PHP Developers - Jetbrains
PDF
Modernizing Your Enterprise Application Architecture with Microservices and A...
PDF
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
PDF
CI/CD with Openshift and Jenkins
PPTX
Docker 淺入淺出
PPTX
DevOpsDays - Apresentação
PDF
introducción a Docker
PPSX
From Zero to Hero - Nexinto
PPTX
Presentación Docker
PDF
Docker introducción - Flisol 2015 Huancayo
Intro to Docker and clustering with Rancher from scratch
WTF Is Rancher?
The ultimate container monitoring bake-off - Rancher Online Meetup October 2016
Docker for PHP Developers - Jetbrains
Modernizing Your Enterprise Application Architecture with Microservices and A...
Dev Ops and PaaS - Accelerate Application Delivery with OpenShift
CI/CD with Openshift and Jenkins
Docker 淺入淺出
DevOpsDays - Apresentação
introducción a Docker
From Zero to Hero - Nexinto
Presentación Docker
Docker introducción - Flisol 2015 Huancayo
Ad

Similar to Deploying Containers with Rancher (20)

PPTX
Austin - Container Days - Docker 101
PDF
Using Rancher and Docker with RightScale at Industrie IT
PDF
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
PPTX
From Docker to Production - ZendCon 2016
PPTX
Container Conf 2017: Rancher Kubernetes
PDF
Workshop presentation
PDF
Taking containers from development to production
PDF
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
PDF
Docker for developers
PDF
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
PDF
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
PDF
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
PDF
Docker From Zero To Hero Your Devops Kickstart Build Deploy And Manage Contai...
PDF
Docker on docker leveraging kubernetes in docker ee
PDF
Docker in real life
PPT
Containers 101
PPTX
From Hello World to Real World - Container Days Boston 2016
PDF
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
PDF
Container Days
PPTX
Rancher k8s Training - Oct 4 - Rajashree Mandaogane.pptx
Austin - Container Days - Docker 101
Using Rancher and Docker with RightScale at Industrie IT
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
From Docker to Production - ZendCon 2016
Container Conf 2017: Rancher Kubernetes
Workshop presentation
Taking containers from development to production
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
Docker for developers
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
Kubernetes or OpenShift - choosing your container platform for Dev and Ops
Using Docker Developing and Deploying Software with Containers 1st Edition Ad...
Docker From Zero To Hero Your Devops Kickstart Build Deploy And Manage Contai...
Docker on docker leveraging kubernetes in docker ee
Docker in real life
Containers 101
From Hello World to Real World - Container Days Boston 2016
ContainerDays NYC 2015: "Easing Your Way Into Docker: Lessons From a Journey ...
Container Days
Rancher k8s Training - Oct 4 - Rajashree Mandaogane.pptx

More from Chris Tankersley (20)

PDF
8 Rules for Better Applications - PHP Tek 2025
PDF
The Art of API Design - PHP Tek 2025, Chris Tankersley
PDF
Docker is Dead: Long Live Containers
PDF
Bend time to your will with git
PDF
Using PHP Functions! (Not those functions, Google Cloud Functions)
PDF
Dead Simple APIs with OpenAPI
PDF
Killer Docker Workflows for Development
PDF
You Got Async in my PHP!
ODP
Docker for Developers - PHP Detroit 2018
ODP
Docker for Developers
ODP
They are Watching You
ODP
BASHing at the CLI - Midwest PHP 2018
PDF
You Were Lied To About Optimization
ODP
Docker for PHP Developers - php[world] 2017
ODP
Docker for PHP Developers - Madison PHP 2017
ODP
Docker for Developers - php[tek] 2017
ODP
Why Docker? Dayton PHP, April 2017
PPTX
OOP Is More Then Cars and Dogs - Midwest PHP 2017
PPTX
From Docker to Production - SunshinePHP 2017
PPTX
Docker for Developers - Sunshine PHP
8 Rules for Better Applications - PHP Tek 2025
The Art of API Design - PHP Tek 2025, Chris Tankersley
Docker is Dead: Long Live Containers
Bend time to your will with git
Using PHP Functions! (Not those functions, Google Cloud Functions)
Dead Simple APIs with OpenAPI
Killer Docker Workflows for Development
You Got Async in my PHP!
Docker for Developers - PHP Detroit 2018
Docker for Developers
They are Watching You
BASHing at the CLI - Midwest PHP 2018
You Were Lied To About Optimization
Docker for PHP Developers - php[world] 2017
Docker for PHP Developers - Madison PHP 2017
Docker for Developers - php[tek] 2017
Why Docker? Dayton PHP, April 2017
OOP Is More Then Cars and Dogs - Midwest PHP 2017
From Docker to Production - SunshinePHP 2017
Docker for Developers - Sunshine PHP

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Electronic commerce courselecture one. Pdf
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Big Data Technologies - Introduction.pptx
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Machine learning based COVID-19 study performance prediction
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPT
Teaching material agriculture food technology
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Electronic commerce courselecture one. Pdf
sap open course for s4hana steps from ECC to s4
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Big Data Technologies - Introduction.pptx
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Digital-Transformation-Roadmap-for-Companies.pptx
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Spectroscopy.pptx food analysis technology
Network Security Unit 5.pdf for BCA BBA.
Machine learning based COVID-19 study performance prediction
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
The Rise and Fall of 3GPP – Time for a Sabbatical?
Teaching material agriculture food technology
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
NewMind AI Weekly Chronicles - August'25 Week I
Encapsulation_ Review paper, used for researhc scholars
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

Deploying Containers with Rancher