operationalizing docker at scale: lessons from running microservices in production

24
MM/DD/YY YOUR TITLE HERE PREPARED FOR: PLACE LOGO HERE Operationalizing Docker at Scale Lessons from running microservices in production V e n k a t Thiruvengadam, Zenefits Maxime Petazzoni, SignalFx

Upload: signalfx

Post on 14-Apr-2017

608 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

M M / D D / Y Y

YOUR T ITLE HERE

P R E P A R E D F O R :

P L A C E L O G O

H E R E

Operationalizing Docker at ScaleLessons from running microservices in production

V e n k a t Thiruvengadam, ZenefitsM a x i m e P e t a z z o n i , S i g n a l F x

Page 2: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

Introductions

Venkat Thiruvengadam• Principal Engineer @ Zenefits

• Creator of Project Duplo, a hosting platform for microservices

Maxime Petazzoni• Software Engineer @ SignalFx

• Creator of MaestroNG, a container orchestrator for Docker environments

Page 3: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

M M / D D / Y Y

YOUR T ITLE HERE

P R E P A R E D F O R :

P L A C E L O G O

H E R E

Micro-services @ Zenefits

Page 4: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

Micro-services@ZenefitsThiruvengadamVenketesan

PrincipalEngineer

Page 5: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

ZenefitsEngineering

• 200Developers• MonolithDjango ApplicationonMySQLBackend• TransitioningtoSOA

• Dozensofservices,fewHundredcontainers• HostedinAWS(Noonpremiseservers)• Duplo:Self-serviceHostingplatformforMicroservices

• NoDirectAWSaccessfordevelopers• NodedicatedDevops

Page 6: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

MonolithvsMicroservices

• Monolith• Advantages

• SingleCodeBase.Easytoread/debug/deploy• Nointer-servicecontracts,compatibilityorauthenticationconcerns.• Easytogetstarted.Greatforsmallteams.

• Disadvantages• Singlepointoffailure• Slowiterationwithlargeteams(Managedbycentralopsteam)• Singleprogramminglanguage&technologypattern

• Microservices• Independentdeploymentandhencefasteriteration• DistributedFunctionality,nosinglepointoffailure• ProgrammingLanguage&technologyagnostic

Page 7: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

Micro-services:TheDarkSide

ContainerManagement

ServiceDiscovery

ConfigurationManagement

Authentication

ManagementComplexityw/oright

tools

AWSResourceManagement

ResourceUtilization Monitoring

Page 8: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

FindYourTippingPoint

Microservices

Monolith

TeamandProductSize

Productivity

@zenefits 3years,>millionlinesofcodeand200devs,wedecidedtomovetoMicroservices

Page 9: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

OriginalapproachtoMicro-services@Zenefits

Developers

InfraAdmin

1

TranslatetoAWSConfiguration2

ApplyConfigurationusingTerraform\Otherautomation

3

SaveInfrastructureconfigurationlikeVPC,Subnet,SecurityGrp,IAM,EC2

4

5

SaveApplicationconfigurationlikenamecredentialsinappcode;builddocker image

6

7

DeploytoECS8

- Authenticationtokens,servicediscovery,configurationmanagementfollowsimilarpattern- Infrabecomesbottleneck.Notscalablewithlargenumberservicesandusers

Page 10: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

Anonself-serviceinfrastructuredefeatsthepurpose

Page 11: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

IGetSelf-service,DoIneedMulti-Tenancy?

Multi-Tenant:Eachapplication(orservice)isatenant.Usershaveaccesstoonlytheirrespectiveservices

Multi-tenancy(appteam)isnecessaryifyourorganizationneeds:- Resourceandsecurityisolationbetweenservices- Isolationofconfigurationmistakes- Audittrails- Varyingresourceprivilegesbetweentenants- VaryingDevelopersecurityawareness- Largenumberofdevelopers

Notenancy

TeamSize

Mis-config andSecurityRisksMulti-tenancy

Page 12: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

How can I do CICD in Duplo?

Let’sgiveyouAWSaccess,createyourservice

WhatisthisSecuritygroup,subnet,IAM?Whydoesmydjangoappneedthis?Willallow*work?

Hmm…..

ShallwecreateanAWSusernameforeveryone?

Page 13: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

WeNeedaHostingPlatform

TranslatetoAWSConfiguration

2

- ApplyConfigurationusingAWSandDockerAPIs- InjectconfigurationinappENV&discoveryservice

