SlideShare ist ein Scribd-Unternehmen logo
1 von 64
Scaling With Docker Swarm using
Packer, Terraform & OpenStack
Bobby DeVeaux - March 9th 2017
https://joind.in/talk/55008
https://joind.in/talk/55008 @bobbyjason
• Created my first website at 9 Years old in 1995 😮
• Started coding PHP in 2001 - 16 years ago
• Developer, Team Leader, CTO, Director & Consultant
• Been using AWS for over 5 years
• Web Development, Message Queues, Automation, CI&CD
• Previously worked at SkyBet & DVSA
• Now a DevOps Consultant with UKCloud, Evangelising OpenStack
• Contributor to Terraform
• I ♥️ Docker, Terraform & Golang (or anything Hashicorp)
• #twitter: @bobbyjason
About Me ☁️
2
https://joind.in/talk/55008 @bobbyjason
• I’m here to spread the awareness of UKCloud & OpenStack
• I want you to use Docker Swarm
• I want you to love Terraform
• I want to show you how to scale an app using all the above
Why Am I Here?
3
https://joind.in/talk/55008 @bobbyjason
UKCloud at-a-glance
4
https://joind.in/talk/55008 @bobbyjason
• Docker for AWS
• Docker for Azure
• UKCloud offer Cloud Native Infrastructure using Openstack
Why Openstack?
5
https://joind.in/talk/55008 @bobbyjason
• Who’s using Docker yet?
• Who’s using Docker Swarm?
• Who’s using Terraform?
• Who’s using Packer?
• Who’s not played with any of them, and would love to?
Hands Up
6
https://joind.in/talk/55008 @bobbyjason
What Is Docker?
7
“Docker containers wrap a piece of software in a complete
filesystem that contains everything needed to run: code,
runtime, system tools, system libraries – anything that can be
installed on a server. This guarantees that the software will
always run the same, regardless of its environment.”
- docker.com
https://joind.in/talk/55008 @bobbyjason
• Define multi-container setup
• docker-compose.yml
• beats running multiple docker run commands
• can specify multiple Dockerfiles
• docker-compose up .. similar to vagrant up
Docker Compose
8
https://joind.in/talk/55008 @bobbyjason
docker-compose.yml
9
version: "2"
services:
php-fpm:
image: php:7.0.8-fpm-alpine
ports:
- "9000:9000"
nginx:
image: nginx:alpine
ports:
- "80:80"
https://joind.in/talk/55008 @bobbyjason
• Allows tagging - useful for versioning:
• docker tag myapp:latest myapp:2.0.5
• Resides locally
Docker Tag
10
https://joind.in/talk/55008 @bobbyjason
• Image Repository - default for Docker
• Alternatives include:
• Amazon ECR
• Openstack Glance
• quay.io
Docker Hub
11
https://joind.in/talk/55008 @bobbyjason
• Login to selected image repository
• Docker HUB: $ docker login -u username -p password
• Amazon: $ eval `aws ecr get-login`
Docker Login
12
https://joind.in/talk/55008 @bobbyjason
• Push images & tags up to image repository
• docker push myapp:2.0.5
• docker push latest
Docker Push
13
https://joind.in/talk/55008 @bobbyjason
What Is Docker Swarm?
14
“Docker Swarm provides native clustering capabilities to turn a
group of Docker engines into a single, virtual Docker Engine.
With these pooled resources, you can scale out your
application as if it were running on a single, huge computer.”
- docker.com
https://joind.in/talk/55008 @bobbyjason 15
https://joind.in/talk/55008 @bobbyjason
• Docker 1.12 & now 1.13 has Docker Swarm natively, “Swarm Mode”
• Cluster management integrated with Docker Engine
• Decentralized design
• Declarative service model
• Scaling
• Desired state reconciliation
• Multi-host networking
• Service discovery
• Load balancing
• Secure by default
• Rolling updates
Swarm Mode?
16
https://joind.in/talk/55008 @bobbyjason
• docker swarm init —advertise-addr
• Initialises the node for Swarm mode
Docker Swarm Init
17
https://joind.in/talk/55008 @bobbyjason
• docker service create --env APPLICATION_ENV=dev --update-
delay 10s --replicas 1 --network mynet --name php-fpm
bobbydvo/ukc_php-fpm:latest
• docker service create --update-delay 10s --replicas 1 -p 80:80 --
network mynet --name web bobbydvo/ukc_nginx:latest
• docker service update --image bobbydvo/ukc_nginx:1.81 web
Docker Service Create
18
https://joind.in/talk/55008 @bobbyjason
• docker service scale web=5
Docker Service Scale
19
https://joind.in/talk/55008 @bobbyjason
• docker stack deploy —compose-file docker-compose.yml mystack
Docker Stack Deploy (1.13 only)
20
version: "3"
services:
web:
tty: true
depends_on:
- php-fpm
image: bobbydvo/ukc_nginx:latest
ports:
- "80:80"
deploy:
mode: replicated
replicas: 2
update_config:
parallelism: 1
delay: 10s
failure_action: continue
monitor: 60s
max_failure_ratio: 0.3
php-fpm:
tty: true
build: ./
image: bobbydvo/dummyapp_php-fpm:latest
ports:
- "9000:9000"
environment:
- APPLICATION_ENV=prod
deploy:
mode: replicated
replicas: 1
update_config:
parallelism: 1
delay: 10s
failure_action: continue
monitor: 60s
max_failure_ratio: 0.3
https://joind.in/talk/55008 @bobbyjason
• We’re about to embark onto the interesting stuff
• Any questions?
…and Pause.
21
https://joind.in/talk/55008 @bobbyjason
• Packer
• Terraform
• Docker Swarm
• Jenkins For Release
How Do We Scale on Real Infrastructure
22
https://joind.in/talk/55008 @bobbyjason
• Terraform is a tool for building, changing, and versioning
infrastructure safely and efficiently. Terraform can manage existing
and popular service providers as well as custom in-house solutions.
• Infrastructure as Code: Infrastructure is described using a high-level
configuration syntax. This allows a blueprint of your datacenter to be
versioned and treated as you would any other code. Additionally,
infrastructure can be shared and re-used.
• Execution Plans: Terraform has a "planning" step where it generates
an execution plan. The execution plan shows what Terraform will do
when you call apply. This lets you avoid any surprises when
Terraform manipulates infrastructure
What Is Terraform?
23
https://joind.in/talk/55008 @bobbyjason
• Terraform plan
• Will show you exactly what it’s going to do and how many resources
are going to be affected
• No surprises.
Terraform Plan
24
https://joind.in/talk/55008 @bobbyjason
• terraform apply
• Applies the changes as shown in terraform plan using it’s resource
graph. It know’s which resources have dependant resources and
which ones don’t
• Parallelised building - using the resource graph it will make all the
changes as quickly/efficiently as possible
Terraform Apply
25
https://joind.in/talk/55008 @bobbyjason
• Using the .tfstate file, it is fully aware of the resources.
• Terraform destroy will literally remove all the infrastructure it built for
you. WARNING: There is no ctrl+z!
Terraform Destroy
26
https://joind.in/talk/55008 @bobbyjason
Terraform Demo
27
provider "openstack" {
}
resource "openstack_networking_network_v2" "example_network2" {
name = "example_network_2"
admin_state_up = "true"
}
resource "openstack_networking_subnet_v2" "example_subnet2" {
name = "example_subnet_2"
network_id = "${openstack_networking_network_v2.example_network2.id}"
cidr = "10.10.1.0/24"
ip_version = 4
dns_nameservers = ["8.8.8.8", "8.8.4.4"]
}
https://joind.in/talk/55008 @bobbyjason
• How long do your builds & deployments in travis / Jenkins take?
• What’s acceptable?
• ‘Quick’ is relative, and depends on your requirements.
• When I say quick deployments, I’m referring to efficient
deployments using Foundation Images.
Who Likes Quick Deployments?
28
https://joind.in/talk/55008 @bobbyjason
• Ansible / Puppet / Chef means that lots of projects now build from
the base box image, i.e. CentOS6 or Ubuntu 14.04 etc.
• Do you want to be building this each build? Some of you are clever,
and don’t. Some of you are clever, but didn’t consider an
alternative, or didn’t know how. Maybe some of you don’t even use
automated builds…
• Using Packer and your provisioner of choice, you can export the
artefact and store it as a Docker Container or Image in your cloud
provider (Amazon AMI, OpenStack Glance, etc).
Foundation Images
29
https://joind.in/talk/55008 @bobbyjason
• Tool for creating identical machine images
• Supports multiple platforms
• Supports many provisioners (Ansible, Chef, Puppet, Bash.. etc.)
• Can export image in multiple formats AMIs for EC2, VMDK/VMX
files for VMware, OVF exports for VirtualBox, etc.
What Is Packer?
30
https://joind.in/talk/55008 @bobbyjason
Packer template.json
31
{
"variables": {
"aws_access_key": "",
"aws_secret_key": ""
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "us-east-1",
"source_ami": "ami-fce3c696",
"instance_type": "t2.micro",
"ssh_username": "ubuntu",
"ami_name": "packer-example {{timestamp}}"
}]
}
https://joind.in/talk/55008 @bobbyjason
Ansible Provisioning
32
"provisioners": [
{
"type": "shell",
"inline": [
"rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm",
"yum -y update",
"yum -y install ansible",
"ansible --version"
]
},{
"type": "ansible-local",
"playbook_file": "./ansible/playbook.yml",
"role_paths": [
"./ansible/roles/init",
"./ansible/roles/server",
"./ansible/roles/mongodb",
"./ansible/roles/php7",
"./ansible/roles/nginx",
"./ansible/roles/supervisord",
"./ansible/roles/redis"
],
"group_vars": "./ansible/common/group_vars"
}
The cool bit;
Putting it all together!
https://joind.in/talk/55008 @bobbyjason
Use Packer To Build CoreOS Image
34
{
"_comment": "Template file pulling from CoreOS",
"builders": [
{
"type": "openstack",
"image_name": "CoreOS-Docker-Alpha-1-13",
"source_image": "8e892f81-2197-464a-9b6b-1a5045735f5d",
"flavor": "c46be6d1-979d-4489-8ffe-e421a3c83fdd",
"ssh_keypair_name": "ukcloudos",
"ssh_private_key_file": "/Users/bobby/.ssh/ukcloudos",
"use_floating_ip": true,
"floating_ip_pool": "internet",
"ssh_username": "core",
"ssh_pty" : true
}
],
https://joind.in/talk/55008 @bobbyjason
Use Packer To Build CoreOS Image
35
"provisioners": [
{
"type": "shell",
"inline": [
"sudo sh -c 'echo GROUP=alpha > /etc/coreos/update.conf'",
"sudo systemctl restart update-engine",
"sudo update_engine_client -update",
"sudo sh -c 'mkdir /opt/'",
"sudo sh -c 'mkdir /opt/bin'",
"sudo sh -c 'curl -L https://github.com/docker/compose/releases/download/1.9.0/docke
"sudo sh -c 'chmod +x /opt/bin/docker-compose'"
]
},{
"type": "file",
"source": "/Users/bobby/.ssh/ukcloudos",
"destination": "/home/core/.ssh/key.pem"
}
]
}
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - Nginx
36
FROM nginx:alpine
RUN apk update && apk upgrade && apk add --update curl wget bash tree
RUN mkdir -p /srv/web
ADD ./conf/default.conf /etc/nginx/conf.d/default.conf
ADD ./conf/fastcgi_params /etc/nginx/fastcgi_params
ADD ./index.php /srv/web
CMD ["nginx", "-g", "daemon off;"]
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - Nginx
37
server {
listen *:80;
server_name _ localhost;
root /srv/web;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~* .(jpg|jpeg|png|gif|ico|css|js|woff)$ {
expires 365d;
}
location ~* .php$ {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_read_timeout 180;
include fastcgi_params;
}
}
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - Nginx
38
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
fastcgi_param REDIRECT_STATUS 200;
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - php-fpm
39
FROM php:7.0.8-fpm-alpine
RUN apk update && apk upgrade && 
apk add --update curl wget bash tree autoconf gcc g++ make libffi-dev openssl-dev
RUN apk add supervisor
RUN pecl install xdebug 
&& docker-php-ext-enable xdebug 
&& docker-php-ext-install opcache
RUN docker-php-ext-install pdo_mysql
RUN mkdir -p /var/log/supervisor
COPY ./conf/php-dev.ini /usr/local/etc/php/
COPY ./conf/php-prod.ini /usr/local/etc/php/
COPY ./conf/php-prod.ini /usr/local/etc/php/php.ini
COPY ./conf/envars-development.conf /usr/local/etc/php-fpm.d
COPY ./conf/supervisord.conf /etc
WORKDIR /srv
COPY ./index.php /srv/web/
WORKDIR /srv
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer
CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisord.conf"]
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - php-fpm
40
<?php
echo 'Welcome to your php-fpm Docker container.
You should copy your application into the /srv folder and overwrite this file.';
var_dump($_SERVER);
phpinfo();
[program:php-fpm]
command=php-fpm --nodaemonize -c /usr/local/etc/php/php-%(ENV_APPLICATION_ENV)s.ini
https://joind.in/talk/55008 @bobbyjason
Build Basic Docker Images - docker-compose.yml
41
version: "2"
services:
php-fpm:
build: ./php-fpm
image: bobbydvo/ukc_php-fpm:latest
ports:
- "9000:9000"
environment:
- APPLICATION_ENV=dev
web:
build: ./nginx
image: bobbydvo/ukc_nginx:latest
ports:
- "80:80"
$ docker-compose up —build
https://joind.in/talk/55008 @bobbyjason
Build Docker Images Regularly
42
#!/bin/bash
VERSION=1
CONTAINER=$1
BUILD_NUMBER=$2
if [[ $CONTAINER == 'all' ]];
then
for CONTAINER in php-fpm nginx dynamodb consul;
do
docker build ./$CONTAINER -t bobbydvo/ukc_$CONTAINER:latest
docker tag bobbydvo/ukc_$CONTAINER:latest bobbydvo/ukc_$CONTAINER:$VERSION.$BUIL
done
exit
fi
docker build ./$CONTAINER -t bobbydvo/ukc_$CONTAINER:latest
docker tag bobbydvo/ukc_$CONTAINER:latest bobbydvo/ukc_$CONTAINER:$VERSION.$BUILD_NUMBER
docker push bobbydvo/ukc_$CONTAINER:latest
docker push bobbydvo/ukc_$CONTAINER:$VERSION.$BUILD_NUMBER
https://joind.in/talk/55008 @bobbyjason
How NOT to Build Your Jenkins Job
43
echo $BUILD_NUMBER
docker -v
whoami
sudo docker login -u bobbydvo -p Lr6n9hrGBLNxBm
sudo ./build.sh $CONTAINER $BUILD_NUMBER
https://joind.in/talk/55008 @bobbyjason
How to Build Your Jenkins Job
44
docker login -u bobbdvo -p Lr6n9hrGBLNxBm
.docker/config.json:
{
"auths": {
"https://index.docker.io/v1/": {
"auth": “************************************”
}
}
https://joind.in/talk/55008 @bobbyjason
How to Build Your Jenkins Job
45
echo $BUILD_NUMBER
docker -v
whoami
#sudo docker login -u bobbydvo -p Lr6n9hrGBLNxBm
sudo ./build.sh $CONTAINER $BUILD_NUMBER
https://joind.in/talk/55008 @bobbyjason
How to Build Your Jenkins Job
46
https://joind.in/talk/55008 @bobbyjason
Building DummyPHP Docker Image
47
FROM bobbydvo/ukc_php-fpm:latest
WORKDIR /srv
COPY . /srv/
WORKDIR /srv
RUN composer install
CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisord.conf"]
https://joind.in/talk/55008 @bobbyjason
On Merge Jenkins Hook
48
set -e
DUMMY_VERSION=$BUILD_VERSION
NGINX_VERSION='latest'
sudo docker-compose build
sudo docker run -i bobbydvo/dummyapp_php-fpm /srv/vendor/bin/phpunit -c /srv/app/phpunit.xml
# tag & push only if all the above succeeded (set -e)
sudo docker tag bobbydvo/dummyapp_php-fpm:latest bobbydvo/dummyapp_php-fpm:$DUMMY_VERSION
sudo docker push bobbydvo/dummyapp_php-fpm:$DUMMY_VERSION
sudo docker push bobbydvo/dummyapp_php-fpm:latest
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null core@51.179
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null core@51.179
https://joind.in/talk/55008 @bobbyjason
Infrastructure Next
49
https://joind.in/talk/55008 @bobbyjason
Terraform Build Infrastructure - Manager1
50
resource "openstack_compute_instance_v2" "swarm_manager" {
name = "swarm_manager_0"
count = 1
#coreos-docker-alpha
image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10"
flavor_id = "7d73f524-f9a1-4e80-bedf-57216aae8038"
key_pair = "${openstack_compute_keypair_v2.test-keypair.name}"
security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"]
user_data = "${data.template_file.cloudinit.rendered}"
network {
name = "${openstack_networking_network_v2.example_network1.name}"
floating_ip = "${openstack_networking_floatingip_v2.example_floatip_manager.address}"
}
https://joind.in/talk/55008 @bobbyjason
Terraform - Cloudinit.sh
51
data "template_file" "cloudinit" {
template = "${file("cloudinit.sh")}"
vars {
application_env = "dev"
}
}
https://joind.in/talk/55008 @bobbyjason
Terraform - Cloudinit.sh
52
docker swarm init
docker swarm join-token --quiet worker > /home/core/worker-token
docker swarm join-token --quiet manager > /home/core/manager-token
docker stack deploy --compose-file /home/core/docker-compose.yml mystack > /dev/nu
https://joind.in/talk/55008 @bobbyjason
Terraform - Master X
53
resource "openstack_compute_instance_v2" "swarm_managerx" {
name = "swarm_manager_${count.index+1}"
count = 2
#coreos-docker-beta
image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10"
flavor_id = "7d73f524-f9a1-4e80-bedf-57216aae8038"
key_pair = "${openstack_compute_keypair_v2.test-keypair.name}"
security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"]
user_data = "${data.template_file.managerinit.rendered}"
network {
name = "${openstack_networking_network_v2.example_network1.name}"
}
}
https://joind.in/talk/55008 @bobbyjason
Terraform - Managerinit.sh
54
data "template_file" "managerinit" {
template = "${file("managerinit.sh")}"
vars {
swarm_manager = "${openstack_compute_instance_v2.swarm_manager.access_ip_v4}
}
}
https://joind.in/talk/55008 @bobbyjason
Terraform - ManagerInit.sh
55
# Copy Tokens from master1 => masterX
sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o U
# Copy docker-compose.yml file
sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o U
sudo docker swarm join --token $(cat /home/core/manager-token) ${swarm_manager}
https://joind.in/talk/55008 @bobbyjason
Manager Cluster Demo
56
https://joind.in/talk/55008 @bobbyjason
Adding Workers
57
resource "openstack_compute_instance_v2" "swarm_slave" {
name = "swarm_slave_${count.index}"
count = "${var.swarm_node_count}"
#coreos-docker-beta
image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10"
flavor_id = "c46be6d1-979d-4489-8ffe-e421a3c83fdd"
key_pair = "${openstack_compute_keypair_v2.test-keypair.name}"
security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"]
user_data = "${data.template_file.slaveinit.rendered}"
network {
name = "${openstack_networking_network_v2.example_network1.name}"
}
}
https://joind.in/talk/55008 @bobbyjason
Adding Workers - slaveinit.sh
58
data "template_file" "slaveinit" {
template = "${file("slaveinit.sh")}"
vars {
swarm_manager = "${openstack_compute_instance_v2.swarm_manager.access_ip_v4}"
node_count = "${var.swarm_node_count + 3}"
}
}
https://joind.in/talk/55008 @bobbyjason
Adding Workers - slaveinit.sh
59
sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null
sudo docker swarm join --token $(cat /home/core/worker-token) ${swarm_manager}
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho
## Forces redistribution across all nodes
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho
ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho
https://joind.in/talk/55008 @bobbyjason
Adding Workers - How Many?
60
variable "swarm_node_count" {
default = 1
}
variable "swarm_node_count" {
default = 5
}
https://joind.in/talk/55008 @bobbyjason
• Docker will bring up another container. Lets try.
What If A Container Dies?
61
https://joind.in/talk/55008 @bobbyjason
Final Demo + Questions
62
https://joind.in/talk/55008 @bobbyjason
• Provisioned Docker Containers
• Infrastructure as Code
• Automated Deployments for CI / CD
• Scalable Architecture
• Openstack + UKCloud
There you have it!
63
Thank you :-)
Bobby DeVeaux
@bobbyjason
https://joind.in/talk/55008

Weitere ähnliche Inhalte

Was ist angesagt?

AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultGrzegorz Adamowicz
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XJérôme Petazzoni
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Sadique Puthen
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSYevgeniy Brikman
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudIdeato
 
Cluster Lifecycle Landscape
Cluster Lifecycle LandscapeCluster Lifecycle Landscape
Cluster Lifecycle LandscapeMike Danese
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2Liang Bo
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesSreenivas Makam
 
Docker security introduction-task-2016
Docker security introduction-task-2016Docker security introduction-task-2016
Docker security introduction-task-2016Ricardo Gerardi
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with TerraformTim Berry
 
IaC and Immutable Infrastructure with Terraform, Сергей Марченко
IaC and Immutable Infrastructure with Terraform, Сергей МарченкоIaC and Immutable Infrastructure with Terraform, Сергей Марченко
IaC and Immutable Infrastructure with Terraform, Сергей МарченкоSigma Software
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriDocker, Inc.
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedDataStax Academy
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with DockerGeeta Vinnakota
 
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Docker, Inc.
 
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017Frank Munz
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and BeyondTectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and BeyondCoreOS
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chefbridgetkromhout
 

Was ist angesagt? (20)

AWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp VaultAWS DevOps - Terraform, Docker, HashiCorp Vault
AWS DevOps - Terraform, Docker, HashiCorp Vault
 
Docker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12XDocker and Containers for Development and Deployment — SCALE12X
Docker and Containers for Development and Deployment — SCALE12X
 
A Hands-on Introduction to Docker
A Hands-on Introduction to DockerA Hands-on Introduction to Docker
A Hands-on Introduction to Docker
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28Introduction openstack-meetup-nov-28
Introduction openstack-meetup-nov-28
 
An intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECSAn intro to Docker, Terraform, and Amazon ECS
An intro to Docker, Terraform, and Amazon ECS
 
Continuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in CloudContinuous Integration: SaaS vs Jenkins in Cloud
Continuous Integration: SaaS vs Jenkins in Cloud
 
Cluster Lifecycle Landscape
Cluster Lifecycle LandscapeCluster Lifecycle Landscape
Cluster Lifecycle Landscape
 
99cloud Docker Training module 2
99cloud Docker Training module 299cloud Docker Training module 2
99cloud Docker Training module 2
 
Service Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and KubernetesService Discovery using etcd, Consul and Kubernetes
Service Discovery using etcd, Consul and Kubernetes
 
Docker security introduction-task-2016
Docker security introduction-task-2016Docker security introduction-task-2016
Docker security introduction-task-2016
 
Infrastructure as Code with Terraform
Infrastructure as Code with TerraformInfrastructure as Code with Terraform
Infrastructure as Code with Terraform
 
IaC and Immutable Infrastructure with Terraform, Сергей Марченко
IaC and Immutable Infrastructure with Terraform, Сергей МарченкоIaC and Immutable Infrastructure with Terraform, Сергей Марченко
IaC and Immutable Infrastructure with Terraform, Сергей Марченко
 
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron GrattafioriThe Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
The Golden Ticket: Docker and High Security Microservices by Aaron Grattafiori
 
Cassandra and Docker Lessons Learned
Cassandra and Docker Lessons LearnedCassandra and Docker Lessons Learned
Cassandra and Docker Lessons Learned
 
Getting Started with Docker
Getting Started with DockerGetting Started with Docker
Getting Started with Docker
 
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
Orchestration? You Don't Need Orchestration. What You Want Is Choreography by...
 
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
From Docker Swarm to OCCS and Wercker: Live-hacking at Oracle CODE Mexico 2017
 
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and BeyondTectonic Summit 2016: Kubernetes 1.5 and Beyond
Tectonic Summit 2016: Kubernetes 1.5 and Beyond
 
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and ChefScaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
Scaling Next-Generation Internet TV on AWS With Docker, Packer, and Chef
 

Andere mochten auch

Get Certified in Human Resources CHRP CHRM UAE
 Get Certified in Human Resources CHRP CHRM UAE Get Certified in Human Resources CHRP CHRM UAE
Get Certified in Human Resources CHRP CHRM UAEBlue Ocean
 
Invasaocom exploits
Invasaocom exploitsInvasaocom exploits
Invasaocom exploitsNauber Gois
 
Top Six Trends to Watch For Mobile App Devlopment for 2017
Top Six Trends to Watch For Mobile App Devlopment for 2017Top Six Trends to Watch For Mobile App Devlopment for 2017
Top Six Trends to Watch For Mobile App Devlopment for 2017Excellent WebWorld Pvt. Ltd
 
Openstack Installation (ver. liberty)
Openstack Installation (ver. liberty)Openstack Installation (ver. liberty)
Openstack Installation (ver. liberty)Eggy Cheng
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Docker, Inc.
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform TrainingYevgeniy Brikman
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker, Inc.
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXNGINX, Inc.
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker, Inc.
 
Polymer properties
Polymer propertiesPolymer properties
Polymer propertiesRAHUL YADAV
 
2089 p1-in v-multimedia
2089 p1-in v-multimedia2089 p1-in v-multimedia
2089 p1-in v-multimediaSugeng Edo
 
EU: Peat – Market Report. Analysis and Forecast to 2025
EU: Peat – Market Report. Analysis and Forecast to 2025EU: Peat – Market Report. Analysis and Forecast to 2025
EU: Peat – Market Report. Analysis and Forecast to 2025IndexBox Marketing
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境謝 宗穎
 
OpenStack Tutorial
OpenStack TutorialOpenStack Tutorial
OpenStack TutorialBret Piatt
 
OpenStack Introduction
OpenStack IntroductionOpenStack Introduction
OpenStack Introductionopenstackindia
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackBoden Russell
 

Andere mochten auch (20)

Get Certified in Human Resources CHRP CHRM UAE
 Get Certified in Human Resources CHRP CHRM UAE Get Certified in Human Resources CHRP CHRM UAE
Get Certified in Human Resources CHRP CHRM UAE
 
Effective terraform
Effective terraformEffective terraform
Effective terraform
 
Invasaocom exploits
Invasaocom exploitsInvasaocom exploits
Invasaocom exploits
 
2017-03-11 01 Игорь Родионов. Docker swarm vs Kubernetes
2017-03-11 01 Игорь Родионов. Docker swarm vs Kubernetes2017-03-11 01 Игорь Родионов. Docker swarm vs Kubernetes
2017-03-11 01 Игорь Родионов. Docker swarm vs Kubernetes
 
Top Six Trends to Watch For Mobile App Devlopment for 2017
Top Six Trends to Watch For Mobile App Devlopment for 2017Top Six Trends to Watch For Mobile App Devlopment for 2017
Top Six Trends to Watch For Mobile App Devlopment for 2017
 
OpenStack Framework Introduction
OpenStack Framework IntroductionOpenStack Framework Introduction
OpenStack Framework Introduction
 
Openstack Installation (ver. liberty)
Openstack Installation (ver. liberty)Openstack Installation (ver. liberty)
Openstack Installation (ver. liberty)
 
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
Orchestrating Docker with Terraform and Consul by Mitchell Hashimoto
 
Comprehensive Terraform Training
Comprehensive Terraform TrainingComprehensive Terraform Training
Comprehensive Terraform Training
 
Docker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker SwarmDocker Online Meetup #28: Production-Ready Docker Swarm
Docker Online Meetup #28: Production-Ready Docker Swarm
 
Load Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINXLoad Balancing Apps in Docker Swarm with NGINX
Load Balancing Apps in Docker Swarm with NGINX
 
Docker Swarm 0.2.0
Docker Swarm 0.2.0Docker Swarm 0.2.0
Docker Swarm 0.2.0
 
Polymer properties
Polymer propertiesPolymer properties
Polymer properties
 
2089 p1-in v-multimedia
2089 p1-in v-multimedia2089 p1-in v-multimedia
2089 p1-in v-multimedia
 
EU: Peat – Market Report. Analysis and Forecast to 2025
EU: Peat – Market Report. Analysis and Forecast to 2025EU: Peat – Market Report. Analysis and Forecast to 2025
EU: Peat – Market Report. Analysis and Forecast to 2025
 
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
Docker summit 2015: 以 Docker Swarm 打造多主機叢集環境
 
OpenStack Tutorial
OpenStack TutorialOpenStack Tutorial
OpenStack Tutorial
 
OpenStack Introduction
OpenStack IntroductionOpenStack Introduction
OpenStack Introduction
 
KVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStackKVM and docker LXC Benchmarking with OpenStack
KVM and docker LXC Benchmarking with OpenStack
 
Openstack 101
Openstack 101Openstack 101
Openstack 101
 

Ähnlich wie Scaling Your App With Docker Swarm using Terraform, Packer on Openstack

habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker budMandi Walls
 
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Outlyer
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Mandi Walls
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2Docker, Inc.
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...Gaetano Giunta
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for RealistsOracle Developers
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realistsKarthik Gaekwad
 
2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users GroupTodd Fritz
 
Docker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixDocker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixIBM
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the Worlddamovsky
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat OverviewMandi Walls
 
Pydata 2020 containers meetup
Pydata  2020 containers meetup Pydata  2020 containers meetup
Pydata 2020 containers meetup Walid Shaari
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralovedamovsky
 
Docker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsDocker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsZohar Elkayam
 

Ähnlich wie Scaling Your App With Docker Swarm using Terraform, Packer on Openstack (20)

habitat at docker bud
habitat at docker budhabitat at docker bud
habitat at docker bud
 
Pp docker-swarm-doxlon-28th-march-2017
Pp docker-swarm-doxlon-28th-march-2017Pp docker-swarm-doxlon-28th-march-2017
Pp docker-swarm-doxlon-28th-march-2017
 
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
Building a production-ready, fully-scalable Docker Swarm using Terraform & Pa...
 
Why to docker
Why to dockerWhy to docker
Why to docker
 
Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017Habitat Workshop at Velocity London 2017
Habitat Workshop at Velocity London 2017
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
eZ Publish 5: from zero to automated deployment (and no regressions!) in one ...
 
Containers and Microservices for Realists
Containers and Microservices for RealistsContainers and Microservices for Realists
Containers and Microservices for Realists
 
Containers and microservices for realists
Containers and microservices for realistsContainers and microservices for realists
Containers and microservices for realists
 
2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group2014, April 15, Atlanta Java Users Group
2014, April 15, Atlanta Java Users Group
 
R meetup 20161011v2
R meetup 20161011v2R meetup 20161011v2
R meetup 20161011v2
 
Docker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & BluemixDocker, Cloud Foundry, Bosh & Bluemix
Docker, Cloud Foundry, Bosh & Bluemix
 
Dockerize All The Things
Dockerize All The ThingsDockerize All The Things
Dockerize All The Things
 
Dockerize the World
Dockerize the WorldDockerize the World
Dockerize the World
 
Habitat Overview
Habitat OverviewHabitat Overview
Habitat Overview
 
Pydata 2020 containers meetup
Pydata  2020 containers meetup Pydata  2020 containers meetup
Pydata 2020 containers meetup
 
Docker Kubernetes Istio
Docker Kubernetes IstioDocker Kubernetes Istio
Docker Kubernetes Istio
 
Docker for dev
Docker for devDocker for dev
Docker for dev
 
Dockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec KraloveDockerize the World - presentation from Hradec Kralove
Dockerize the World - presentation from Hradec Kralove
 
Docker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOpsDocker Concepts for Oracle/MySQL DBAs and DevOps
Docker Concepts for Oracle/MySQL DBAs and DevOps
 

Kürzlich hochgeladen

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 

Kürzlich hochgeladen (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 

Scaling Your App With Docker Swarm using Terraform, Packer on Openstack

  • 1. Scaling With Docker Swarm using Packer, Terraform & OpenStack Bobby DeVeaux - March 9th 2017 https://joind.in/talk/55008
  • 2. https://joind.in/talk/55008 @bobbyjason • Created my first website at 9 Years old in 1995 😮 • Started coding PHP in 2001 - 16 years ago • Developer, Team Leader, CTO, Director & Consultant • Been using AWS for over 5 years • Web Development, Message Queues, Automation, CI&CD • Previously worked at SkyBet & DVSA • Now a DevOps Consultant with UKCloud, Evangelising OpenStack • Contributor to Terraform • I ♥️ Docker, Terraform & Golang (or anything Hashicorp) • #twitter: @bobbyjason About Me ☁️ 2
  • 3. https://joind.in/talk/55008 @bobbyjason • I’m here to spread the awareness of UKCloud & OpenStack • I want you to use Docker Swarm • I want you to love Terraform • I want to show you how to scale an app using all the above Why Am I Here? 3
  • 5. https://joind.in/talk/55008 @bobbyjason • Docker for AWS • Docker for Azure • UKCloud offer Cloud Native Infrastructure using Openstack Why Openstack? 5
  • 6. https://joind.in/talk/55008 @bobbyjason • Who’s using Docker yet? • Who’s using Docker Swarm? • Who’s using Terraform? • Who’s using Packer? • Who’s not played with any of them, and would love to? Hands Up 6
  • 7. https://joind.in/talk/55008 @bobbyjason What Is Docker? 7 “Docker containers wrap a piece of software in a complete filesystem that contains everything needed to run: code, runtime, system tools, system libraries – anything that can be installed on a server. This guarantees that the software will always run the same, regardless of its environment.” - docker.com
  • 8. https://joind.in/talk/55008 @bobbyjason • Define multi-container setup • docker-compose.yml • beats running multiple docker run commands • can specify multiple Dockerfiles • docker-compose up .. similar to vagrant up Docker Compose 8
  • 9. https://joind.in/talk/55008 @bobbyjason docker-compose.yml 9 version: "2" services: php-fpm: image: php:7.0.8-fpm-alpine ports: - "9000:9000" nginx: image: nginx:alpine ports: - "80:80"
  • 10. https://joind.in/talk/55008 @bobbyjason • Allows tagging - useful for versioning: • docker tag myapp:latest myapp:2.0.5 • Resides locally Docker Tag 10
  • 11. https://joind.in/talk/55008 @bobbyjason • Image Repository - default for Docker • Alternatives include: • Amazon ECR • Openstack Glance • quay.io Docker Hub 11
  • 12. https://joind.in/talk/55008 @bobbyjason • Login to selected image repository • Docker HUB: $ docker login -u username -p password • Amazon: $ eval `aws ecr get-login` Docker Login 12
  • 13. https://joind.in/talk/55008 @bobbyjason • Push images & tags up to image repository • docker push myapp:2.0.5 • docker push latest Docker Push 13
  • 14. https://joind.in/talk/55008 @bobbyjason What Is Docker Swarm? 14 “Docker Swarm provides native clustering capabilities to turn a group of Docker engines into a single, virtual Docker Engine. With these pooled resources, you can scale out your application as if it were running on a single, huge computer.” - docker.com
  • 16. https://joind.in/talk/55008 @bobbyjason • Docker 1.12 & now 1.13 has Docker Swarm natively, “Swarm Mode” • Cluster management integrated with Docker Engine • Decentralized design • Declarative service model • Scaling • Desired state reconciliation • Multi-host networking • Service discovery • Load balancing • Secure by default • Rolling updates Swarm Mode? 16
  • 17. https://joind.in/talk/55008 @bobbyjason • docker swarm init —advertise-addr • Initialises the node for Swarm mode Docker Swarm Init 17
  • 18. https://joind.in/talk/55008 @bobbyjason • docker service create --env APPLICATION_ENV=dev --update- delay 10s --replicas 1 --network mynet --name php-fpm bobbydvo/ukc_php-fpm:latest • docker service create --update-delay 10s --replicas 1 -p 80:80 -- network mynet --name web bobbydvo/ukc_nginx:latest • docker service update --image bobbydvo/ukc_nginx:1.81 web Docker Service Create 18
  • 19. https://joind.in/talk/55008 @bobbyjason • docker service scale web=5 Docker Service Scale 19
  • 20. https://joind.in/talk/55008 @bobbyjason • docker stack deploy —compose-file docker-compose.yml mystack Docker Stack Deploy (1.13 only) 20 version: "3" services: web: tty: true depends_on: - php-fpm image: bobbydvo/ukc_nginx:latest ports: - "80:80" deploy: mode: replicated replicas: 2 update_config: parallelism: 1 delay: 10s failure_action: continue monitor: 60s max_failure_ratio: 0.3 php-fpm: tty: true build: ./ image: bobbydvo/dummyapp_php-fpm:latest ports: - "9000:9000" environment: - APPLICATION_ENV=prod deploy: mode: replicated replicas: 1 update_config: parallelism: 1 delay: 10s failure_action: continue monitor: 60s max_failure_ratio: 0.3
  • 21. https://joind.in/talk/55008 @bobbyjason • We’re about to embark onto the interesting stuff • Any questions? …and Pause. 21
  • 22. https://joind.in/talk/55008 @bobbyjason • Packer • Terraform • Docker Swarm • Jenkins For Release How Do We Scale on Real Infrastructure 22
  • 23. https://joind.in/talk/55008 @bobbyjason • Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions. • Infrastructure as Code: Infrastructure is described using a high-level configuration syntax. This allows a blueprint of your datacenter to be versioned and treated as you would any other code. Additionally, infrastructure can be shared and re-used. • Execution Plans: Terraform has a "planning" step where it generates an execution plan. The execution plan shows what Terraform will do when you call apply. This lets you avoid any surprises when Terraform manipulates infrastructure What Is Terraform? 23
  • 24. https://joind.in/talk/55008 @bobbyjason • Terraform plan • Will show you exactly what it’s going to do and how many resources are going to be affected • No surprises. Terraform Plan 24
  • 25. https://joind.in/talk/55008 @bobbyjason • terraform apply • Applies the changes as shown in terraform plan using it’s resource graph. It know’s which resources have dependant resources and which ones don’t • Parallelised building - using the resource graph it will make all the changes as quickly/efficiently as possible Terraform Apply 25
  • 26. https://joind.in/talk/55008 @bobbyjason • Using the .tfstate file, it is fully aware of the resources. • Terraform destroy will literally remove all the infrastructure it built for you. WARNING: There is no ctrl+z! Terraform Destroy 26
  • 27. https://joind.in/talk/55008 @bobbyjason Terraform Demo 27 provider "openstack" { } resource "openstack_networking_network_v2" "example_network2" { name = "example_network_2" admin_state_up = "true" } resource "openstack_networking_subnet_v2" "example_subnet2" { name = "example_subnet_2" network_id = "${openstack_networking_network_v2.example_network2.id}" cidr = "10.10.1.0/24" ip_version = 4 dns_nameservers = ["8.8.8.8", "8.8.4.4"] }
  • 28. https://joind.in/talk/55008 @bobbyjason • How long do your builds & deployments in travis / Jenkins take? • What’s acceptable? • ‘Quick’ is relative, and depends on your requirements. • When I say quick deployments, I’m referring to efficient deployments using Foundation Images. Who Likes Quick Deployments? 28
  • 29. https://joind.in/talk/55008 @bobbyjason • Ansible / Puppet / Chef means that lots of projects now build from the base box image, i.e. CentOS6 or Ubuntu 14.04 etc. • Do you want to be building this each build? Some of you are clever, and don’t. Some of you are clever, but didn’t consider an alternative, or didn’t know how. Maybe some of you don’t even use automated builds… • Using Packer and your provisioner of choice, you can export the artefact and store it as a Docker Container or Image in your cloud provider (Amazon AMI, OpenStack Glance, etc). Foundation Images 29
  • 30. https://joind.in/talk/55008 @bobbyjason • Tool for creating identical machine images • Supports multiple platforms • Supports many provisioners (Ansible, Chef, Puppet, Bash.. etc.) • Can export image in multiple formats AMIs for EC2, VMDK/VMX files for VMware, OVF exports for VirtualBox, etc. What Is Packer? 30
  • 31. https://joind.in/talk/55008 @bobbyjason Packer template.json 31 { "variables": { "aws_access_key": "", "aws_secret_key": "" }, "builders": [{ "type": "amazon-ebs", "access_key": "{{user `aws_access_key`}}", "secret_key": "{{user `aws_secret_key`}}", "region": "us-east-1", "source_ami": "ami-fce3c696", "instance_type": "t2.micro", "ssh_username": "ubuntu", "ami_name": "packer-example {{timestamp}}" }] }
  • 32. https://joind.in/talk/55008 @bobbyjason Ansible Provisioning 32 "provisioners": [ { "type": "shell", "inline": [ "rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-7.noarch.rpm", "yum -y update", "yum -y install ansible", "ansible --version" ] },{ "type": "ansible-local", "playbook_file": "./ansible/playbook.yml", "role_paths": [ "./ansible/roles/init", "./ansible/roles/server", "./ansible/roles/mongodb", "./ansible/roles/php7", "./ansible/roles/nginx", "./ansible/roles/supervisord", "./ansible/roles/redis" ], "group_vars": "./ansible/common/group_vars" }
  • 33. The cool bit; Putting it all together!
  • 34. https://joind.in/talk/55008 @bobbyjason Use Packer To Build CoreOS Image 34 { "_comment": "Template file pulling from CoreOS", "builders": [ { "type": "openstack", "image_name": "CoreOS-Docker-Alpha-1-13", "source_image": "8e892f81-2197-464a-9b6b-1a5045735f5d", "flavor": "c46be6d1-979d-4489-8ffe-e421a3c83fdd", "ssh_keypair_name": "ukcloudos", "ssh_private_key_file": "/Users/bobby/.ssh/ukcloudos", "use_floating_ip": true, "floating_ip_pool": "internet", "ssh_username": "core", "ssh_pty" : true } ],
  • 35. https://joind.in/talk/55008 @bobbyjason Use Packer To Build CoreOS Image 35 "provisioners": [ { "type": "shell", "inline": [ "sudo sh -c 'echo GROUP=alpha > /etc/coreos/update.conf'", "sudo systemctl restart update-engine", "sudo update_engine_client -update", "sudo sh -c 'mkdir /opt/'", "sudo sh -c 'mkdir /opt/bin'", "sudo sh -c 'curl -L https://github.com/docker/compose/releases/download/1.9.0/docke "sudo sh -c 'chmod +x /opt/bin/docker-compose'" ] },{ "type": "file", "source": "/Users/bobby/.ssh/ukcloudos", "destination": "/home/core/.ssh/key.pem" } ] }
  • 36. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - Nginx 36 FROM nginx:alpine RUN apk update && apk upgrade && apk add --update curl wget bash tree RUN mkdir -p /srv/web ADD ./conf/default.conf /etc/nginx/conf.d/default.conf ADD ./conf/fastcgi_params /etc/nginx/fastcgi_params ADD ./index.php /srv/web CMD ["nginx", "-g", "daemon off;"]
  • 37. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - Nginx 37 server { listen *:80; server_name _ localhost; root /srv/web; index index.php index.html index.htm; location / { try_files $uri $uri/ /index.php?$query_string; } location ~* .(jpg|jpeg|png|gif|ico|css|js|woff)$ { expires 365d; } location ~* .php$ { fastcgi_pass php-fpm:9000; fastcgi_index index.php; fastcgi_read_timeout 180; include fastcgi_params; } }
  • 38. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - Nginx 38 fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param REQUEST_SCHEME $scheme; fastcgi_param HTTPS $https if_not_empty; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; # PHP only, required if PHP was built with --enable-force-cgi-redirect fastcgi_param REDIRECT_STATUS 200;
  • 39. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - php-fpm 39 FROM php:7.0.8-fpm-alpine RUN apk update && apk upgrade && apk add --update curl wget bash tree autoconf gcc g++ make libffi-dev openssl-dev RUN apk add supervisor RUN pecl install xdebug && docker-php-ext-enable xdebug && docker-php-ext-install opcache RUN docker-php-ext-install pdo_mysql RUN mkdir -p /var/log/supervisor COPY ./conf/php-dev.ini /usr/local/etc/php/ COPY ./conf/php-prod.ini /usr/local/etc/php/ COPY ./conf/php-prod.ini /usr/local/etc/php/php.ini COPY ./conf/envars-development.conf /usr/local/etc/php-fpm.d COPY ./conf/supervisord.conf /etc WORKDIR /srv COPY ./index.php /srv/web/ WORKDIR /srv RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisord.conf"]
  • 40. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - php-fpm 40 <?php echo 'Welcome to your php-fpm Docker container. You should copy your application into the /srv folder and overwrite this file.'; var_dump($_SERVER); phpinfo(); [program:php-fpm] command=php-fpm --nodaemonize -c /usr/local/etc/php/php-%(ENV_APPLICATION_ENV)s.ini
  • 41. https://joind.in/talk/55008 @bobbyjason Build Basic Docker Images - docker-compose.yml 41 version: "2" services: php-fpm: build: ./php-fpm image: bobbydvo/ukc_php-fpm:latest ports: - "9000:9000" environment: - APPLICATION_ENV=dev web: build: ./nginx image: bobbydvo/ukc_nginx:latest ports: - "80:80" $ docker-compose up —build
  • 42. https://joind.in/talk/55008 @bobbyjason Build Docker Images Regularly 42 #!/bin/bash VERSION=1 CONTAINER=$1 BUILD_NUMBER=$2 if [[ $CONTAINER == 'all' ]]; then for CONTAINER in php-fpm nginx dynamodb consul; do docker build ./$CONTAINER -t bobbydvo/ukc_$CONTAINER:latest docker tag bobbydvo/ukc_$CONTAINER:latest bobbydvo/ukc_$CONTAINER:$VERSION.$BUIL done exit fi docker build ./$CONTAINER -t bobbydvo/ukc_$CONTAINER:latest docker tag bobbydvo/ukc_$CONTAINER:latest bobbydvo/ukc_$CONTAINER:$VERSION.$BUILD_NUMBER docker push bobbydvo/ukc_$CONTAINER:latest docker push bobbydvo/ukc_$CONTAINER:$VERSION.$BUILD_NUMBER
  • 43. https://joind.in/talk/55008 @bobbyjason How NOT to Build Your Jenkins Job 43 echo $BUILD_NUMBER docker -v whoami sudo docker login -u bobbydvo -p Lr6n9hrGBLNxBm sudo ./build.sh $CONTAINER $BUILD_NUMBER
  • 44. https://joind.in/talk/55008 @bobbyjason How to Build Your Jenkins Job 44 docker login -u bobbdvo -p Lr6n9hrGBLNxBm .docker/config.json: { "auths": { "https://index.docker.io/v1/": { "auth": “************************************” } }
  • 45. https://joind.in/talk/55008 @bobbyjason How to Build Your Jenkins Job 45 echo $BUILD_NUMBER docker -v whoami #sudo docker login -u bobbydvo -p Lr6n9hrGBLNxBm sudo ./build.sh $CONTAINER $BUILD_NUMBER
  • 47. https://joind.in/talk/55008 @bobbyjason Building DummyPHP Docker Image 47 FROM bobbydvo/ukc_php-fpm:latest WORKDIR /srv COPY . /srv/ WORKDIR /srv RUN composer install CMD ["/usr/bin/supervisord","-n","-c","/etc/supervisord.conf"]
  • 48. https://joind.in/talk/55008 @bobbyjason On Merge Jenkins Hook 48 set -e DUMMY_VERSION=$BUILD_VERSION NGINX_VERSION='latest' sudo docker-compose build sudo docker run -i bobbydvo/dummyapp_php-fpm /srv/vendor/bin/phpunit -c /srv/app/phpunit.xml # tag & push only if all the above succeeded (set -e) sudo docker tag bobbydvo/dummyapp_php-fpm:latest bobbydvo/dummyapp_php-fpm:$DUMMY_VERSION sudo docker push bobbydvo/dummyapp_php-fpm:$DUMMY_VERSION sudo docker push bobbydvo/dummyapp_php-fpm:latest ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null core@51.179 ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null core@51.179
  • 50. https://joind.in/talk/55008 @bobbyjason Terraform Build Infrastructure - Manager1 50 resource "openstack_compute_instance_v2" "swarm_manager" { name = "swarm_manager_0" count = 1 #coreos-docker-alpha image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10" flavor_id = "7d73f524-f9a1-4e80-bedf-57216aae8038" key_pair = "${openstack_compute_keypair_v2.test-keypair.name}" security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"] user_data = "${data.template_file.cloudinit.rendered}" network { name = "${openstack_networking_network_v2.example_network1.name}" floating_ip = "${openstack_networking_floatingip_v2.example_floatip_manager.address}" }
  • 51. https://joind.in/talk/55008 @bobbyjason Terraform - Cloudinit.sh 51 data "template_file" "cloudinit" { template = "${file("cloudinit.sh")}" vars { application_env = "dev" } }
  • 52. https://joind.in/talk/55008 @bobbyjason Terraform - Cloudinit.sh 52 docker swarm init docker swarm join-token --quiet worker > /home/core/worker-token docker swarm join-token --quiet manager > /home/core/manager-token docker stack deploy --compose-file /home/core/docker-compose.yml mystack > /dev/nu
  • 53. https://joind.in/talk/55008 @bobbyjason Terraform - Master X 53 resource "openstack_compute_instance_v2" "swarm_managerx" { name = "swarm_manager_${count.index+1}" count = 2 #coreos-docker-beta image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10" flavor_id = "7d73f524-f9a1-4e80-bedf-57216aae8038" key_pair = "${openstack_compute_keypair_v2.test-keypair.name}" security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"] user_data = "${data.template_file.managerinit.rendered}" network { name = "${openstack_networking_network_v2.example_network1.name}" } }
  • 54. https://joind.in/talk/55008 @bobbyjason Terraform - Managerinit.sh 54 data "template_file" "managerinit" { template = "${file("managerinit.sh")}" vars { swarm_manager = "${openstack_compute_instance_v2.swarm_manager.access_ip_v4} } }
  • 55. https://joind.in/talk/55008 @bobbyjason Terraform - ManagerInit.sh 55 # Copy Tokens from master1 => masterX sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o U # Copy docker-compose.yml file sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o U sudo docker swarm join --token $(cat /home/core/manager-token) ${swarm_manager}
  • 57. https://joind.in/talk/55008 @bobbyjason Adding Workers 57 resource "openstack_compute_instance_v2" "swarm_slave" { name = "swarm_slave_${count.index}" count = "${var.swarm_node_count}" #coreos-docker-beta image_id = "0fe61d2f-0f9b-4dc8-8706-b45771f86d10" flavor_id = "c46be6d1-979d-4489-8ffe-e421a3c83fdd" key_pair = "${openstack_compute_keypair_v2.test-keypair.name}" security_groups = ["${openstack_compute_secgroup_v2.example_secgroup_1.name}"] user_data = "${data.template_file.slaveinit.rendered}" network { name = "${openstack_networking_network_v2.example_network1.name}" } }
  • 58. https://joind.in/talk/55008 @bobbyjason Adding Workers - slaveinit.sh 58 data "template_file" "slaveinit" { template = "${file("slaveinit.sh")}" vars { swarm_manager = "${openstack_compute_instance_v2.swarm_manager.access_ip_v4}" node_count = "${var.swarm_node_count + 3}" } }
  • 59. https://joind.in/talk/55008 @bobbyjason Adding Workers - slaveinit.sh 59 sudo scp -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null sudo docker swarm join --token $(cat /home/core/worker-token) ${swarm_manager} ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho ## Forces redistribution across all nodes ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho ssh -o StrictHostKeyChecking=no -o NoHostAuthenticationForLocalhost=yes -o UserKnownHostsFile=/dev/null -i /ho
  • 60. https://joind.in/talk/55008 @bobbyjason Adding Workers - How Many? 60 variable "swarm_node_count" { default = 1 } variable "swarm_node_count" { default = 5 }
  • 61. https://joind.in/talk/55008 @bobbyjason • Docker will bring up another container. Lets try. What If A Container Dies? 61
  • 63. https://joind.in/talk/55008 @bobbyjason • Provisioned Docker Containers • Infrastructure as Code • Automated Deployments for CI / CD • Scalable Architecture • Openstack + UKCloud There you have it! 63
  • 64. Thank you :-) Bobby DeVeaux @bobbyjason https://joind.in/talk/55008

Hinweis der Redaktion

  1. Key takeaway: UKPS are serious about transforming government IT. UKCloud uniquely focussed on providing enabling technologies and services which enabled us to become one of the fastest growing tech companies in Europe. Today, we remain 100% focussed on UKPS and are the market leading cloud provider. We support almost 200 workloads across over 30 direct customers and over 200 partners This slide provides an at-a-glance view of UKCloud. Along the bottom are key government policies and initiatives that have enabled a fundamental transformation of how IT is delivered across UK public sector. Digital by default is a core component of Civil Service Reform and seeks to enable a digital government, where interactions with businesses and citizens happen online rather than via call centres, drop-in centres or postal services. These new digital transactions require new applications and new architectures, and hence the government’s Technology Code of Practice advocates a Cloud First policy, favouring open-source and open standards over proprietary solutions, procured via the G-Cloud framework and appropriately assured through evaluation against the Cloud Security Principles. Importantly, Social Justice features prominently under the Theresa May government and UKCloud, as a British company, employing British people, creating British innovation and paying tax in Britain, is ideally aligned with the Social Value Act. In addition, the Greening ICT initiative incentivises the use of shared and efficient services such as cloud. And the dis-aggregation policy ensures that the large, legacy IT contracts are broken down and awarded to multiple suppliers rather than a single supplier. It’s this context that drives demand for what we do and gives us a clear purpose. Along the top are key characteristics of UKCloud. We were founded in 2011, as Skyscape Cloud Services, and born to deliver genuine cloud services exclusively to UK public sector and to therefore disrupt the inefficient way government IT was being delivered. In the past 5 years, we’ve grown rapidly including a 96% year-on-year growth in our last financial year. Indeed, we’re recognised as one of the fastest growing technology companies in the whole of Europe. This growth has enabled us to rapidly expand our company and we now have over 180 employees – all focused on delivering the best cloud for UK public sector. And our focus is paying dividends as we’re the market leading IaaS provider in G-Cloud with a 34% market share, bigger then the next three providers combined. Indeed, we’ve extended our market share every month despite increasing competition. And unlike other providers in G-Cloud who have but a few UK public sector customers, we have scores of customers and almost 200 UK public sector workloads, applications or projects. The centre of the slide shows that those 200 workloads consist of over 30 direct customer contracts with the likes of DVLA, HMRC, MOJ and others, as well as solutions delivered via a growing ecosystem of over 200 partners which includes the likes of SopraSteria and Capgemini delivering Systems Integration to the likes of Kainos, Equal Experts and CACI which deliver more specialised managed services and professional services. Over time, we believe the majority of our workloads will be delivered via our partner ecosystem.
  2. We already have Docker for AWS We already have Docker for Azure UKCloud have an Openstack offering
  3. not that scary
  4. Decentralized design: Instead of handling differentiation between node roles at deployment time, the Docker Engine handles any specialization at runtime. You can deploy both kinds of nodes, managers and workers, using the Docker Engine. This means you can build an entire swarm from a single disk image. Declarative service model: Docker Engine uses a declarative approach to let you define the desired state of the various services in your application stack. For example, you might describe an application comprised of a web front end service with message queueing services and a database backend. Desired state reconciliation: The swarm manager node constantly monitors the cluster state and reconciles any differences between the actual state and your expressed desired state. For example, if you set up a service to run 10 replicas of a container, and a worker machine hosting two of those replicas crashes, the manager will create two new replicas to replace the replicas that crashed. The swarm manager assigns the new replicas to workers that are running and available. Multi-host networking: You can specify an overlay network for your services. The swarm manager automatically assigns addresses to the containers on the overlay network when it initializes or updates the application. Service discovery: Swarm manager nodes assign each service in the swarm a unique DNS name and load balances running containers. You can query every container running in the swarm through a DNS server embedded in the swarm. Load balancing: You can expose the ports for services to an external load balancer. Internally, the swarm lets you specify how to distribute service containers between nodes. Secure by default: Each node in the swarm enforces TLS mutual authentication and encryption to secure communications between itself and all other nodes. You have the option to use self-signed root certificates or certificates from a custom root CA. Rolling updates: At rollout time you can apply service updates to nodes incrementally. The swarm manager lets you control the delay between service deployment to different sets of nodes. If anything goes wrong, you can roll-back a task to a previous version of the service.
  5. - Create services docker service ls
  6. - Create services - Scale services docker service ls docker kill container docker service ls
  7. Docker stack deploy —compose-file docker-compose.yml mystic docker stack ls docker service ls docker ps
  8. We’ve covered docker compose & swarm basics, creating services and deploying stacks.. We have a great development enivronment Any questions so far?
  9. Hopefully most of you know the already… :)
  10. terraform apply
  11. 3 things: > Updating the image to use the alpha build, so we can have Docker 1.13 > Installing Docker-Compose > Copying ssh key
  12. Basic Nginx Docker Container
  13. Nginx config to process PHP via PHP-FPM
  14. Grabbing the PHP 7 docker container Installing supervisor + debug + opcache Copy 2 php.ini files. 1 for dev, 1 for prod
  15. Supervisor accepting ENV var to determine which php file to load,
  16. This will build our docker containers locally, but there’s a better way..
  17. Bash Script to wrap it up and build the containers on Jenkins Show Jenkins Show docker hub
  18. Had an email asking if I knew I’d posted my password in my blog post…
  19. Pop this file on your Jenkins server and all will be good
  20. commented it out for nostalgic purposes
  21. Parameterised build report Docker-hub
  22. Doesn’t do much other than copy that latest version of the code onto our latest foundation image No need to rebuild the PHP box, no reinstalling go OPcache or Xdebug
  23. When we commit/merge into our master branch, we want to build our new PHP dummy app container show Docker Hub Red - fail to deploy as we have not created the infrastructure yet - lets do that next
  24. Here we are building the first manager and passing in a user_data cloudinit file
  25. the cloud init sets up the swarm and saves the join tokens it also uses our docker-compose.yml file to deploy the stack
  26. For each of the other ‘secondary masters’ we use a different init file
  27. Copies the join tokens from the Primary master, and also copies the docker compose file Then joins the swarm using the token we now have 3 masters, all capable of being the Leader.
  28. terraform apply ssh docker node ls visit IP and show load balancing
  29. Copying the worker tokens scaling the nodes to the numbers of workers forcing redistribution if scaling more than 1 at a time
  30. terraform apply
  31. Committing code to our PHP App and seeing it deployed Load Balancing Killing a container Points about being Cloud Native - Database as a Service,