cont ntaine ner pods w ds with h do dock cker c compose
play

Cont ntaine ner Pods w ds with h Do Dock cker C Compose se - PowerPoint PPT Presentation

Cont ntaine ner Pods w ds with h Do Dock cker C Compose se in A n Apa pache che Me Meso sos 1 Summary Goals: 1. Treating Apache Mesos and docker as first class citizens, the platform needs to seamlessly run and scale docker


  1. Cont ntaine ner Pods w ds with h Do Dock cker C Compose se in A n Apa pache che Me Meso sos 1

  2. Summary Goals: 1. Treating Apache Mesos and docker as first class citizens, the platform needs to seamlessly run and scale docker container pods in Mesos with a standardized pod spec file. 2. Developers can develop and run the pod locally using a spec file and then use the same spec file to launch it in a QA/Production cluster. Solution: Docker Compose Mesos Executor (https://github.com/PayPal/dce-go)

  3. What are Pods? Pod ods rep epres esen ent a a collec llectio ion of c contain iner ers trea eated ed as a sin ingle u le unit it for s sched edulin ling and • dep eplo loymen ent. Pod ods are t e trea eated ed as s sin ingle le scalin ling unit it. • Contain iner ers in in Pod ods will ill gen ener erally lly share o e one o e or m more e names espaces es: n net etwork, pid, , ip ipc etc tc • Cont ontaine ners in P n Pods ds shou hould d ha have a c com ommon on cgr grou oup to be e kep ept u under er c chec eck k as a a unit it t to • not not s steal resou ources f from om ot othe her p pods ds i in n the he hos host. Col olocation u on using ng cons onstraint nts ! != Pod •

  4. Why are Pods needed? Migr grating ng lega gacy w wor orkloa oads ds runni nning ng in n a s singl ngle no node de. •  Lift and s and shi hift.  Gives ti es time e to to ex extr tract c t common ser services es duplicated ted in ea each pod into to a a s system stem ser service e whe hen r n relevant ant. Po Pods help elps t to crea eate a e a mod odula lar a applic licatio ion b by c composin ing dif iffer eren ent s ser ervic ices es. •  Si Side-car, Ad Adapter ter, Am Ambassa ssador a are c e common p patter tterns Po Pods help elps elim elimin inate e pre e and p post d dep eplo loymen ent s step eps. •  Hel elps m s model el tr transi sien ent sh t short ta t task sks s (sh short l t lived ed c conta tainer ers) s)

  5. Docker Compose Compose e is is a a eleg elegant t too ool l for d def efin inin ing and runnin ing mult ltip iple le doc ocker er cont ontaine ners. • Cher eris ished ed too ool in l in the c e communit ity over er the y e yea ears for loc local l dev evelo elopmen ent. • Versi sion 2. 2.X X pres eser erves es stric ictly ly all ll the loc e local l fea eatures es. In t this is v ver ersio ion, it it in inter eracts wit ith a a • sin ingle le doc ocker er en engin ine, e, m mostly ly runnin ing loc locally lly. Version 3 on 3.X int ntrodu duces com ompos ose f for or doc ocker er swa warm and d deprecates cer ertain in f fea eatures es of of • 2.X .X. . For n now, , they remai main as as 2 separ arat ate v version trac acks.

  6. Pods Modelled in Docker Compose Pod ods are e contain iner ers bundled led toget ether er loc locally lly. S So, r relies elies on ver ersio ion 2.x c compose e • version. on. Pod ods rep epres esen ented ed by c compose e can pres eser erve a e all ll the e fir irst c cla lass doc ocker er vol olume a and nd • ne networ ork pl plugi gins ns. Pod ods can have f e flex lexib ibili ility on colla llapsin ing names espaces es in in a any c combin inatio ion bet etween een the e • cont ontaine ners. Cont ontaine ners in n Pods ds c can n ha have strict or orde dering g ng guarant ntees by by using c ng condi onditiona onal • cons onstructs of of de depends nds_on on. Pod ods can ref efer er to ex exter ernally lly crea eated ed v volu lumes es a and n net etworks ks. • Mult ltip iple le files iles can b be e mer erged ed to c construct the r e rig ight p pod od d def efin init itio ion f for a an en envir ironmen ent. • Ex: b x: bas ase, , qa, p prod od compose e files iles. Easy to s spawn mult ltip iple le pod ods o of s same e applic licatio ion wit ith d dif iffer eren ent ver ersio ions in in same e loc local l • env nvironm onment nt w withou hout c conf onflicts.

  7. Mesos Architecture

  8. Mesos Key Abstractions Framework Offer (Resources) Task/Executor Master Resources Task/Executor Agent Executor Executor Task Task Task

  9. Docker Compose Executor in Mesos Mesos Agent Mesos Containerizer Cgroups MEM Isolator Launcher Cgroups CPU Isolator Docker Compose Executor Task (Docker Container Pod spawned as Child Cgroup of Parent Cgroup) Mesos Parent Cgroup Container

  10. Cgroup Hierarchy Each cont ontaine ner in n pod ha d has a a chi hild d cgr grou oup unde nder t the he pa parent nt mesos os task sk cgr grou oup. M Meet eets • Pod od crit iter eria ia of c contain iner ers in in p pod od sharin ing a cgr grou oup. Cgr grou oups ps CFS ha hard d limits ( (ba bandw ndwidt dth h cont ontrol ols) and nd memor ory limits a assigne gned d to o the he • pa parent nt cgr grou oups ps will ill cover er all c ll contain iner ers in in pods. Indiv ivid idual l cont ontaine ners will n ill not be lim e limit ited ed unles less spec ecif ified ied b but cannot nnot go go over pa parent nt. • Make ke sure e to en enable m le mem emory h hier ierarchy wit ith use_hi hierarchy hy flag. g. •

  11. DCE-GO features Implem lemen ents mesos os ex exec ecutor c callb llbacks ks to m main intain in the lif e lifec ecycle le of a a pod od. • Massa ssages c s compose se f file to add cgr grou oup par arent, , mesos os la labels els a and ed edit it cer ertain in sec ectio ions to • resol olve a any ny na naming ng conf onflict etc tc Colla llapses es n net etwork k name amespac ace by d defau ault. • Provid ides es pod od m monit itor to not only ly kill kill en entir ire e pod od o on u unex expec ected ed contain iner er ex exit it but • also w o whe hen n a cont ontaine ner becom omes unhe nhealthy hy as p per doc ocker er hea ealt lthchec ecks ks. Supports runnin ing m mult ltip iple le compose f e files iles. • Mesos os Mod odule le provid ided ed t to p prev even ent pod od lea leaks ks in in r rare e case o e of ex exec ecutor crashes es. • Pro rovi vides pl plugi gins ns. • Last bu but not not the he least any ny e existing ng Mesos os Fra ramework rks like A Auro rora ra, Ma Mara rathon etc tc can n • use D e DCE dir irec ectly ly wit ithout makin king A ANY f framew ework k changes es.

  12. PLUGINS 12

  13. What are Plugins? Plu Plugin ins p provid vides a wa way to ea easily ext extend end inner nner wo working ngs of DCE. E. • Plug ugins ca can be us used to cus customi mize DCE w E with thout t ha having ng t to und nder erstand nd exa exactly • how ow DCE E is i implem ement ented ed int nter erna nally. P Plugins ns m make e it ea easy t to exp exper eriment ent with th new fe featu ture res. s. Plugin n mec echa hani nism hel helps y you ea easily ena enable a e and nd disable f e fea eatures es. • Plu Plugin ins essentia iall lly p y provid vide ho hooks b bef efore e and nd a after er launc nch/k h/kill task me mesos • callb llbacks ks to imp mpleme ment cus custom m behavio vior. Plugins ns c can n be e cha hained ned wi with o h order ering ng. •

  14. Default Plugin DCE CE-GO c comes es wi with d h def efault Gener eneral Plugin. n. Thi his Plugin n updates es compose e files es so so th that m t multi tiple pods s are re a able to to launch o on a host st. I It t larg rgely covers fo rs following: Decora rate te vari rious s compose se se secti tions to s to re reso solve a all th the confl flicts. ts. • Label el ea each h cont ntainer ner wi with s h spec ecific ta task skId and execut cutorId. . This is in informatio ion is is • used d to clean an u up p pod. d. Addi dding p g pod d to par parent me mesos ta task sk cg cgroup up. • Cre reati ting infra frastru structu ture re conta tainer r in p pod fo for a r allowing to to c collapse se n netw twork rk • na names espace e for c cont ntainer ners in n a p pod.

  15. Mesos Hook Module for Compose Pods Me Mesos os Modules es hel help ext extend end inner nner func nctiona nality using ng s sha hared ed libs. Ca Can r n run i n in n • Maste ster a r and/or Ag r Agent. Me Mesos os Module les s should ld b be b built ilt again inst the me mesos ver ersion r n runni nning ng i in c n cluster er. • Dif Different cla lassif ific icatio ion of M Module les: A : Allo llocator, , Isola lator, , Ho Hooks etc tc • Hooks Modules es tie e int nto ev event ents a and nd thei heir cont ntext ext. D DCE CE-GO O leverages es • ex exec ecutor r rem emoval ev event ent ho hook in a n an a n agent ent. Implem ement ents Co ComposeP ePodCl Clea eanu nupHook Module le. Tha hat ho hook ens ensures es p pods are c e clea eaned ned u up on n any ny unexp nexpec ected ed ex exec ecutor crash. h. •

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend