SlideShare a Scribd company logo
#nginx #nginxplus
Load Balancing Applications with NGINX in a
CoreOS Cluster
1
Kevin Jones - Engineer, NGINX, Inc. @webopsx
Michael Pleshakov - Engineer, NGINX, Inc. @plshkv
#nginx #nginxplus2
Links
https://goo.gl/DY0QIt
#nginx #nginxplus3
• Quick Overview of Our Deployment Plan
• Quick Overview of CoreOS, etcd and fleet
• Discuss Using etcd as a Service Discovery Tool
• Discuss Using fleet as Application Deployment Scheduler
• Discuss Using NGINX as a Software Load Balancer
• Tie It All Together With…. A Live Demo!
Our Objectives… wait CoreOS party bus?!
#nginx #nginxplus4
What Exactly is Service Discovery?
https://www.nginx.com/blog/service-discovery-in-a-microservices-architecture/
• Used for tracking dynamic assigned IP addresses
and port numbers of services
• Tracking credentials, protocols, version or
environment details of services
#nginx #nginxplus5
The Sidekick Service Discovery Model
#nginx #nginxplus6
CoreOS Clustered Deployment
#nginx #nginxplus7
#nginx #nginxplus8
• Open Source Project
• Easy to Setup
• Run Services as Containers
• Stable & Reliable Update System
• Secure
Why we like CoreOS…
#nginx #nginxplus9
• Built in Cluster
Management! (fleet)
• Built in Service
Discovery Tool! (etcd)
Most Importantly…
#nginx #nginxplus10
fleet
#nginx #nginxplus11
What is fleet?
• Present your CoreOS cluster as a single init system
• Schedule deployment units across a cluster
• Deploy containers on arbitrary hosts
• Distribute services as ephemeral units across a cluster
of CoreOS machines
• Maintain set number of instances and re-schedule on
failure
• Remote configuration using fleetctl
#nginx #nginxplus12
core@core-01 ~ $ fleetctl list-machines
MACHINE IP METADATA
20f5eff1... 172.17.8.103 -
23a36596... 172.17.8.102 -
6ee835cb... 172.17.8.101 -
fd546c18... 172.17.8.104 -
Use fleetctl To Manage Your Cluster
https://coreos.com/fleet/docs/latest/using-the-client.html
#nginx #nginxplus13
core@core-01 ~/unit-files $ cat backend@.service
[Unit]
Description=Backend Service
After=docker.service
Requires=docker.service
[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill backend
ExecStartPre=-/usr/bin/docker rm backend
ExecStartPre=/usr/bin/docker pull nginx
ExecStart=/usr/bin/docker run --name backend -p 8080:80 nginxdemos/hello
ExecStop=/usr/bin/docker stop backend
[X-Fleat]
Conflicts=backend@*.service
Unit Files
https://coreos.com/fleet/docs/latest/launching-containers-fleet.html
#nginx #nginxplus14
Conflict - Tells fleet not to schedule more than one Unit on the same machine.
EnvironmentFile - Imports the CoreOS environment variables from a specified file.
ExecStart - Executes a command at the launch of the Unit.
MachineOf - Tells fleet to schedule the Unit on the the same server of the specified Unit.
BindsTo - Links the two Units so they stop at the same time.
ExecStop - Executes a command and the stop of the Unit.
After - Tells fleet to schedule deployment after the specified Unit.
Unit File Configurations Used…
#nginx #nginxplus15
#nginx #nginxplus
What is etcd?
16
• Reliable distributed key/value storage
• Written in Go
• Simple interface (HTTP+JSON)
• Secure (SSL client cert auth)
• Fast
https://github.com/coreos/etcd
#nginx #nginxplus17
core@core-01 ~/unit-files $ etcdctl ls /services/backend
/services/backend/172.17.8.104:8080
/services/backend/172.17.8.103:8080
/services/backend/172.17.8.102:8080
Use etcdctl To Manage Your Key Store
#nginx #nginxplus18
Or…. A REST API!! YAY!
core@core-01 ~/unit-files $ curl 127.0.0.1:2379/v2/keys/services/backend
{"action":"get","node":{"key":"/services/backend","dir":true,"nodes":
[{"key":"/services/backend/
172.17.8.104:8080","value":"server","expiration":"2016-02-27T22:28:24.021550
862Z","ttl":72,"modifiedIndex":4438,"createdIndex":4438},{"key":"/services/
backend/
172.17.8.103:8080","value":"server","expiration":"2016-02-27T22:28:29.225960
364Z","ttl":77,"modifiedIndex":4463,"createdIndex":4463},{"key":"/services/
backend/
172.17.8.102:8080","value":"server","expiration":"2016-02-27T22:29:12.812515
389Z","ttl":120,"modifiedIndex":4569,"createdIndex":4569}],"modifiedIndex":
1010,"createdIndex":1010}}
#nginx #nginxplus19
#nginx #nginxplus20
confd - http://www.confd.io/
Method 1: Configuration Management
confd is a lightweight configuration management tool focused on:
• keeping local configuration files up-to-date using data stored in etcd,
consul, dynamodb, redis, vault, zookeeper or env vars and processing
template resources.
• reloading applications to pick up new config file changes
#nginx #nginxplus21
Method 2: NGINX Plus API
core@core-01 ~/unit-files $ curl 127.0.0.1:8081/upstream_conf?upstream=backend
server 172.17.8.103:8080; # id=2
server 172.17.8.102:8080; # id=7
server 172.17.8.104:8080; # id=8
Dynamic Reconfiguration API (upsteam_conf) - HTTP based API to manage NGINX upstream
servers
#nginx #nginxplus22
How Can NGINX Plus Help?
Active Health Checks - Ability to perform regular expression match against the body of the
response, specific HTTP status code and specific header response
location @healthcheck {
internal;
proxy_pass http://backend;
proxy_connect_timeout 1s;
proxy_read_timeout 1s;
health_check interval=1s;
}
#nginx #nginxplus23
Well How About Open Source NGINX?
Passive Health Checks - If the response from a particular server fails with an error, NGINX will
mark this server as failed, and will try to avoid selecting this server for subsequent inbound
requests for a while.
• fail_timeout - Sets the time during which the specified number of failed attempts should
happen and still consider the server unavailable. In other words, the server is unavailable for
the interval set by fail_timeout. (default 10 seconds)
• max_fails - sets the number of failed attempts that should happen during the specified time
to still consider the server unavailable. (default 1)
#nginx #nginxplus
Live Demo!
24
#nginx #nginxplus25
https://goo.gl/DY0QIt
Thank you for coming!

More Related Content

What's hot

NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
NGINX, Inc.
 
NGINX 101 - now with more Docker
NGINX 101 - now with more DockerNGINX 101 - now with more Docker
NGINX 101 - now with more Docker
Sarah Novotny
 
Nginx
NginxNginx
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Amit Aggarwal
 
Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!
Trygve Vea
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX, Inc.
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
ymtech
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
Javan Rasokat
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
NGINX, Inc.
 
5 things you didn't know nginx could do velocity
5 things you didn't know nginx could do   velocity5 things you didn't know nginx could do   velocity
5 things you didn't know nginx could do velocity
sarahnovotny
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
Larry Cai
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
DongHyeon Kim
 
Nginx dhruba mandal
Nginx dhruba mandalNginx dhruba mandal
Nginx dhruba mandal
Dhrubaji Mandal ♛
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
Samantha Quiñones
 
KubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container SchedulingKubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container Scheduling
KubeAcademy
 
Nginx internals
Nginx internalsNginx internals
Nginx internalsliqiang xu
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web server
Md Waresul Islam
 
Nginx Deep Dive Kubernetes Ingress
Nginx Deep Dive Kubernetes IngressNginx Deep Dive Kubernetes Ingress
Nginx Deep Dive Kubernetes Ingress
Knoldus Inc.
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
Open Source Consulting
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or less
sarahnovotny
 

What's hot (20)

NGINX: High Performance Load Balancing
NGINX: High Performance Load BalancingNGINX: High Performance Load Balancing
NGINX: High Performance Load Balancing
 
NGINX 101 - now with more Docker
NGINX 101 - now with more DockerNGINX 101 - now with more Docker
NGINX 101 - now with more Docker
 
Nginx
NginxNginx
Nginx
 
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse ProxyNginx A High Performance Load Balancer, Web Server & Reverse Proxy
Nginx A High Performance Load Balancer, Web Server & Reverse Proxy
 
Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!Extending functionality in nginx, with modules!
Extending functionality in nginx, with modules!
 
NGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA BroadcastNGINX: Basics & Best Practices - EMEA Broadcast
NGINX: Basics & Best Practices - EMEA Broadcast
 
Installation Openstack Swift
Installation Openstack SwiftInstallation Openstack Swift
Installation Openstack Swift
 
OWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA TestersOWASP ZAP Workshop for QA Testers
OWASP ZAP Workshop for QA Testers
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
5 things you didn't know nginx could do velocity
5 things you didn't know nginx could do   velocity5 things you didn't know nginx could do   velocity
5 things you didn't know nginx could do velocity
 
Learn nginx in 90mins
Learn nginx in 90minsLearn nginx in 90mins
Learn nginx in 90mins
 
Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)Kubernetes internals (Kubernetes 해부하기)
Kubernetes internals (Kubernetes 해부하기)
 
Nginx dhruba mandal
Nginx dhruba mandalNginx dhruba mandal
Nginx dhruba mandal
 
Supercharging Content Delivery with Varnish
Supercharging Content Delivery with VarnishSupercharging Content Delivery with Varnish
Supercharging Content Delivery with Varnish
 
KubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container SchedulingKubeCon EU 2016: A Practical Guide to Container Scheduling
KubeCon EU 2016: A Practical Guide to Container Scheduling
 
Nginx internals
Nginx internalsNginx internals
Nginx internals
 
Introduction to NGINX web server
Introduction to NGINX web serverIntroduction to NGINX web server
Introduction to NGINX web server
 
Nginx Deep Dive Kubernetes Ingress
Nginx Deep Dive Kubernetes IngressNginx Deep Dive Kubernetes Ingress
Nginx Deep Dive Kubernetes Ingress
 
[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting[오픈소스컨설팅] Linux Network Troubleshooting
[오픈소스컨설팅] Linux Network Troubleshooting
 
under the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or lessunder the covers -- chef in 20 minutes or less
under the covers -- chef in 20 minutes or less
 

Viewers also liked

You're monitoring Kubernetes Wrong
You're monitoring Kubernetes WrongYou're monitoring Kubernetes Wrong
You're monitoring Kubernetes Wrong
Sysdig
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with Prometheus
QAware GmbH
 
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
Daniel Krook
 
Accelerating Your Web Application with NGINX
Accelerating Your Web Application with NGINXAccelerating Your Web Application with NGINX
Accelerating Your Web Application with NGINX
Kevin Jones
 
KubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical worldKubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical world
KubeAcademy
 
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
Daniel Krook
 
KubeCon EU 2016: Multi-Tenant Kubernetes
KubeCon EU 2016: Multi-Tenant KubernetesKubeCon EU 2016: Multi-Tenant Kubernetes
KubeCon EU 2016: Multi-Tenant Kubernetes
KubeAcademy
 
Cloud Native Java Microservices
Cloud Native Java MicroservicesCloud Native Java Microservices
Cloud Native Java Microservices
Kenny Bastani
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
VMware Tanzu
 
Load Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINXLoad Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINX
NGINX, Inc.
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
NGINX, Inc.
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Brian Brazil
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Amazon Web Services
 

Viewers also liked (13)

You're monitoring Kubernetes Wrong
You're monitoring Kubernetes WrongYou're monitoring Kubernetes Wrong
You're monitoring Kubernetes Wrong
 
Cloud Monitoring with Prometheus
Cloud Monitoring with PrometheusCloud Monitoring with Prometheus
Cloud Monitoring with Prometheus
 
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
Cloud Native Architectures with an Open Source, Event Driven, Serverless Plat...
 
Accelerating Your Web Application with NGINX
Accelerating Your Web Application with NGINXAccelerating Your Web Application with NGINX
Accelerating Your Web Application with NGINX
 
KubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical worldKubeCon EU 2016: Distributed containers in the physical world
KubeCon EU 2016: Distributed containers in the physical world
 
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
The Containers Ecosystem, the OpenStack Magnum Project, the Open Container In...
 
KubeCon EU 2016: Multi-Tenant Kubernetes
KubeCon EU 2016: Multi-Tenant KubernetesKubeCon EU 2016: Multi-Tenant Kubernetes
KubeCon EU 2016: Multi-Tenant Kubernetes
 
Cloud Native Java Microservices
Cloud Native Java MicroservicesCloud Native Java Microservices
Cloud Native Java Microservices
 
The Cloud Native Journey
The Cloud Native JourneyThe Cloud Native Journey
The Cloud Native Journey
 
Load Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINXLoad Balancing and Scaling with NGINX
Load Balancing and Scaling with NGINX
 
NGINX High-performance Caching
NGINX High-performance CachingNGINX High-performance Caching
NGINX High-performance Caching
 
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
Monitoring Kubernetes with Prometheus (Kubernetes Ireland, 2016)
 
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel AvivElastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
Elastic Load Balancing Deep Dive and Best Practices - Pop-up Loft Tel Aviv
 

Similar to Load Balancing Applications with NGINX in a CoreOS Cluster

NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
NGINX, Inc.
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEA
NGINX, Inc.
 
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin JonesITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
Ortus Solutions, Corp
 
What's new in NGINX Plus R19
What's new in NGINX Plus R19What's new in NGINX Plus R19
What's new in NGINX Plus R19
NGINX, Inc.
 
Running php on nginx
Running php on nginxRunning php on nginx
Running php on nginx
Harald Zeitlhofer
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
Ben Hall
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
Kevin Jones
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
NGINX, Inc.
 
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
Dragos Dascalita Haut
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
Fastly
 
ITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content CachingITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content Caching
Ortus Solutions, Corp
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAkshaya Mahapatra
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
QAware GmbH
 
Kubernetes basics and hands on exercise
Kubernetes basics and hands on exerciseKubernetes basics and hands on exercise
Kubernetes basics and hands on exercise
Cloud Technology Experts
 
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEANGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
NGINX, Inc.
 
NGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best PracticesNGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best Practices
NGINX, Inc.
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
François-Xavier Bonnet
 
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
Sreenivas Makam
 
What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?
NGINX, Inc.
 
DPDK Summit 2015 - Intel - Keith Wiles
DPDK Summit 2015 - Intel - Keith WilesDPDK Summit 2015 - Intel - Keith Wiles
DPDK Summit 2015 - Intel - Keith Wiles
Jim St. Leger
 

Similar to Load Balancing Applications with NGINX in a CoreOS Cluster (20)

NGINX Installation and Tuning
NGINX Installation and TuningNGINX Installation and Tuning
NGINX Installation and Tuning
 
NGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEANGINX ADC: Basics and Best Practices – EMEA
NGINX ADC: Basics and Best Practices – EMEA
 
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin JonesITB2019 NGINX Overview and Technical Aspects - Kevin Jones
ITB2019 NGINX Overview and Technical Aspects - Kevin Jones
 
What's new in NGINX Plus R19
What's new in NGINX Plus R19What's new in NGINX Plus R19
What's new in NGINX Plus R19
 
Running php on nginx
Running php on nginxRunning php on nginx
Running php on nginx
 
Deploying windows containers with kubernetes
Deploying windows containers with kubernetesDeploying windows containers with kubernetes
Deploying windows containers with kubernetes
 
High Availability Content Caching with NGINX
High Availability Content Caching with NGINXHigh Availability Content Caching with NGINX
High Availability Content Caching with NGINX
 
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
Session: A Reference Architecture for Running Modern APIs with NGINX Unit and...
 
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
NGINX.conf 2016 - Fail in order to succeed ! Designing Microservices for fail...
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
ITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content CachingITB2017 - Nginx Effective High Availability Content Caching
ITB2017 - Nginx Effective High Availability Content Caching
 
Automating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps ApproachAutomating Software Development Life Cycle - A DevOps Approach
Automating Software Development Life Cycle - A DevOps Approach
 
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
Kubernetes One-Click Deployment: Hands-on Workshop (Mainz)
 
Kubernetes basics and hands on exercise
Kubernetes basics and hands on exerciseKubernetes basics and hands on exercise
Kubernetes basics and hands on exercise
 
NGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEANGINX: Basics and Best Practices EMEA
NGINX: Basics and Best Practices EMEA
 
NGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best PracticesNGINX ADC: Basics and Best Practices
NGINX ADC: Basics and Best Practices
 
ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013ESIGate dev meeting #4 21-11-2013
ESIGate dev meeting #4 21-11-2013
 
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
 
What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?What’s New in NGINX Plus R16?
What’s New in NGINX Plus R16?
 
DPDK Summit 2015 - Intel - Keith Wiles
DPDK Summit 2015 - Intel - Keith WilesDPDK Summit 2015 - Intel - Keith Wiles
DPDK Summit 2015 - Intel - Keith Wiles
 

Recently uploaded

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
Donna Lenk
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
Philip Schwarz
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Neo4j
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 

Recently uploaded (20)

First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"Navigating the Metaverse: A Journey into Virtual Evolution"
Navigating the Metaverse: A Journey into Virtual Evolution"
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
A Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of PassageA Sighting of filterA in Typelevel Rite of Passage
A Sighting of filterA in Typelevel Rite of Passage
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Prosigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology SolutionsProsigns: Transforming Business with Tailored Technology Solutions
Prosigns: Transforming Business with Tailored Technology Solutions
 
Atelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissancesAtelier - Innover avec l’IA Générative et les graphes de connaissances
Atelier - Innover avec l’IA Générative et les graphes de connaissances
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 

Load Balancing Applications with NGINX in a CoreOS Cluster

  • 1. #nginx #nginxplus Load Balancing Applications with NGINX in a CoreOS Cluster 1 Kevin Jones - Engineer, NGINX, Inc. @webopsx Michael Pleshakov - Engineer, NGINX, Inc. @plshkv
  • 3. #nginx #nginxplus3 • Quick Overview of Our Deployment Plan • Quick Overview of CoreOS, etcd and fleet • Discuss Using etcd as a Service Discovery Tool • Discuss Using fleet as Application Deployment Scheduler • Discuss Using NGINX as a Software Load Balancer • Tie It All Together With…. A Live Demo! Our Objectives… wait CoreOS party bus?!
  • 4. #nginx #nginxplus4 What Exactly is Service Discovery? https://www.nginx.com/blog/service-discovery-in-a-microservices-architecture/ • Used for tracking dynamic assigned IP addresses and port numbers of services • Tracking credentials, protocols, version or environment details of services
  • 5. #nginx #nginxplus5 The Sidekick Service Discovery Model
  • 8. #nginx #nginxplus8 • Open Source Project • Easy to Setup • Run Services as Containers • Stable & Reliable Update System • Secure Why we like CoreOS…
  • 9. #nginx #nginxplus9 • Built in Cluster Management! (fleet) • Built in Service Discovery Tool! (etcd) Most Importantly…
  • 11. #nginx #nginxplus11 What is fleet? • Present your CoreOS cluster as a single init system • Schedule deployment units across a cluster • Deploy containers on arbitrary hosts • Distribute services as ephemeral units across a cluster of CoreOS machines • Maintain set number of instances and re-schedule on failure • Remote configuration using fleetctl
  • 12. #nginx #nginxplus12 core@core-01 ~ $ fleetctl list-machines MACHINE IP METADATA 20f5eff1... 172.17.8.103 - 23a36596... 172.17.8.102 - 6ee835cb... 172.17.8.101 - fd546c18... 172.17.8.104 - Use fleetctl To Manage Your Cluster https://coreos.com/fleet/docs/latest/using-the-client.html
  • 13. #nginx #nginxplus13 core@core-01 ~/unit-files $ cat backend@.service [Unit] Description=Backend Service After=docker.service Requires=docker.service [Service] TimeoutStartSec=0 ExecStartPre=-/usr/bin/docker kill backend ExecStartPre=-/usr/bin/docker rm backend ExecStartPre=/usr/bin/docker pull nginx ExecStart=/usr/bin/docker run --name backend -p 8080:80 nginxdemos/hello ExecStop=/usr/bin/docker stop backend [X-Fleat] Conflicts=backend@*.service Unit Files https://coreos.com/fleet/docs/latest/launching-containers-fleet.html
  • 14. #nginx #nginxplus14 Conflict - Tells fleet not to schedule more than one Unit on the same machine. EnvironmentFile - Imports the CoreOS environment variables from a specified file. ExecStart - Executes a command at the launch of the Unit. MachineOf - Tells fleet to schedule the Unit on the the same server of the specified Unit. BindsTo - Links the two Units so they stop at the same time. ExecStop - Executes a command and the stop of the Unit. After - Tells fleet to schedule deployment after the specified Unit. Unit File Configurations Used…
  • 16. #nginx #nginxplus What is etcd? 16 • Reliable distributed key/value storage • Written in Go • Simple interface (HTTP+JSON) • Secure (SSL client cert auth) • Fast https://github.com/coreos/etcd
  • 17. #nginx #nginxplus17 core@core-01 ~/unit-files $ etcdctl ls /services/backend /services/backend/172.17.8.104:8080 /services/backend/172.17.8.103:8080 /services/backend/172.17.8.102:8080 Use etcdctl To Manage Your Key Store
  • 18. #nginx #nginxplus18 Or…. A REST API!! YAY! core@core-01 ~/unit-files $ curl 127.0.0.1:2379/v2/keys/services/backend {"action":"get","node":{"key":"/services/backend","dir":true,"nodes": [{"key":"/services/backend/ 172.17.8.104:8080","value":"server","expiration":"2016-02-27T22:28:24.021550 862Z","ttl":72,"modifiedIndex":4438,"createdIndex":4438},{"key":"/services/ backend/ 172.17.8.103:8080","value":"server","expiration":"2016-02-27T22:28:29.225960 364Z","ttl":77,"modifiedIndex":4463,"createdIndex":4463},{"key":"/services/ backend/ 172.17.8.102:8080","value":"server","expiration":"2016-02-27T22:29:12.812515 389Z","ttl":120,"modifiedIndex":4569,"createdIndex":4569}],"modifiedIndex": 1010,"createdIndex":1010}}
  • 20. #nginx #nginxplus20 confd - http://www.confd.io/ Method 1: Configuration Management confd is a lightweight configuration management tool focused on: • keeping local configuration files up-to-date using data stored in etcd, consul, dynamodb, redis, vault, zookeeper or env vars and processing template resources. • reloading applications to pick up new config file changes
  • 21. #nginx #nginxplus21 Method 2: NGINX Plus API core@core-01 ~/unit-files $ curl 127.0.0.1:8081/upstream_conf?upstream=backend server 172.17.8.103:8080; # id=2 server 172.17.8.102:8080; # id=7 server 172.17.8.104:8080; # id=8 Dynamic Reconfiguration API (upsteam_conf) - HTTP based API to manage NGINX upstream servers
  • 22. #nginx #nginxplus22 How Can NGINX Plus Help? Active Health Checks - Ability to perform regular expression match against the body of the response, specific HTTP status code and specific header response location @healthcheck { internal; proxy_pass http://backend; proxy_connect_timeout 1s; proxy_read_timeout 1s; health_check interval=1s; }
  • 23. #nginx #nginxplus23 Well How About Open Source NGINX? Passive Health Checks - If the response from a particular server fails with an error, NGINX will mark this server as failed, and will try to avoid selecting this server for subsequent inbound requests for a while. • fail_timeout - Sets the time during which the specified number of failed attempts should happen and still consider the server unavailable. In other words, the server is unavailable for the interval set by fail_timeout. (default 10 seconds) • max_fails - sets the number of failed attempts that should happen during the specified time to still consider the server unavailable. (default 1)