3

ApplicationrequirementsandDockerImageviaUI/API

1

Developers

Admin

- SelfService.Deployandmanageat-will.- Multi-tenant.Eachserviceorapplicationteamhavetheirownaccounts,resourcepool,IAMrole,SGetc.- ServicesisolatedexceptexplicitAPIinterfaces.- ProgrammaticInfrastructure,consistentconfigurationgeneration

- CreatebaseinfraConfigurationinAWSusingTerraform- InstallDuplo.Setupstaticbaseinfrastructurepolicies.- CreatestaticTenantpoliciesandlimitsa.k.a.“Plans”

0

DUPLO

Page 14: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

DEMO:DEPLOYINGAMICRO-SERVICE

Page 15: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

DuploMicro-servicesPlatform

DUPLO

AWSOrchestrationandabstraction

ContainerManagement

CI/CD

EcosystemOrchestrationAuthentication

ConfigurationManagement

ServiceDiscovery

Page 16: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

HowDuploWorks

BaseInfrastructure:VPC,Subnets,NAT,AdminSecurityGroups,DNSDomainName,SSLWildcharCertTerraform

DUPLOAdminPortalNewServiceRegistration

IAMRole

SecurityGroup

Autocreateperservice

SecurityGroup

IAMRoleNewServiceRegistration

AwsResources

TenantPortal

DUPLO

CreatedbytenantactionsAws

Resources

DeployandManageService

Page 17: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

TheNextStep:ContinuousIntegrationandDelivery

DuplocandeployimageswithdesiredAWSResources.It’sselfservice.WhydoIneedCI\CD?

• OfficialBuildImagesasagainstLaptoptests

• Testsuitesthataredocumented,enforcedwithpasscriterion

• Integrationenvironmentforintegrationtestswithotherservices

• DeploymentPipelineDevsandboxtostagetoprod.

Page 18: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

WhatisspecialaboutaCI\CDsolutionforMicroservices,canIjustuseJenkins?

- MonolithCI/CDisonlyaboutcodecorrectnessandbuildartifacts- TheycanruninanInfratopologyseparatethantherealdeployment

- Beyondcode,MicroservicesCI/CDisaboutreplicatingtherealdeploymentinfratopology- ItneedstotesttheinterfaceoftheservicewithitscomplexinfrastructurelikeIAM,Securitygroupsetc.

- ServicesCI/CDneedstointegrateandbuildontopofthehostingplatform

Page 19: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

CI\CDDEMO:GITPRToDeployment

Page 20: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

KatKit:CI/CDExtensiontoDuplo

• After-allbuildscanbeaMicroservice too,theyarejustshortlived!Let’sreuseDuplotolaunchandterminatebuilds.

• Let’sbuildaworkfloworchestrationontopofduplo forCI/CD.

• WegetCI/CDandHostingPlatform“integration”forfree

Page 21: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

SUMMARY

• Determinethetippingpoint.

• SelfserviceisP0.Determineifmulti-tenancy(isolation)isnecessary

• Hostingplatformisnecessary

• AWSbyitselfisnotasufficientsolution,needahigherlayerplatformtoprovideabstraction,containermanagementandCI/CD

• CI/CDsolutionhastointegratewiththehostingplatformandtestitsinteractionwiththeservicecode.

Page 22: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

M M / D D / Y Y

YOUR T ITLE HERE

P R E P A R E D F O R :

P L A C E L O G O

H E R E

Q&A

Page 23: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

For more information

• Duplo Platform• https://engineering.zenefits.com/2016/03/duplo-aws-orchestration-container-

management-and-paas-for-microservices/

• https://engineering.zenefits.com/2016/07/duplo-cicd-extensions-for-microservices/

• https://www.linkedin.com/pulse/duplo-vs-kubernetes-mesos-thiruvengadam-venketesan

• Monitoring Docker containers• https://signalfx.com/blog/monitoring-docker-containers-take-get-started/

• https://signalfx.com/blog/monitoring-docker-containers-signalfx-monitors-containerized-infrastructure/

• https://signalfx.com/blog/monitoring-docker-at-scale-with-signalfx/

Page 24: Operationalizing Docker at Scale: Lessons from Running Microservices in Production

M M / D D / Y Y

YOUR T ITLE HERE

P R E P A R E D F O R :

P L A C E L O G O

H E R E

THANK YOU!

S IGN UP FOR A TR IAL AT:

s i gna l f x . com