DevOps - The gateway to the API frontier · 2019-10-28 · 2 | © 2019 Software AG. All rights...
Transcript of DevOps - The gateway to the API frontier · 2019-10-28 · 2 | © 2019 Software AG. All rights...
© 2019 Software AG. All rights reserved. For internal use only
DEVOPS - THE GATEWAY TO
THE API FRONTIER
Dave Pemberton, Software AG
API, Integration & IoT Practice Manager (UK & Nordic)
https://www.linkedin.com/in/pembertondave
@sagpembo
2 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
Existence, as you know
it, is over
Resistance is futile
3 | © 2019 Software AG. All rights reserved.
DEPLOYMENT ARCHITECTURES
MONOLITH
MORE AGILITY AND FLEXIBILITY
LOWER OPERATIONAL COMPLEXITY AND COST
SERVICE MESH MICROSERVICES SERVERLESS
λ {...} λ λ {...} {...}
4 |
DEVOPS
© 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
5 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• Works on multiple projects
• Often multiple languages/frameworks
• Focused on the requirements
• Testing can often be an afterthought
– Especially when time pressured
– It works… (on my machine)
– Infrastructure – do I really need to care?
WHY DEVOPS
LIFE OF A TYPICAL DEVELOPER
6 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• What does my service need to do for the business?
• I want to develop in a language I like!
• How do I fix/build/change somebody else’s code?
• How do I know it works?
• What code quality / style do I need to ‘comply’ with?
• I don’t care what it has to run on – that’s for operations to worry about!
• The others in the team better not break what I’m doing!
• Operations can sort the deployment so I can write more code!
Developer
WHY DEVOPS
A DEVELOPER PERSPECTIVE
I just want to write code
7 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
LOOKING A LITTLE WIDER - A MILLION MOVING PARTS
HOW TO HANDLE THESE
Development Production
• How to build?
• How to deploy?
• What to deploy?
• Dependencies😮 ?
• Hardware compatibility?
• Rollback..
8 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
LOOKING A LITTLE WIDER - A MILLION MOVING PARTS
THE UBER TASK LIST?
Development
9 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
A MILLION MOVING PARTS
DEVOPS
Development
DevOps
Development QA
Operations
10 |
DEVPOS
I FEEL THE NEED… THE NEED FOR SPEED
Micro
Services DevOps APIs
Innovation & Experience
Containers Cloud IoT
© 2019 Software AG. All rights reserved. For internal use only
300 deployments per
year
10+ deployments per
day
50+ deployments per
day
11.6 deployment every
sec
cars.com
amazon
flickr
Etsy
11 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS
THE FOUNDATIONS
• Deliver Fast
• Deliver Often
• Deliver Right
AGILE
• Reliability
• Reduce Risks
AUTOMATED
PROVISON
• Reduce Time
• Reduce Errors
• Reduce down
time
DEPLOY
AUTOMATION
• Improve
Quality
• Accelerate
QA
TEST
AUTOMATION
• Reliability
• Consistency
• Predictability
BUILD
AUTOMATION
MONITORING
12 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
Development Continuous Integration Continuous Delivery/Deployment
13 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
DEVELOPMENT
Develop Functionality
Build / Run Tests
Create Build / Deployment Procedures
QA Commit Changes
Development Continuous Integration Continuous Delivery/Deployment
Develop Test Deploy Quality Commit
14 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
DEVELOPMENT
Develop Functionality
Build / Run Tests
Create Build / Deployment Procedures
QA Commit Changes
Development Continuous Integration Continuous Delivery/Deployment
Develop Test Deploy Quality Commit
– Cross-platform IDE capable of Multi-
language/framework support
– Test Tool Enabled
– Debugging
– Source Control integration
15 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
CONTINUOUS INTEGRATION
Development Continuous Integration Continuous Delivery/Deployment
16 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
CONTINUOUS INTEGRATION
Extract and Build Changes
Code Quality Check
Deploy Assets to Build Environment
Unit Test Inteface Test Performance Test End to End Test
Report Status
Build QA Deploy Test Report
Development Continuous Integration Continuous Delivery/Deployment
17 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
CONTINUOUS INTEGRATION
Extract and Build Changes
Code Quality Check
Deploy Assets to Build Environment
Unit Test Interface Test Performance Test End to End Test Security Test
Report Status
Build QA Deploy Test Report
Development Continuous Integration Continuous Delivery/Deployment
• Runs in a CI tool of choice
(and there’s a lot of choice)
• Builds, quality checks,
deploys and tests every
commit
– Assuming tests exist
• Reports to the team status of
build, quality, tests
18 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
Development Continuous Integration Continuous Delivery/Deployment
19 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
CONTINUOUS DELIVERY / DEPLOYMENT
Create versioned release
Store release binaries
Provision Environment
Deploy into new environment
Test new Environment
Version Store Provision Deploy Test
Development Continuous Integration Continuous Delivery/Deployment
20 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS PIPELINE
CONTINUOUS DELIVERY / DEPLOYMENT
Create versioned release
Store release binaries
Provision Environment
Deploy into next environment
Test new Environment
Version Store Provision Deploy Test
Development Continuous Integration Continuous Delivery/Deployment
• Branch/ Tag Source
• Store Binaries
• Automatically create and deploy
environment with zero downtime through a
rolling update.
• Test as required
21 |
API GATEWAY
© 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
22 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• I want my microservice to be micro
– I don’t want to create aggregated services or concern myself with latency– it’s fast on
my machine!
• I don’t want to have to worry about security
– I don’t want to bloat out the implementation with sometimes complex security
requirements (authorization/ssl)
• I don’t want to have to spend my working life fixing issues caused by tight
dependencies between client applications consuming my microservices
• I still want my microservice to be able to scale as intended
• I don’t want to worry about load/caching requirements for my microservice
I just want to write interesting code
WHY API GATEWAY
A DEVELOPER’S PERSPECTIVE
23 | © 2019 Software AG. All rights reserved.
API GATEWAY
TYPICAL ARCHITECTURE
• Main / Edge gateway serves north-south traffic
• Protects and mediates public APIs
• Microgateways serve east-west traffic
• Protect and mediate private APIs
• They are light weight and only carry the policies they need right now
24 | © 2019 Software AG. All rights reserved.
API GATEWAY
TYPICAL ARCHITECTURE
acme.com, acme.eu, acme.cn ... Mobile PoS
Experience
Layer
API
Management
25 |
DOCKER & KUBERNETES
© 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
26 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• Docker is a tool designed to make it
easier to create, deploy, and run
applications by using containers which
allow a developer to package up an
application with all of the parts it
needs, such as libraries and other
dependencies, and ship it all out as
one package.
Docker Kubernetes
• Modern applications are increasingly
built using containers—microservices
packaged with their dependencies and
configurations. Kubernetes, or k8s for
short, is open-source software for
deploying and managing those
containers at scale. With Kubernetes,
you can build, deliver, and scale
containerized apps faster.
WHAT IS DOCKER & KUBERNETES (K8S)
27 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• I don’t want to know/care about what infrastructure my microservice runs on
• My service is stateless - I shouldn’t have to worry about scale
• Deployment – that’s boring
• I just want to write some code
WHY DOCKER / KUBERNETES
A DEVELOPERS PERSPECTIVE
28 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
MICROGATEWAY
SIDECAR
The Application
The piece of
software
performing
the core
function
The Sidecar
Other functions
- Network
abstraction
- Common
funnctions
- etc
29 |
THE DEMO!
© 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
30 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
MURPHY’S LAW – IT’S A LIVE DEMO
ANYTHING THAT CAN GO WRONG…..
31 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
THE DEMO ENVIRONMENT
Development
VS Code
API Gateway
Staging (Production Identical)
Docker
Kubernetes
API Gateway
Build
API Gateway
Maven
Regis
try
Source Control (Github)
Docker
Jenkins
Java / Spring Boot /
Maven / JUnit./JMeter
32 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
THE DEMO BUILD!
MICRO SERVICE
Product
Data
Store
MICRO SERVICE
Order
Data
Store
MICRO SERVICE
Customer
Data
Store
API Gateway
MINI SERVICE
Integration logic
Inner APIs
Outer APIs
Micro gateways
Micro services
33 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
• Throughout the rest of this presentation, we’re
going to make some changes and get them into
production in a MINUTES with ZERO
DOWNTIME
•
Lets take a look and my Product Microservice
and make a change to this and the Gateway
DEVELOPMENT
MICROSERVICE
MICRO SERVICE
Product
Data
Store
Micro Gateway
Micro services
34 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
THE MICROSERVICE
35 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
THE MICROSERVICE
UNIT TESTS
36 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVELOPMENT
API GATEWAY API RESOURCES
37 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVELOPMENT
API GATEWAY POLICY CONFIGURATION
38 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVELOPMENT
COMMIT/PUSH THE CHANGES
Development
39 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
Continuous Delivery
40 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
41 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
42 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
43 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
44 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
45 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
THE PROCESS
46 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
TEST RESULTS
47 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS INTEGRATION
ARTIFACTS
48 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
GIT STRATEGY
MOVE INTO STAGING
Development
Staging
Pull Request
/ Merge
vX.y
49 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CREATE THE PULL REQUEST
50 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS
CONTINUOUS DELIVERY
51 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
DEVOPS
CONTINUOUS DELIVERY
52 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
CONTINUOUS DELIVERY
RELEASE TO TEST
53 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
ROLLING RELEASE
THE ENVIRONMENT
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster Product Order Customer
Kubernetes Service
30080 30081 30082
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
54 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
ROLLING RELEASE
THE ENVIRONMENT
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster Product
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
55 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
ROLLING RELEASE
START A PARALLEL MICROSERVICE/GATEWAY DEPLOY
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster Product vOld
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
Procuct vNew
STARTING
56 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
STAGING / PRODUCTION LAYOUT
START A PARALLEL MICROSERVICE/GATEWAY DEPLOY
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster Product vOld
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
Procuct vNew
57 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
STAGING / PRODUCTION LAYOUT
CHANGE THE END POINT OVER
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster Product vOld
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
Procuct vNew
58 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
STAGING / PRODUCTION LAYOUT
STOP THE PREVIOUS SERVICE
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
Procuct vNew Product vOld
STOPPING
59 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
STAGING / PRODUCTION LAYOUT
NEW NORMAL
Microservice
Micro gateway
Kubernetes Pod
Kubernetes Cluster
Kubernetes Service
30080
API Gateway
5555/Gateway D
oc
ke
r R
eg
istr
y
Build
Environment
Staging Environment
Procuct vNew
60 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
KUBERNETES
[root@APIWorldRef ~]# kubectl get all
NAME READY STATUS RESTARTS AGE
pod/order-service-deployment-86c7486589-q5cx8 2/2 Running 0 67m
pod/product-service-deployment-75579b7dc4-mwhms 2/2 Running 0 20m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kubernetes ClusterIP 10.96.0.1 <none> 443/TCP 6d2h
service/order-service-svc NodePort 10.103.69.62 <none> 9090:30081/TCP 3d7h
service/product-service-svc NodePort 10.104.231.57 <none> 9090:30080/TCP 5d1h
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/order-service-deployment 1/1 1 1 3d7h
deployment.apps/product-service-deployment 1/1 1 1 13h
NAME DESIRED CURRENT READY AGE
replicaset.apps/order-service-deployment-6b7cc494d6 0 0 0 67m
replicaset.apps/order-service-deployment-6c58696dbf 0 0 0 11h
replicaset.apps/order-service-deployment-86c7486589 1 1 1 67m
replicaset.apps/product-service-deployment-5c948db756 0 0 0 105m
replicaset.apps/product-service-deployment-647d6bfcf5 0 0 0 72m
replicaset.apps/product-service-deployment-6d87fd9b8 0 0 0 10h
replicaset.apps/product-service-deployment-6d975b8cc8 0 0 0 11h
replicaset.apps/product-service-deployment-75579b7dc4 1 1 1 20m
replicaset.apps/product-service-deployment-75c8bdd865 0 0 0 105m
replicaset.apps/product-service-deployment-7774578498 0 0 0 6h32m
replicaset.apps/product-service-deployment-78975fbbcc 0 0 0 10h
replicaset.apps/product-service-deployment-79668869f8 0 0 0 20m
replicaset.apps/product-service-deployment-846958c789 0 0 0 6h32m
replicaset.apps/product-service-deployment-b4f9df8cd 0 0 0 72m
61 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
INVOCATION OF API (RUNNING IN KUBERNETES)
62 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
API METRICS
63 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
API METRICS
64 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
GIT STRATEGY
Master
Staging
Development
Pull Request
/ Merge
Pull Request
/ Merge
v1.0 v2.0 v2.1
v1.0 v2.1
65 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.
KEY TAKEAWAYS
3 KEY TAKEAWAYS
DevOps creates hands off automated quality gates through the CI process, and
hands off, but manually approved automated test/production deployments to
allow you to release at a much quicker pace whilst minimizing risk 1
Micro API Gateways in combination with a full API Gateway are a powerful
mechanism to ensure your microservices remain focused on the task at hand
and offload ancilliary and sometimes complex tasks to avoid complicating the
micro service
2
Kubernetes offers really powerful infrastructure as code and deployment
techniques to allow you to truly update with ZERO downtime, and minimal fuss
in doing so 3
You!
https://github.com/dpembo/APIWorld-Product
66 | © 2019 Software AG. All rights reserved. For internal use only and for Software AG Partners.