One of today’s biggest challenges is releasing products more frequently while reducing the negative impact on customers using the system. When not using immutable infrastructure—where all environments are exact copies of each other in the cloud—staging environments are often used to try and mirror production environments. But despite best efforts, discrepancies between environments are common, and can lead to deployment failures.
During this webinar, we’ll discuss how to use Spring Cloud and Netflix Ribbon capabilities to create sub environments, enabling you to target specific users or groups within a variety of infrastructure environments. This approach lets you gradually deploy changes to the system while reducing the negative impact on customers in production.
Speakers: Roi Ezra & Liel Chayoun, Intel
2. 2
Agenda
§ Cloud Native & CD Challenges
§ The Immune System
§ API Gateway, Netflix Ribbon & Zuul High Level
§ Demo
§ Q&A
3. 3
Cloud Native & CD Challenges
§ Microservices
• Dynamic Environment
• Complex Architecture
• Hard to Test
4. 4
Cloud Native & CD Challenges
§ Frequent releases to production
• Move fast without breaking things
• Prevention > Detection ? Not possible L
• Prevention @ Stage N === Detection @ Stage N-1
5. 5
Cloud Native & CD Challenges
§ Testing
• How do we fill databases with real data?
• What and when to mock?
§ Configuration
• Firewalls, Application Configuration, Connection Strings…
§ Work loads
§ Users
“There is no place like production”
6. 6
The Immune System
“The immune system is a host defense system comprising many
biological structures and processes within an organism that protects
against disease. To function properly, an immune system must detect a
wide variety of agents, known as pathogens, from viruses to parasitic
worms, and distinguish them from the organism's own
healthy tissue. In many species, the immune system can be
classified into subsystems, such as the innate immune system versus
the adaptive immune system, or humoral immunity versus cell-mediated
immunity
Wikipedia
“
7. 7
The Immune System
§ Tests (Unit, Integration, Contract, Smoke, E2E, Rollback …)
§ Monitoring & Alerts (Telemetry, Logs)
§ Semantic Monitoring (Application Level Monitoring)
§ Chaos Engineering
§ Several Environments & Sub Environments
10. 10
Sub Environments
§ All sub environments must have traffic all the time
§ Consistency and Standardization
§ Alerts severity should be different between environments
11. 11
When we move to the next sub environment
§ Should be automatic and based on several inputs:
• Application Level Monitoring Results
• Telemetry Data
• Log Analysis
• Pre Defined Schedule
13. 13
Netflix Ribbon
Ribbon is a Inter Process Communication (remote procedure calls) library with
built in software load balancers. The primary usage model involves REST calls
with various serialization scheme support.
14. 14
Ribbon Components
§ ServerList - can be static or dynamic
§ ServerListFilter - filters the servers returned from dynamic server list
§ Ping - running in background to ensure liveness of servers
§ Rule - a logic component to determine which server to return from a list
15. 15
Ribbon & Spring Cloud
§ Spring Auto Configuration will automatically detect your dependencies and will
configure Ribbon for you
§ Each load balancer:
• Part of an ensemble of components that work together to contact a remote server on
demand
• Has unique name
• Has it own ApplicationContext => Can have custom behavior
§ Can be used by @LoadBalanced RestTemplate or Feign
17. 17
API Gateway Pattern – High Level Architecture
Clients
APIGateway
Service
Registry Edge Services Backend Services
18. 18
API Gateway Pattern
§ Dynamic Routing
§ Encryption, Security
§ Load Balancing
§ Different Clients
§ Service Protection (e.g.: Rate Limit)
§ Smart Client for services (e.g.: Retry)
§ Enables different deployment strategies
19. 19
Zuul – Netflix API Gateway
Zuul is a gateway service that provides dynamic routing, monitoring, resiliency,
security, and more
20. 20
Netflix Zuul
§ Was used by Netflix at production scale
§ Replaced by Zuul 2 in 2016 (was open sourced this year)
§ Used by Spring Cloud Edgware release train
§ Spring Cloud Finchley uses Spring Cloud Gateway project
22. 22
Netflix Zuul & Spring Cloud
§ Spring Cloud has created an embedded Zuul proxy (@EnableZuulProxy)
§ By convention, a service with the ID "users", will receive requests from the proxy
located at /users
§ The proxy uses Ribbon to locate an instance to forward to via discovery
§ RibbonRoutingFilter is in charge to use Ribbon, Hystrix and pluggable HTTP
clients to send requests
23. 23
Some Specific Requirements
§ Not to expose all services from service discovery to all clients
• Only “Edge” services
§ Not all services runs in all data centers where the gateway runs
• Cross zone load balancing with latency consideration
§ Direct traffic to sub environment based on:
• URL, HTTP Header, User / Group
§ Weight based load balancing