SlideShare a Scribd company logo
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/namoo4u”
}
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
65
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

More Related Content

What's hot

What's hot (20)

Terraform introduction
Terraform introductionTerraform introduction
Terraform introduction
 
An Introduction to Kubernetes
An Introduction to KubernetesAn Introduction to Kubernetes
An Introduction to Kubernetes
 
Docker Container Security
Docker Container SecurityDocker Container Security
Docker Container Security
 
Creating AWS infrastructure using Terraform
Creating AWS infrastructure using TerraformCreating AWS infrastructure using Terraform
Creating AWS infrastructure using Terraform
 
AWS SQS SNS
AWS SQS SNSAWS SQS SNS
AWS SQS SNS
 
Terraform
TerraformTerraform
Terraform
 
Building Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using TerraformBuilding Repeatable Infrastructure using Terraform
Building Repeatable Infrastructure using Terraform
 
Service mesh
Service meshService mesh
Service mesh
 
An introduction to terraform
An introduction to terraformAn introduction to terraform
An introduction to terraform
 
Introduction to docker and docker compose
Introduction to docker and docker composeIntroduction to docker and docker compose
Introduction to docker and docker compose
 
Api service mesh and microservice tooling
Api service mesh and microservice toolingApi service mesh and microservice tooling
Api service mesh and microservice tooling
 
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
Using HashiCorp’s Terraform to build your infrastructure on AWS - Pop-up Loft...
 
Terraform Basics
Terraform BasicsTerraform Basics
Terraform Basics
 
(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code(ARC307) Infrastructure as Code
(ARC307) Infrastructure as Code
 
Istio on Kubernetes
Istio on KubernetesIstio on Kubernetes
Istio on Kubernetes
 
Introduction to Docker Compose
Introduction to Docker ComposeIntroduction to Docker Compose
Introduction to Docker Compose
 
The RabbitMQ Message Broker
The RabbitMQ Message BrokerThe RabbitMQ Message Broker
The RabbitMQ Message Broker
 
Terraform
TerraformTerraform
Terraform
 
AWSでDockerを扱うためのベストプラクティス
AWSでDockerを扱うためのベストプラクティスAWSでDockerを扱うためのベストプラクティス
AWSでDockerを扱うためのベストプラクティス
 
Docker + WASM.pdf
Docker + WASM.pdfDocker + WASM.pdf
Docker + WASM.pdf
 

Similar to SpringBoot and Spring Cloud Service for MSA

Similar to SpringBoot and Spring Cloud Service for MSA (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
 
Resilient Microservices with Spring Cloud
Resilient Microservices with Spring CloudResilient Microservices with Spring Cloud
Resilient Microservices with Spring Cloud
 
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 ...
 
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - LondonPCF: Platform for a New Era - Kubernetes for the Enterprise - London
PCF: Platform for a New Era - Kubernetes for the Enterprise - London
 
Spring on PAS - Fabio Marinelli
Spring on PAS - Fabio MarinelliSpring on PAS - Fabio Marinelli
Spring on PAS - Fabio Marinelli
 
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
 
Building 12-factor Cloud Native Microservices
Building 12-factor Cloud Native MicroservicesBuilding 12-factor Cloud Native Microservices
Building 12-factor Cloud Native Microservices
 
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
 
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
 
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 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
 
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
 
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...
 
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
 
AWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for GovernmentAWS Webcast - Build Agile Applications in AWS Cloud for Government
AWS Webcast - Build Agile Applications in AWS Cloud for Government
 

More from Oracle Korea

More from Oracle Korea (20)

Oracle Blockchain Platform_Wonjo Yoo
Oracle Blockchain Platform_Wonjo YooOracle Blockchain Platform_Wonjo Yoo
Oracle Blockchain Platform_Wonjo Yoo
 
Oracle Blockchain_JaeHo Park_CTO
Oracle Blockchain_JaeHo Park_CTOOracle Blockchain_JaeHo Park_CTO
Oracle Blockchain_JaeHo Park_CTO
 
Oracle cloud data interface
Oracle cloud data interfaceOracle cloud data interface
Oracle cloud data interface
 
On premise db &amp; cloud database
On premise db &amp; cloud databaseOn premise db &amp; cloud database
On premise db &amp; cloud database
 
Spring boot microservice metrics monitoring
Spring boot   microservice metrics monitoringSpring boot   microservice metrics monitoring
Spring boot microservice metrics monitoring
 
Opentracing jaeger
Opentracing jaegerOpentracing jaeger
Opentracing jaeger
 
Which Questions We Should Have
Which Questions We Should HaveWhich Questions We Should Have
Which Questions We Should Have
 
Oracle NoSQL
Oracle NoSQLOracle NoSQL
Oracle NoSQL
 
Enterprise Postgres
Enterprise PostgresEnterprise Postgres
Enterprise Postgres
 
MySQL Document Store를 활용한 NoSQL 개발
MySQL Document Store를 활용한 NoSQL 개발MySQL Document Store를 활용한 NoSQL 개발
MySQL Document Store를 활용한 NoSQL 개발
 
API Design Principles Essential 
API Design Principles Essential API Design Principles Essential 
API Design Principles Essential 
 
CI/CD 기반의 Microservice 개발
 CI/CD 기반의 Microservice 개발 CI/CD 기반의 Microservice 개발
CI/CD 기반의 Microservice 개발
 
kubernetes from beginner to advanced
kubernetes  from beginner to advancedkubernetes  from beginner to advanced
kubernetes from beginner to advanced
 
OpenJDK & Graalvm
OpenJDK & GraalvmOpenJDK & Graalvm
OpenJDK & Graalvm
 
Cloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm OverviewCloud Native 자바 플랫폼: Graalvm Overview
Cloud Native 자바 플랫폼: Graalvm Overview
 
Eclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – HelidonEclipse MicroProfile 과 Microservice Java framework – Helidon
Eclipse MicroProfile 과 Microservice Java framework – Helidon
 
times ten in-memory database for extreme performance
times ten in-memory database for extreme performancetimes ten in-memory database for extreme performance
times ten in-memory database for extreme performance
 
[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자[Main Session] 카프카, 데이터 플랫폼의 최강자
[Main Session] 카프카, 데이터 플랫폼의 최강자
 
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
[Demo session] 관리형 Kafka 서비스 - Oracle Event Hub Service
 
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
[Hands-on] CQRS(Command Query Responsibility Segregation) 와 Event Sourcing 패턴 실습
 

Recently uploaded

Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
Bhaskar Mitra
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 

Recently uploaded (20)

In-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT ProfessionalsIn-Depth Performance Testing Guide for IT Professionals
In-Depth Performance Testing Guide for IT Professionals
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
ODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User GroupODC, Data Fabric and Architecture User Group
ODC, Data Fabric and Architecture User Group
 
Search and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical FuturesSearch and Society: Reimagining Information Access for Radical Futures
Search and Society: Reimagining Information Access for Radical Futures
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
Measures in SQL (a talk at SF Distributed Systems meetup, 2024-05-22)
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
IESVE for Early Stage Design and Planning
IESVE for Early Stage Design and PlanningIESVE for Early Stage Design and Planning
IESVE for Early Stage Design and Planning
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya HalderCustom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
Custom Approval Process: A New Perspective, Pavel Hrbacek & Anindya Halder
 
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
Behind the Scenes From the Manager's Chair: Decoding the Secrets of Successfu...
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 

SpringBoot and Spring Cloud Service for MSA

  • 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/namoo4u” }
  • 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. 65
  • 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