slideshare for interconnect

35
Interconnecting containers at scale with NGINX .

Upload: lekien

Post on 13-Feb-2017

225 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: slideshare for interconnect

Interconnecting containers at scale with NGINX.

Page 2: slideshare for interconnect

@sarahnovotny#dockercon

Page 3: slideshare for interconnect

Building a great applicationis only half the battle,

delivering the application is the other half.

Page 4: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Microservices

Page 5: slideshare for interconnect

1)

The good things

Page 6: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Microservices + containers

Page 7: slideshare for interconnect

The Microservices Architecture:Enables continuous delivery,

rapid deployment and elasticity

Page 8: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

The Microservices Architecture:To scale, you can scale each service independently

Page 9: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

The Microservices Architecture:Services can be written in different languages using different frameworks

Page 10: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Making Changes:

Each service can be changed, tested and built independently

Page 11: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Making Changes:

Release cycles can be dramatically shortened

Page 12: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Deploying Microservices:

To unlock the potential of microservices you must embrace containers, cloud and DevOps

Page 13: slideshare for interconnect

2)

The bad things

Page 14: slideshare for interconnect

The Microservices Architecture:Services can be written in different languages using different frameworks

Page 15: slideshare for interconnect

Making Changes:

Release cycles can be dramatically shortened

Page 16: slideshare for interconnect

Complexity:To unlock the potential of microservices you must embrace containers, cloud and DevOps

Page 17: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Here be dragons

Page 18: slideshare for interconnect

3)

How can NGINX help?

Page 19: slideshare for interconnect

NGINX as your stevedores:Acts as a HTTP router inspecting requests and deciding how each one should be satisfied

Page 20: slideshare for interconnect

ste·ve·doreˈstēvəˌdôr/nounnoun: stevedore; plural noun: stevedoresa person employed, or a contractor engaged, at a dock to load and unload cargo from ships.

Page 21: slideshare for interconnect

The Microservices Architecture

Page 22: slideshare for interconnect

The Microservices Architecture

Page 23: slideshare for interconnect

Docker orchestration- many options vying- (and then there’s service

discovery)

Page 24: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

docker-compose

Page 25: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

This .yml file builds –

Consul for service discovery

Registrator

tutum/hello-world

Google/golang-hello

& NGINX Plus

Page 26: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

$ sarah@ubuntu:~/service-discovery$ more docker-compose.ymlnginx: build: ./nginxplus links: - consul ports: - "9050:80" - "8080:8080"

consul: command: -server -bootstrap -advertise 10.0.2.15 image: progrium/consul:latest ports: - "8300:8300" - "8400:8400" - "8500:8500" - "8600:53/udp”

Page 27: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

registrator: command: consul://consul:8500 image: progrium/registrator:latest links: - consul volumes: - "/var/run/docker.sock:/tmp/docker.sock"

service1: image: tutum/hello-world:latest environment: SERVICE_80_NAME: http SERVICE_NAME: service1 SERVICE_TAGS: production ports: - "80"

Page 28: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

service2: image: google/golang-hello:latest environment: SERVICE_80_NAME: http SERVICE_NAME: service2 SERVICE_TAGS: production ports: - "8080"sarah@ubuntu:~/service-discovery$

Page 29: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

sarah@ubuntu:~/service-discovery$ docker-compose buildconsul uses an image, skippingBuilding nginx...Step 0 : FROM ubuntu:14.04 ---> 6d4946999d4fStep 1 : MAINTAINER NGINX Docker Maintainers "[email protected]" ---> Using cache ---> 339d0f20dc6e

…sarah@ubuntu:~/service-discovery$ docker-compose up -dRecreating servicediscovery_consul_1...Recreating servicediscovery_nginx_1...Recreating servicediscovery_registrator_1...Recreating servicediscovery_service1_6...Recreating servicediscovery_service2_1...sarah@ubuntu:~/service-discovery$

Page 30: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Page 31: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

sarah@ubuntu:~/service-discovery/nginxplus$ more nginx.conf{{range services}} {{$name := .Name}} {{range $tag, $service := service .Name | byTag}} {{if eq $tag "production"}}upstream {{$name}} { zone upstream-{{$name}} 64k; least_conn; {{range $service}}server {{.Address}}:{{.Port}} max_fails=3 fail_timeout=60 weight=1 slow_start=60; {{else}}server 127.0.0.1:65535; # force a 502{{end}}} {{end}} {{end}} {{end}}

<snip>

Page 32: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

sarah@ubuntu:~/service-discovery$ docker-compose scale service1=5Creating servicediscovery_service1_2...Creating servicediscovery_service1_3...Creating servicediscovery_service1_4...Creating servicediscovery_service1_5...Starting servicediscovery_service1_2...Starting servicediscovery_service1_3...Starting servicediscovery_service1_4...Starting servicediscovery_service1_5...

Page 33: slideshare for interconnect
Page 34: slideshare for interconnect

MORE INFORMATION AT NGINX.COM

Visit our table to go through this demo and request a developer license for NGINX Plus

Page 35: slideshare for interconnect

Thank you@sarahnovotny

#dockercon