71
CONTINUOUS DELIVERY PIPELINE

PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

  • Upload
    others

  • View
    27

  • Download
    1

Embed Size (px)

Citation preview

Page 1: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

CONTINUOUS DELIVERY PIPELINE

Page 2: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Rodrigo BottiBackend, Frontend, Ops, Fullstack (?)

NEXA: Integrations Team - Crawler, APIs, Ops, Fullstack (?)

GDG Campinas: Organizer

Page 3: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 4: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

AGENDA

▸ Current Scenario▸ Continuous Delivery▸ Canary Release▸ Tooling▸ Future▸ Q&A

Page 5: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

!!! DISCLAIMER !!!

Page 6: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 7: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

1.SCENARIO

TechnologyPlatforms

Page 8: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MAINTECHNOLOGIES

Page 9: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MAINTECHNOLOGIES

Page 10: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MICROSERVICESAdvantages

MODULARITY

Reduced codebase, easier to reason about, develop, test and deploy.

Single responsibility.

PARALLELISM

Multiple teams working on separate services.

SCALABLE

Faster feature delivery.

Independent horizontal/vertical scaling and failure handling.

Page 11: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MICROSERVICESRequirements

*** AUTOMATION ***

Automation is key for having speed, scalability / elasticity specially when dealing with a distributed services application.

DISCOVERY

Service discovery by name: cloud-level DNS, service-mesh level DNS, registration, client-side load balancing.

OBSERVABILITY

Monitoring, metrics/health gathering, central tracing, APM, alarm management.

Avoid "needle in a haystack" debugging.

Page 12: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 13: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MICROSERVICESAnatomy (Kubernetes)

▸ Deployment▹ Pod: Container (Image) + Resource limits▹ Replica set: count + deploy strategy

▸ Service▹ Deployment load balancer▹ Ingress traffic

▸ HorizontalPodAutoScaler▹ Deployment replica set horizontal scaling

▸ ServiceMonitor▹ Prometheus metrics exporter

▸ Ingress (*)▹ Cluster gateway L7 router

Page 14: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MICROSERVICESAnatomy (Kubernetes)

Service AService B

Pod A 1Pod A 2Pod B 3 Pod B 2 Pod B 1

Ingress

<domain>/svc-b <domain>/svc-a

External Traffic

Page 15: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

SHOW ME THE CODE!

Page 16: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Deployment

Page 17: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Service HPA

Page 18: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Ingress SVC Monitor

Page 19: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 20: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

2.CONTINUOUSDELIVERY

ConceptPipeline

Page 21: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

“Produce software in short cyclesReliably released at any timeBuilding, testing and releasing faster and more frequentlyStraightforward and repeatable deployment process

Page 22: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

PIPELINE

Code Push + Webhook

Lint

Test + Coverage

Quality Metrics Check

Build + Push Image

Deploy (Canary, Blue/Green, etc)

Page 23: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

3.CANARYRELEASE

ConceptPipeline

Page 24: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 25: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

PIPELINE

Deploy QA Environment (Homolog)

Deploy Baseline

Canary Analysis

Deploy Canary

Delete BaselineDelete Canary

Deploy Production( Rolling )

Success/Error

Page 26: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

4.TOOLS

TopologyAutomation Server

Integration TestsCode Quality

DeployCanary

Page 27: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Webhook

Code Quality Check(REST calls)

DeployTrigger CD

Canary Analysis

Page 28: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

(LEEEROOOOOOOOOY...)JENKINS

▸ Automation Server▸ Pipeline▸ Groovy DSL▸ Plugins

Page 29: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

(LEEEROOOOOOOOOY...)JENKINS

▸ Kubernetes Plugin▸ Custom Library▸ Opinionated DSL

Page 30: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 31: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

App Test Pod

App Container DB Container Cache Container

Page 32: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

SHOW ME THE CODE!

Page 33: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Pipeline

Page 34: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

DSL

Page 35: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

DSL

Page 36: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

DSL

Page 37: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

DSL

Page 38: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Running Pipeline Pod

Page 39: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

QUALITY CHECKSSONARQUBE

▸ Quality Metrics▹ Code smells▹ Bugs▹ Vulnerabilities▹ Code coverage

▸ Quality Profiles▸ Quality Gate

Page 40: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 41: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 42: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

MONITORINGPROMETHEUS (OPERATOR)

▸ Monitoring▸ Time-series database▸ PromQL▸ Alerting

Page 43: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 44: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

DELIVERYSPINNAKER

▸ CD Pipeline▸ Canary Release▸ Multi-cloud

▹ Kubernetes▸ Abstracts infrastructure elements (*)▸ Netflix

Page 45: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

WEBUI

CanaryAnalysis

Page 46: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 47: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 48: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

CONCEPTS/ABSTRACTIONSSPINNAKER

▸ Application▸ Cluster▸ Server Group▸ Load Balancer

▸ Application▸ Cluster == Namespace▸ Server Group == Deployment▸ Load Balancer == Service

Page 49: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 50: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

PIPELINE

Deploy QA Environment (Homolog)

Deploy Baseline

Canary Analysis

Deploy Canary

Delete BaselineDelete Canary

Deploy Production( Rolling )

Success/Error

Page 51: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

PIPELINE

Full Manifest N = homolog

DeploymentN = prod, L = baseline

Canary AnalysisComparing pods: canary vs baseline

DeploymentN = prod, L = canary

Delete DeploymentsN = prod, L = [baseline, canary]

Full ManifestN = prod

Success/ErrorCheck canary stage result

Page 52: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 53: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Pipeline Overview

Page 54: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Stage: Configuration

Page 55: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Stage: Canary Analysis

Page 56: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Canary Config

Page 57: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Canary ConfigMetric

Page 58: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Canary ConfigFilter

Page 59: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Canary Analysis Report: Success

Page 60: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Canary Analysis Report: Failed

POD NOT UP (ENV VAR ERROR)

Page 61: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

Stage: Check

Page 62: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

5.FUTURE

Page 63: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

FUTURE

▸ Canary Analysis config improvement▹ What metrics?▹ Groups weights▹ Length/Windows

▸ Service Mesh?▸ Manifests from SCM▸ Pipeline in SCM▸ Canary Analysis with business metrics

▹ Custom collector?▸ Automatic feature toggle management

Page 64: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 65: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

6.Q&A

Page 66: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

7."THANK YOU"NOTES

Page 67: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 68: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

https://liviasaude.com.br

Page 69: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 70: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer
Page 71: PIPELINE DELIVERY CONTINUOUS€¦ · Anatomy (Kubernetes) Deployment Pod: Container (Image) + Resource limits Replica set: count + deploy strategy Service Deployment load balancer

[email protected]

[email protected]

https://www.linkedin.com/in/rodrigo-botti/