![Page 1: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/1.jpg)
16
PoweringMicroservices &Sockets usingNginx andKubernetes
Lee CalcoteYogi Porla
http://calcotestudios.com/nginx16
![Page 2: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/2.jpg)
Lee Calcote
linkedin.com/in/leecalcote
@lcalcote
blog.gingergeek.com
clouds, containers, infrastructure,applications and their management
Free ebookPreorderAvailable
![Page 3: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/3.jpg)
Our AppA 1GB jar
![Page 4: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/4.jpg)
Case Studyis an IDE for game developers - created by gamedevelopment studio based inAustin (MaxPlay) - creates a real-time,collaborative gamedevelopment engine
@lcalcote
“google docsfor game
development”
![Page 5: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/5.jpg)
Vert.x
Our Bloat-a-lith
@lcalcote
EventBus Handler
Persistence Verticle
SockJS
Analytics
Analytics UI
HazelcastGridConnection
Telemetry
Telemetry Analysis
Projects, Streams,
Users, Sessions,
Tenants
Kafka Producer
Platform Client
Producer
Spark, RGCE NetworkLoad Balancer Kafka
Rendering Engines
Platform Publishing
Tool
Game Analysis
Single instance
![Page 6: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/6.jpg)
App is Reactive
Deals with sockets
Limited resources
Culture / DevOps / Cloud Maturity
Support containers and VMs
Propagation of huge data sets
@lcalcote
The Challenge
On-the-fly intelligent rendering
Distribution of content
Extremely low latency for Reactive services
Blocking vs non-blocking
On-premises telemetry collection and
analytics
![Page 7: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/7.jpg)
Shaping Up
![Page 8: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/8.jpg)
Characteristics ofMicroservices
small, autonomous services that work together.
how small is small?
independent, autonomous service
self-contained functional unit
@lcalcote
Who has a system that istoo big and that you’d
like to break down?Can a small team manage it?
More moving partsincreases complexity.
Can you make a change to aservice and deploy it by itself
without changing anything else?
![Page 9: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/9.jpg)
Faster delivery, rolling updatesHorizontal scale out on-demand;
on an individual service basis
Modular architectureEasy integration and deploymentsService isolation, resilience and fail-safe recovery
@lcalcote
Benefits of Microservices- a quick review
Democratization of language and technology choice
![Page 10: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/10.jpg)
Kubernetes & Nginx
to the Rescue
@lcalcote
![Page 11: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/11.jpg)
Our Microbloat v1
@lcalcote
Analytics UI
Authentication
Telemetry
Telemetry Analysis
Spark, R
Kafka
Rendering Engines
Platform Publishing
Tool
Game Analysis
Masteretcd
Authorization
Locking
Authorization
Projects
AuthorizationAuthorization
kube-proxy kube-proxy
SockJS
Authorization
kube-proxy
Node Node
Node
kube-api, etc.
![Page 12: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/12.jpg)
ComparingServices
(not shoes)
![Page 13: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/13.jpg)
SSL Termination
@lcalcote
Kubernetes 1.3 No
Swarm 1.12 No
Mesos+Marathon Yes
ELB Classic Yes
ELB L7 Yes
Beanstalk Yes (EC2)
IOT Yes
ECS Yes (EC2)
Lambda ?
ContainerOrchestrators
Clouds
AWS
Azure
GCP
Load-Balancer No
App Gateway Yes
Container Service ?
Cloud LB (HTTP) Yes (beta)
Cloud LB (Network) Yes (beta)
GKE No
Link
Link
Link
Link
Link
Link
Link
Link
Link
SSL Proxy
SSL Proxy
![Page 14: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/14.jpg)
Websocket Support
@lcalcote
Kubernetes 1.3 No
Swarm 1.12 No
Mesos+Marathon Yes
ELB Classic Yes
ELB L7 Yes
Beanstalk Yes
IOT Yes
ECS Yes
Lambda Yes
ContainerOrchestrators
Clouds
AWS
Azure
GCP
Load-Balancer No
App Gateway Yes
Container Service ?
Cloud LB (HTTP) No
Cloud LB (Network) Yes
GKE No
Link
Link
Link
Link
Link
Link
Link
Link
Link
Link
Link
![Page 15: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/15.jpg)
Why Nginx
Hybrid needs
On-premises and Google Cloud Platform
Consistent administration and capabilities
central load balancing and proxy platform
Support for VM and container-based technologies withminimal configuration change Deeper feature set available as services/team matures
use as an Application Delivery Controller
@lcalcote
Platform independence
![Page 16: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/16.jpg)
Microbloat v2Going deeper with Nginx & Kubernetes
Service Discovery with Nginx PlusNeed for locating service instances instantly without reconfiguring
On-the-fly Reconfiguration API
Work with etcd
As an ingress controller in Kubernetes SSL termination
Path-based rules
Multiple host names
@lcalcote
![Page 17: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/17.jpg)
@lcalcote
Common Administration
w/Nginx Plus
App
App App
![Page 18: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/18.jpg)
GSLB & Content Cachingw/Nginx Plus
@lcalcote
App
App
AppGeoDNS
USRegions
Session Persistence and Sticky Routing help inperformance of request routing and localized contentContent Caching provides faster retrieval of dataPerformance, reliability and availability
GlobalRegions
![Page 19: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/19.jpg)
A/B Testing Using Nginx
@lcalcote
Requests
App v0.1
App v0.2
90% of requests go to v0.1
10% of requests go to v0.2
![Page 20: Powering Microservices & Sockets using Nginx and Kubernetes](https://reader031.vdocuments.us/reader031/viewer/2022022203/587080f11a28ab57368b65eb/html5/thumbnails/20.jpg)
Lee Calcote
linkedin.com/in/leecalcote
@lcalcote
blog.gingergeek.com
clouds, containers, infrastructure,applications and their management
Questions?