SlideShare uma empresa Scribd logo
1 de 67
Microservices with Spring Cloud
Microservices
with Spring Cloud and Kubernetes
and Istio and ...
2019.03
About me
{
“name” : “Jupil Hwang”,
“role”: “Senior Platform Architecture”,
“company”: “Pivotal”,
“email”: “jupil.hwang@gmail.com”,
”twitter”: “jupil_hwang”,
“github”: “https://github.com/jupilhwang”
}
Pivotal ?
Spring Framework
Pivotal Cloud Foundry
Pivotal
Pivotal invests heavily in open-source software
“Pivotal is currently contributing as much software
to open source projects as IBM.”
Source: https://redmonk.com/jgovernor/2017/10/25/some-thoughts-on-the-top-contributors-to-github-2017/
vSphere Openstack AWS
Google
Cloud
Azure &
Azure Stack
Shared Services
Shared Security
Shared Networking
Logging & Metrics / Services Brokers / API Management
Credhub / UAA / Single Sign On
VMWare NSX
Embedded Operating System (Windows / Linux)
Application Code & Frameworks
Buildpacks / Spring Boot / Spring Cloud / Steeltoe
PAS
Pivotal Application
Service
PKS
Pivotal Container
Service
PFS
Pivotal Function
Service
Pivotal Services
Marketplace
Pivotal and
Partner Products
Any App
Every Cloud
One Platform
Concourse
Pivotal Cloud Foundry
Microservices ?
Cloud Native Application
What does cloud native mean?
● Designing the solution as a collection of
microservices that follow the recommendations
in the free ebook Beyond the 12 Factor App:
Exploring the DNA of Highly Scalable, Resilient
Cloud Applications
● Leveraging a container platform to enable
continuous delivery and continuous
deployment
● Eliminating tickets and working in a fully
automated way leveraging DevOps best
practices
● Increasing speed, security, scalability,
scalability, and saving by optimizing the right
mix of DevOps / Microservices / Continuous
Delivery and containers
I. One Codebase, One App*
II. Dependency Management*
V. Build, Release, Run*
III. Configuration*
XI. Logs*
IX. Disposability
IV. Backing Services
X. Environmental Parity*
XII. Administrative Process
VII. Port Binding*
VI. Process
VIII. Concurrency
VALUE & APPROACH
= Time to Market; find the seams; use good SDLC practices
= Dev Productivity; standardize & remove surprises
= Release Mgmt Hygiene; use CI/CD automation /w PCF
= Release Mgmt Hygiene; move to environment vars
= Real-Time Metrics; use PCF features; stdout / stderr
= Auto-Scale; move slow processes to backing services
= Resiliency / Agility; use circuit breaker; loose binding
= Reliability; use well architected PCF, get parity
= Reliability; move to backing service(s), expose as REST
= Ops Efficiency; use PCF features like routing, scaling, etc.
= Cloud Compatibility; move state to backing service(s)
= Auto-Scale, ZDD; design for cloud, use PCF features
Cloud Native Implementation
Looking Beyond 12-Factors
▪ 12-Factor Published in 2012
- In context of Heroku
- A LOT has changed
▪ New Guidance
- Emphasis on Enterprise Java
- 3 new “factors”
• API First
• Telemetry – APM, Logs, Domain-Specific
• Authn / Authz – Security First Design
▪ Must Read for Application Architects
Microservices ?
“ Loosely coupled service oriented
architecture with bounded contexts"
- Adrian Cokcroft -
If every service has to be updated in concert, it’s not loosely coupled!
If you have to know about surrounding services you don’t have a bounded context.
The structure of a microservice
http://chrisrichardson.net/post/microservices/general/2019/02/16/whats-a-service-part-1.html
Disruption
through
Product
Disruption
through
Product
Disruption
through
Product
Disruption
through
Experience
Disruption
through
Business Model
Disruption
through
Business Model
Disruption
through
Experience
Disruption
through
Product
Disruption
through
Experience
Disruption
through
Experience
Disruption
through
Product
Disruption
through
Business Model
Maintaining leadership
position through
Business Model
Maintaining leadership
position through
Business Model
Maintaining leadership
position through
Business Model
Maintaining leadership
position through
Experience
Maintaining leadership
position through
Product
Maintaining leadership
position through
Product
Maintaining leadership
position through
Product
Maintaining leadership
position through
Experience
Maintaining leadership
position through
Business Model
Maintaining leadership
position through
Business Model
Maintaining leadership
position through
Experience
Maintaining leadership
position through
Product
monolithic vs microservices architecture
Business Logic
User Interface
Data Access
Layer
User Interface
Microservice
Microservice Microservice Microservice Microservice
Microservices!!!
Microservice.io
A pattern language for
microservices
by 강인호
https://www.slideshare.net/Inho
Kang2/microservice-pattern-
launguage
Microservices 의 장단점
Pros Cons
Strong Modular Boundaries Distributed Systems
Independent Deployment Eventual Consistency
Technology Diversity Operational Complexity
분산시스템의 허점
● The network is reliable
● Latency is zero
● Bandwidth is infinite
● The network is secure
● Topology doesn’t change
● There is one administrator
● Transport cost is zero
● The network is homogeneous
Spring Boot
Build Anything
Spring Cloud
Coordinate Anything
Spring Cloud Data Flow
Connect Anything
Spring by Pivotal: The Standard for Cloud Native Java
Code Clarity | Lower Complexity | Less Tech Debt | Focus on Business Logic | Better Test Coverage | Faster Code Completion
Spring Boot
Spring Boot
● Create stand-alone Spring applications
● Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files)
● Provide opinionated 'starter' dependencies to simplify your build configuration
● Automatically configure Spring and 3rd party libraries whenever possible
● Provide production-ready features such as metrics, health checks and
externalized configuration
● Absolutely no code generation and no requirement for XML configuration
Make a Web Application in 144 Char.
Simple Spring Boot Application
Netflix OSS
● Netflix needed to be faster to win / disrupt
● Pioneer and vocal proponent of microservices –
the key to their speed and success
● Netflix OSS supplies parts, but it’s not a solution
Netflix OSS
Ribbon Archaius
Eureka
FeignHystrix
Turbine
Zuul
ClientServer
Spring Cloud
+ =
Spring Cloud
✓ Service registration and discovery
✓ API gateway
✓ Client-side load balancing
✓ Git-backed configuration store
✓ Circuit breakers
✓ OAuth 2.0 security support
✓ Distributed tracing
✓ Event-driven microservices
✓ Orchestrated data pipelines
Netflix OSS and Spring Boot 
https://medium.com/netflix-techblog/netflix-oss-and-spring-boot-coming-full-circle-4855947713a0
Circuit Breaker
Dashboard for PCF
Visualizes a stream of Turbine health
and metric data from the circuit
breakers inside your microservices or
applications.
Service Registry for
PCF
Provides an implementation of the
NetflixOSS Eureka Service Discovery
pattern, as a service.
Config Server for PCF
Delivers a dynamic, central
configuration service to manage an
application’s external properties
across all environments.
Build & Operate Microservices with Spring Cloud
Services
Spring Cloud Config Server
@SpringBootApplication
@EnableConfigServer
public class ConfigServer {
public static void main(String[] args) {
SpringApplication.run(ConfigServer.class, args);
}
}
spring:
cloud:
config:
server:
git:
uri: http://github.com/<repo>/<my-repo>.git
Greeting: Bonjour
application.yml http://github.com/<repo>/<my-repo>/blob/master/demo.yml
Spring Cloud Config Client
@Configuration
@EnableAutoConfiguration
@RestController
public class GreetingService {
@AutoWired Greeter greeter;
@RequestMapping("/")
public String home() {
return String.format("%s World",
greeter.greeting);
}
@Component
@RefreshScope
public class Greeter {
@Value("${greeting}")
String name = "World";
}
}
spring:
application
name: demo
cloud:
config:
uri: http://my-config-server.com
bootstrap.yml
Refreshing Configuration Context
1. Update Git Repository
2. Send a POST refresh request to the application(s) to refresh
eg. curl –X POST http://my-app.com/refresh
@Component
@RefreshScope
public class Greeter {
@Value("${greeting}")
String name = "World";
}
Client Service Discovery
@SpringBootApplication
@EnableDiscoveryClient
public class MyClientApp{
public static void main(String[] args) {
SpringApplication.run(MyClientApp.class, args);
}
}
public Portfolio accountLookup(String acctId) {
Portfolio p = restTemplate.getForObject(
“http://portfolio-
service/portfolio/{accId}”,
Portfolio.class
acctId);
return p;
}
Spring Cloud Services: Service Registry
Automated deployment of server
component
Security-optimized Eureka service
instance using Oauth2
Bind into CF client application(s)
Cloud Connectors for auto-
reconfiguration
Microservice API Gateways
Netflix uses Zuul and Ribbon for
● Authentication
● Stress Testing
● Canary Testing
● Dynamic Routing
● Service Migration
● Load Shedding
● Security
● Static Response handling
● Active/Active
management
How?
public Portfolio accountLookup(String[acctId) {
Portfolio p = restTemplate.getForObject(
“http://portfolio-
service/portfolio/{accId}”,
Portfolio.class
acctId);
return p;
}
MAGIC!!
@Autowired LoadBalancerClient loadBalancer;
public void doStuff() {
ServiceInstance instance = loadBalancer.choose("stores");
URI storesUri = URI.create(String.format("http://%s:%s",
instance.getHost(), instance.getPort()));
// Do some stuff…
}
How?
API proxy will be created
at /myusers
Ribbon/Zuul creates load
balancer for Eureka
service “users_service”
All requests are
executed in a Hystrix
command
@SpringBootApplication
@EnableZuulProxy
@EnableDiscoveryClient
public class MyAPIGateway {
public static void main(String[] args) {
SpringApplication.run(MyAPIGateway.class, args);
}
}
MAGIC!!
zuul:
routes:
users:
path: /myusers/**
serviceId: users_service
Circuit Breaker Pattern
Circuit Breaker Pattern Implementation
@SpringBootApplication
@EnableDiscoveryClient
@EnableCircuitBreaker
public class MyClientApp{
public static void main(String[] args) {
SpringApplication.run(MyClientApp.class, args);
}
}
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
pom.xml
@Service
public class FortuneService {
@HystrixCommand(fallbackMethod = "defaultFortune",
commandProperties = {
@HystrixProperty(name="execution.isolation.thread.timeoutInMilliseconds”, value="500")
})
public String getFortune() {
return restTemplate.getForObject("http://fortune-service", String.class);
}
public String defaultFortune() {
logger.debug("Default fortune used.");
return "This fortune is no good. Try another.";
}
}
@HystrixCommand
Hystrix Dashboard
Hystrix Dashboard
Automated deployment dashboard
+ Turbine + RabbitMQ
Bind service into app
Include starter dependency in app:
<dependency>
<groupId>io.pivotal.spring.cloud</groupId>
<artifactId>spring-cloud-services-starter-
circuit-breaker</artifactId>
</dependency>
Spring Cloud Services
Config Server
Circuit Breaker
Service Registry
Pivotal has bundled a number of these
OSS projects into Spring Cloud Services
for PCF
Spring Cloud
https://spring.io/
Ribbon
Hystrix
Metrics
Tracer
Ribbon
Hystrix
Metrics
Tracer
Ribbon
Hystrix
Metrics
Tracer
But
● Multiple stack
● Multiple frameworks
● Polyglot (Multiple Languages)
● Legacy Applications
comparison of platforms
https://en.wikipedia.org/wiki/Microservices
Reduce Complexity with Kubernetes and Istio
Config Server
Service Registry
Circuit Breaker
Kubernetes Configmap
Kubernetes Services / CoreDNS, Labels
Service Mesh
A Service Mesh for Microservices
https://istio.io/docs/concepts/what-is-istio/
• Service to Service Communication
(Service Discovery)
• Routing Rules
(A/B testing, Mirror)
• Retries
• Circuit Breaker
• Performance Monitoring
• Tracing
Circuit Breaker: istio
kind: DestinationRule
apiVersion: networking.istio.io/v1alpha3
metadata:
name: foo
spec:
host: foo
trafficPolicy:
connectionPool:
http: {http1MaxPendingRequests: 1, maxRequestsPerConnection: 1}
tcp: {maxConnections: 1}
outlierDetection:
baseEjectionTime: 100.000s
consecutiveErrors: 1
interval: 1.000s
maxEjectionPercent: 100
Tracing: Istio
Microservices with Kubernetes and Istio
- Reducing Microservices Architecture Complexity
https://spring.io/
Proxy - Sidecar
Ingress
Gateway
Istio Control Plane
Kubernetes
spring-cloud-kubernetes
● https://github.com/spring-cloud/spring-cloud-kubernetes/tree/master/spring-
cloud-kubernetes-examples
Istio or Spring Cloud ??
Applications – Spring Cloud
○ Fallbacks
○ Tracing Propagation
○ Security
Polyglot environments – Istio
Istio GA in July 2018.
Istio Control Plane Performance Issues
Storage NetworkingCompute
Dev / Apps
App User
IT / Ops
> kubectl
Kubernetes Dashboard
Load Balancing / Routing
Container Image
Registry
App Monitoring
App Logging
OS Updates
OS Images
K8S Updates
K8S Images
Log & Monitor
Recover & Restart
Backup & Restore
External
Data Services
Cluster
Provisioning
Provision & Scale
Command
Line / API
Management
GUI
Monitoring
GUI
...Kubernetes alone is not enough for enterprises
Five Domains of a Cloud Native Platform
Don’t Forget About
Learning
HA Design
Hardening
Installation & Integration
Platform Continuous Delivery
DR/BC/Backup
Production Support
Auditing
Monitoring
Logging
Scaling
Upgrades & Lifecycle
Product Development & Planning...Across All of This
Comparing Spring Boot app deployment processes
Spring Boot app deployed to K8s
- Compile Spring Boot app
- Choose base Docker image
- Author Dockerfile w/ app entrypoint
- Build Docker image
- Upload image to container registry
- Decide on JVM tuning parameters to
use when starting pods
- Create kubernetes deployment config
- Use CI/CD tool or kubectl to apply
kubernetes configuration and deploy
pods
- Create service to expose pod for users
- Profit!
Spring Boot app deployed to PAS
- Compile Spring Boot app
- Create manifest.yml to describe the app
- Use CI/CD tool or cf push to deploy
- Profit!
Standardized container images
Governance enforced by the platform
Snowflake container images
Governance enforced by corporate process
69
Magic !!!
Everything
you need to
transform Process &
Culture
Build for
change
Tools
Continuously
Improve
Platform
Any App, Every Cloud,
One Platform
PCF 2.0
Tracker / Spring /
Concourse
Pivotal Labs
Data / AI
Apps
Culture, tools, and platform
Q&A

Mais conteúdo relacionado

Mais procurados

PaaS application in Heroku
PaaS application in HerokuPaaS application in Heroku
PaaS application in Heroku
Dileepa Jayakody
 

Mais procurados (20)

The Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring CloudThe Beginner’s Guide To Spring Cloud
The Beginner’s Guide To Spring Cloud
 
Netflix MSA and Pivotal
Netflix MSA and PivotalNetflix MSA and Pivotal
Netflix MSA and Pivotal
 
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
Real-time Analysis of Data Processing Pipelines with Spring Cloud Data Flow a...
 
Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...
Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...
Deploying Applications Using Pivotal Cloud Foundry - Lars Rosenquist & David ...
 
Gdsc muk - innocent
Gdsc   muk - innocentGdsc   muk - innocent
Gdsc muk - innocent
 
Faster, more Secure Application Modernization and Replatforming with PKS - Ku...
Faster, more Secure Application Modernization and Replatforming with PKS - Ku...Faster, more Secure Application Modernization and Replatforming with PKS - Ku...
Faster, more Secure Application Modernization and Replatforming with PKS - Ku...
 
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
KubeCon China 2019 - Building Apps with Containers, Functions and Managed Ser...
 
Spring Boot apps in Kubernetes
Spring Boot apps in KubernetesSpring Boot apps in Kubernetes
Spring Boot apps in Kubernetes
 
Architecting for Continuous Delivery
Architecting for Continuous DeliveryArchitecting for Continuous Delivery
Architecting for Continuous Delivery
 
Kubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud appsKubernetes and the 12 factor cloud apps
Kubernetes and the 12 factor cloud apps
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
 
Joint OpenStack Kubernetes Environment (March 17 update)
Joint OpenStack Kubernetes Environment (March 17 update)Joint OpenStack Kubernetes Environment (March 17 update)
Joint OpenStack Kubernetes Environment (March 17 update)
 
KubeCon 2019 - Scaling your cluster (both ways)
KubeCon 2019 - Scaling your cluster (both ways)KubeCon 2019 - Scaling your cluster (both ways)
KubeCon 2019 - Scaling your cluster (both ways)
 
PaaS application in Heroku
PaaS application in HerokuPaaS application in Heroku
PaaS application in Heroku
 
Itb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin PickinItb 2021 - Bulding Quick APIs by Gavin Pickin
Itb 2021 - Bulding Quick APIs by Gavin Pickin
 
Flux is incubating + the road ahead
Flux is incubating + the road aheadFlux is incubating + the road ahead
Flux is incubating + the road ahead
 
Building and Running Workloads the Knative Way
Building and Running Workloads the Knative WayBuilding and Running Workloads the Knative Way
Building and Running Workloads the Knative Way
 
Spring Boot—Production Boost
Spring Boot—Production BoostSpring Boot—Production Boost
Spring Boot—Production Boost
 
Kubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experienceKubernetes, Istio and Knative - noteworthy practical experience
Kubernetes, Istio and Knative - noteworthy practical experience
 
Saturn 2019 - Serveless Integration on Kubernetes/OpenShift by Kurt Stam
Saturn 2019 - Serveless Integration on Kubernetes/OpenShift by Kurt StamSaturn 2019 - Serveless Integration on Kubernetes/OpenShift by Kurt Stam
Saturn 2019 - Serveless Integration on Kubernetes/OpenShift by Kurt Stam
 

Semelhante a Microservices with kubernetes @190316

Semelhante a Microservices with kubernetes @190316 (20)

Spring Cloud Services with Pivotal Cloud Foundry- Gokhan Goksu
Spring Cloud Services with Pivotal Cloud Foundry- Gokhan GoksuSpring Cloud Services with Pivotal Cloud Foundry- Gokhan Goksu
Spring Cloud Services with Pivotal Cloud Foundry- Gokhan Goksu
 
Spring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application ServiceSpring Boot & Spring Cloud on Pivotal Application Service
Spring Boot & Spring Cloud on Pivotal Application Service
 
Spring and Pivotal Application Service - SpringOne Tour Dallas
Spring and Pivotal Application Service - SpringOne Tour DallasSpring and Pivotal Application Service - SpringOne Tour Dallas
Spring and Pivotal Application Service - SpringOne Tour Dallas
 
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
Eseguire Applicazioni Cloud-Native con Pivotal Cloud Foundry su Google Cloud ...
 
Spring on PAS - Fabio Marinelli
Spring on PAS - Fabio MarinelliSpring on PAS - Fabio Marinelli
Spring on PAS - Fabio Marinelli
 
Spring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - BostonSpring and Pivotal Application Service - SpringOne Tour - Boston
Spring and Pivotal Application Service - SpringOne Tour - Boston
 
Cloud-Native Patterns for Data-Intensive Applications
Cloud-Native Patterns for Data-Intensive ApplicationsCloud-Native Patterns for Data-Intensive Applications
Cloud-Native Patterns for Data-Intensive Applications
 
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby AnandanPivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
Pivoting Spring XD to Spring Cloud Data Flow with Sabby Anandan
 
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architectureDevoxx 2018 -  Pivotal and AxonIQ - Quickstart your event driven architecture
Devoxx 2018 - Pivotal and AxonIQ - Quickstart your event driven architecture
 
Ultimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on KubernetesUltimate Guide to Microservice Architecture on Kubernetes
Ultimate Guide to Microservice Architecture on Kubernetes
 
Spring Boot & Spring Cloud on Pivotal Application Service - Alexandre Roman
Spring Boot & Spring Cloud on Pivotal Application Service - Alexandre RomanSpring Boot & Spring Cloud on Pivotal Application Service - Alexandre Roman
Spring Boot & Spring Cloud on Pivotal Application Service - Alexandre Roman
 
Pivotal CloudFoundry on Google cloud platform
Pivotal CloudFoundry on Google cloud platformPivotal CloudFoundry on Google cloud platform
Pivotal CloudFoundry on Google cloud platform
 
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
How to build streaming data pipelines with Akka Streams, Flink, and Spark usi...
 
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> KubernetesJJUG CCC 2018 : Lessons Learned: Spring Cloud ->  Docker -> Kubernetes
JJUG CCC 2018 : Lessons Learned: Spring Cloud -> Docker -> Kubernetes
 
Building 12-factor Cloud Native Microservices
Building 12-factor Cloud Native MicroservicesBuilding 12-factor Cloud Native Microservices
Building 12-factor Cloud Native Microservices
 
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel LavoieSpring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
 
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring BootSpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
SpringOne Tour: Deliver 15-Factor Applications on Kubernetes with Spring Boot
 
SpringOne Platform 2018 Recap in 5 minutes
SpringOne Platform 2018 Recap in 5 minutesSpringOne Platform 2018 Recap in 5 minutes
SpringOne Platform 2018 Recap in 5 minutes
 
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
 
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd PfefferDelivering Cloud Native Batch Solutions - Dodd Pfeffer
Delivering Cloud Native Batch Solutions - Dodd Pfeffer
 

Último

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 

Último (20)

%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
ManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide DeckManageIQ - Sprint 236 Review - Slide Deck
ManageIQ - Sprint 236 Review - Slide Deck
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
%in Stilfontein+277-882-255-28 abortion pills for sale in Stilfontein
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 

Microservices with kubernetes @190316

  • 2. Microservices with Spring Cloud and Kubernetes and Istio and ... 2019.03
  • 3. About me { “name” : “Jupil Hwang”, “role”: “Senior Platform Architecture”, “company”: “Pivotal”, “email”: “jupil.hwang@gmail.com”, ”twitter”: “jupil_hwang”, “github”: “https://github.com/jupilhwang” }
  • 6. Pivotal invests heavily in open-source software “Pivotal is currently contributing as much software to open source projects as IBM.” Source: https://redmonk.com/jgovernor/2017/10/25/some-thoughts-on-the-top-contributors-to-github-2017/
  • 7. vSphere Openstack AWS Google Cloud Azure & Azure Stack Shared Services Shared Security Shared Networking Logging & Metrics / Services Brokers / API Management Credhub / UAA / Single Sign On VMWare NSX Embedded Operating System (Windows / Linux) Application Code & Frameworks Buildpacks / Spring Boot / Spring Cloud / Steeltoe PAS Pivotal Application Service PKS Pivotal Container Service PFS Pivotal Function Service Pivotal Services Marketplace Pivotal and Partner Products Any App Every Cloud One Platform Concourse Pivotal Cloud Foundry
  • 10. What does cloud native mean? ● Designing the solution as a collection of microservices that follow the recommendations in the free ebook Beyond the 12 Factor App: Exploring the DNA of Highly Scalable, Resilient Cloud Applications ● Leveraging a container platform to enable continuous delivery and continuous deployment ● Eliminating tickets and working in a fully automated way leveraging DevOps best practices ● Increasing speed, security, scalability, scalability, and saving by optimizing the right mix of DevOps / Microservices / Continuous Delivery and containers
  • 11. I. One Codebase, One App* II. Dependency Management* V. Build, Release, Run* III. Configuration* XI. Logs* IX. Disposability IV. Backing Services X. Environmental Parity* XII. Administrative Process VII. Port Binding* VI. Process VIII. Concurrency VALUE & APPROACH = Time to Market; find the seams; use good SDLC practices = Dev Productivity; standardize & remove surprises = Release Mgmt Hygiene; use CI/CD automation /w PCF = Release Mgmt Hygiene; move to environment vars = Real-Time Metrics; use PCF features; stdout / stderr = Auto-Scale; move slow processes to backing services = Resiliency / Agility; use circuit breaker; loose binding = Reliability; use well architected PCF, get parity = Reliability; move to backing service(s), expose as REST = Ops Efficiency; use PCF features like routing, scaling, etc. = Cloud Compatibility; move state to backing service(s) = Auto-Scale, ZDD; design for cloud, use PCF features Cloud Native Implementation
  • 12. Looking Beyond 12-Factors ▪ 12-Factor Published in 2012 - In context of Heroku - A LOT has changed ▪ New Guidance - Emphasis on Enterprise Java - 3 new “factors” • API First • Telemetry – APM, Logs, Domain-Specific • Authn / Authz – Security First Design ▪ Must Read for Application Architects
  • 14. “ Loosely coupled service oriented architecture with bounded contexts" - Adrian Cokcroft - If every service has to be updated in concert, it’s not loosely coupled! If you have to know about surrounding services you don’t have a bounded context.
  • 15. The structure of a microservice http://chrisrichardson.net/post/microservices/general/2019/02/16/whats-a-service-part-1.html
  • 17. Maintaining leadership position through Business Model Maintaining leadership position through Business Model Maintaining leadership position through Business Model Maintaining leadership position through Experience Maintaining leadership position through Product Maintaining leadership position through Product Maintaining leadership position through Product Maintaining leadership position through Experience Maintaining leadership position through Business Model Maintaining leadership position through Business Model Maintaining leadership position through Experience Maintaining leadership position through Product
  • 18. monolithic vs microservices architecture Business Logic User Interface Data Access Layer User Interface Microservice Microservice Microservice Microservice Microservice
  • 20. Microservice.io A pattern language for microservices by 강인호 https://www.slideshare.net/Inho Kang2/microservice-pattern- launguage
  • 21. Microservices 의 장단점 Pros Cons Strong Modular Boundaries Distributed Systems Independent Deployment Eventual Consistency Technology Diversity Operational Complexity
  • 22. 분산시스템의 허점 ● The network is reliable ● Latency is zero ● Bandwidth is infinite ● The network is secure ● Topology doesn’t change ● There is one administrator ● Transport cost is zero ● The network is homogeneous
  • 23. Spring Boot Build Anything Spring Cloud Coordinate Anything Spring Cloud Data Flow Connect Anything Spring by Pivotal: The Standard for Cloud Native Java Code Clarity | Lower Complexity | Less Tech Debt | Focus on Business Logic | Better Test Coverage | Faster Code Completion
  • 25. Spring Boot ● Create stand-alone Spring applications ● Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR files) ● Provide opinionated 'starter' dependencies to simplify your build configuration ● Automatically configure Spring and 3rd party libraries whenever possible ● Provide production-ready features such as metrics, health checks and externalized configuration ● Absolutely no code generation and no requirement for XML configuration
  • 26. Make a Web Application in 144 Char. Simple Spring Boot Application
  • 27. Netflix OSS ● Netflix needed to be faster to win / disrupt ● Pioneer and vocal proponent of microservices – the key to their speed and success ● Netflix OSS supplies parts, but it’s not a solution
  • 29. Spring Cloud + = Spring Cloud ✓ Service registration and discovery ✓ API gateway ✓ Client-side load balancing ✓ Git-backed configuration store ✓ Circuit breakers ✓ OAuth 2.0 security support ✓ Distributed tracing ✓ Event-driven microservices ✓ Orchestrated data pipelines
  • 30.
  • 31. Netflix OSS and Spring Boot  https://medium.com/netflix-techblog/netflix-oss-and-spring-boot-coming-full-circle-4855947713a0
  • 32. Circuit Breaker Dashboard for PCF Visualizes a stream of Turbine health and metric data from the circuit breakers inside your microservices or applications. Service Registry for PCF Provides an implementation of the NetflixOSS Eureka Service Discovery pattern, as a service. Config Server for PCF Delivers a dynamic, central configuration service to manage an application’s external properties across all environments. Build & Operate Microservices with Spring Cloud Services
  • 33. Spring Cloud Config Server @SpringBootApplication @EnableConfigServer public class ConfigServer { public static void main(String[] args) { SpringApplication.run(ConfigServer.class, args); } } spring: cloud: config: server: git: uri: http://github.com/<repo>/<my-repo>.git Greeting: Bonjour application.yml http://github.com/<repo>/<my-repo>/blob/master/demo.yml
  • 34. Spring Cloud Config Client @Configuration @EnableAutoConfiguration @RestController public class GreetingService { @AutoWired Greeter greeter; @RequestMapping("/") public String home() { return String.format("%s World", greeter.greeting); } @Component @RefreshScope public class Greeter { @Value("${greeting}") String name = "World"; } } spring: application name: demo cloud: config: uri: http://my-config-server.com bootstrap.yml
  • 35. Refreshing Configuration Context 1. Update Git Repository 2. Send a POST refresh request to the application(s) to refresh eg. curl –X POST http://my-app.com/refresh @Component @RefreshScope public class Greeter { @Value("${greeting}") String name = "World"; }
  • 36. Client Service Discovery @SpringBootApplication @EnableDiscoveryClient public class MyClientApp{ public static void main(String[] args) { SpringApplication.run(MyClientApp.class, args); } } public Portfolio accountLookup(String acctId) { Portfolio p = restTemplate.getForObject( “http://portfolio- service/portfolio/{accId}”, Portfolio.class acctId); return p; }
  • 37. Spring Cloud Services: Service Registry Automated deployment of server component Security-optimized Eureka service instance using Oauth2 Bind into CF client application(s) Cloud Connectors for auto- reconfiguration
  • 38. Microservice API Gateways Netflix uses Zuul and Ribbon for ● Authentication ● Stress Testing ● Canary Testing ● Dynamic Routing ● Service Migration ● Load Shedding ● Security ● Static Response handling ● Active/Active management
  • 39. How? public Portfolio accountLookup(String[acctId) { Portfolio p = restTemplate.getForObject( “http://portfolio- service/portfolio/{accId}”, Portfolio.class acctId); return p; } MAGIC!! @Autowired LoadBalancerClient loadBalancer; public void doStuff() { ServiceInstance instance = loadBalancer.choose("stores"); URI storesUri = URI.create(String.format("http://%s:%s", instance.getHost(), instance.getPort())); // Do some stuff… }
  • 40. How? API proxy will be created at /myusers Ribbon/Zuul creates load balancer for Eureka service “users_service” All requests are executed in a Hystrix command @SpringBootApplication @EnableZuulProxy @EnableDiscoveryClient public class MyAPIGateway { public static void main(String[] args) { SpringApplication.run(MyAPIGateway.class, args); } } MAGIC!! zuul: routes: users: path: /myusers/** serviceId: users_service
  • 42. Circuit Breaker Pattern Implementation @SpringBootApplication @EnableDiscoveryClient @EnableCircuitBreaker public class MyClientApp{ public static void main(String[] args) { SpringApplication.run(MyClientApp.class, args); } } <dependency> <groupId>io.pivotal.spring.cloud</groupId> <artifactId>spring-cloud-starter-hystrix</artifactId> </dependency> pom.xml
  • 43. @Service public class FortuneService { @HystrixCommand(fallbackMethod = "defaultFortune", commandProperties = { @HystrixProperty(name="execution.isolation.thread.timeoutInMilliseconds”, value="500") }) public String getFortune() { return restTemplate.getForObject("http://fortune-service", String.class); } public String defaultFortune() { logger.debug("Default fortune used."); return "This fortune is no good. Try another."; } } @HystrixCommand
  • 45. Hystrix Dashboard Automated deployment dashboard + Turbine + RabbitMQ Bind service into app Include starter dependency in app: <dependency> <groupId>io.pivotal.spring.cloud</groupId> <artifactId>spring-cloud-services-starter- circuit-breaker</artifactId> </dependency>
  • 46. Spring Cloud Services Config Server Circuit Breaker Service Registry Pivotal has bundled a number of these OSS projects into Spring Cloud Services for PCF
  • 48. But ● Multiple stack ● Multiple frameworks ● Polyglot (Multiple Languages) ● Legacy Applications
  • 49.
  • 50.
  • 52. Reduce Complexity with Kubernetes and Istio Config Server Service Registry Circuit Breaker Kubernetes Configmap Kubernetes Services / CoreDNS, Labels Service Mesh
  • 53.
  • 54. A Service Mesh for Microservices https://istio.io/docs/concepts/what-is-istio/ • Service to Service Communication (Service Discovery) • Routing Rules (A/B testing, Mirror) • Retries • Circuit Breaker • Performance Monitoring • Tracing
  • 55. Circuit Breaker: istio kind: DestinationRule apiVersion: networking.istio.io/v1alpha3 metadata: name: foo spec: host: foo trafficPolicy: connectionPool: http: {http1MaxPendingRequests: 1, maxRequestsPerConnection: 1} tcp: {maxConnections: 1} outlierDetection: baseEjectionTime: 100.000s consecutiveErrors: 1 interval: 1.000s maxEjectionPercent: 100
  • 57. Microservices with Kubernetes and Istio - Reducing Microservices Architecture Complexity https://spring.io/ Proxy - Sidecar Ingress Gateway Istio Control Plane Kubernetes
  • 59. Istio or Spring Cloud ?? Applications – Spring Cloud ○ Fallbacks ○ Tracing Propagation ○ Security Polyglot environments – Istio Istio GA in July 2018. Istio Control Plane Performance Issues
  • 60. Storage NetworkingCompute Dev / Apps App User IT / Ops > kubectl Kubernetes Dashboard Load Balancing / Routing Container Image Registry App Monitoring App Logging OS Updates OS Images K8S Updates K8S Images Log & Monitor Recover & Restart Backup & Restore External Data Services Cluster Provisioning Provision & Scale Command Line / API Management GUI Monitoring GUI ...Kubernetes alone is not enough for enterprises
  • 61. Five Domains of a Cloud Native Platform
  • 62. Don’t Forget About Learning HA Design Hardening Installation & Integration Platform Continuous Delivery DR/BC/Backup Production Support Auditing Monitoring Logging Scaling Upgrades & Lifecycle Product Development & Planning...Across All of This
  • 63. Comparing Spring Boot app deployment processes Spring Boot app deployed to K8s - Compile Spring Boot app - Choose base Docker image - Author Dockerfile w/ app entrypoint - Build Docker image - Upload image to container registry - Decide on JVM tuning parameters to use when starting pods - Create kubernetes deployment config - Use CI/CD tool or kubectl to apply kubernetes configuration and deploy pods - Create service to expose pod for users - Profit! Spring Boot app deployed to PAS - Compile Spring Boot app - Create manifest.yml to describe the app - Use CI/CD tool or cf push to deploy - Profit! Standardized container images Governance enforced by the platform Snowflake container images Governance enforced by corporate process
  • 64. 69
  • 66. Everything you need to transform Process & Culture Build for change Tools Continuously Improve Platform Any App, Every Cloud, One Platform PCF 2.0 Tracker / Spring / Concourse Pivotal Labs Data / AI Apps Culture, tools, and platform
  • 67. Q&A