nelson: automated multi-region container deployment

50
Nelson automated, multi-region container deployment

Upload: timothy-perrett

Post on 21-Jan-2018

1.214 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Nelson: Automated multi-region container deployment

Nelsonautomated, multi-region container deployment

Page 2: Nelson: Automated multi-region container deployment

Hello.!

verizon.github.io/nelson/

Page 3: Nelson: Automated multi-region container deployment

Problem• Provisioning applications is still too slow (bare metal or cloud).

• Runtime traffic control systems are medieval at best.

• Coupling CI and CD creates monolithic operational systems.

• These systems do everything. This is a distinct problem.

• Current market solutions limited or hard to adopt.

• Most teams have brittle, painful automation nobody wants to use.

• Many teams attempt CD ignorant of the side-effects.

Page 4: Nelson: Automated multi-region container deployment

Lessons• Automate every part of the system.

• Testing a distributed system locally is a fable.

• Emergent properties. Scaling issues etc.

• Uniformity is highly desirable and wildly advantageous.

• Beautiful, unique snowflakes are however, inevitable.

• Automated lifecycle management is required.

Page 5: Nelson: Automated multi-region container deployment

Goals• Use the minimally powerful components.

• System elements should be awesome at just one thing.

• Reduce overall platform complexity.

• Increase responsibility of engineering teams. Break it, you bought it.

• Decentralize process gatekeepers.

• No build team. No ticket filing for deployments. No configuration management.

Page 6: Nelson: Automated multi-region container deployment

Goals• All application specifications are checked in.

• Build. Deployment. Alerting etc.

• Reduce deployment time 2 minutes or less.

• Support multi-DC topologies from the get-go.

• Automatic credential management and secure-introduction

• Transparent, strong encryption for application I/O on the wire.

Page 7: Nelson: Automated multi-region container deployment

Build Better.

Page 8: Nelson: Automated multi-region container deployment

Nomad.

Page 9: Nelson: Automated multi-region container deployment

Nomad• Use a farm of servers as a single resource pool: RAM, CPU, etc

• Typically used at larger scale, becoming more common.

• Blazing fast: only placement without provisioning.

• Integration with Vault, so secure-introduction works OOTB.

• Monolithic resource manager & scheduler [1]

• Several open-source & commercial alternatives: Mesos, k8s etc[1] https://research.google.com/pubs/pub43438.html

Page 10: Nelson: Automated multi-region container deployment

Envoy.

Page 11: Nelson: Automated multi-region container deployment

Envoy• Fast L4 and L7 proxy solving many practical ops concerns.

• Open-sourced end of 2016; blossomed since.

• Lyft, Google, IBM et al all actively contributing.

• Make applications dumb; invest in a single element of routing infra

• Retries, Circuit Breaking, TLS Encryption etc

• Integrate horizontally, not vertically

• Integrate with whatever discovery system you want via APIs.

Page 12: Nelson: Automated multi-region container deployment

Nelson.

Page 13: Nelson: Automated multi-region container deployment

– Vice Admiral Horatio Nelson, 1758-1805

“Desperate affairs require desperate remedies.”

Page 14: Nelson: Automated multi-region container deployment

– Vice Admiral Horatio Nelson, 1758-1805

“Desperate affairs require desperate remedies.”

#opslife

Page 15: Nelson: Automated multi-region container deployment

Overview• Github driven developer workflow (.com or enterprise).

• Choose whatever build / CI system you want.

• State of the art runtime routing via Envoy.

• Secure introduction for safe distribution of credentials from Vault.

• Integrated with Nomad; target any datacenter running a scheduler.

• Integrated alert definition with Prometheus.

Page 16: Nelson: Automated multi-region container deployment
Page 17: Nelson: Automated multi-region container deployment

Lifecycle.Deployment is the easy part.

Page 18: Nelson: Automated multi-region container deployment
Page 19: Nelson: Automated multi-region container deployment

based on consul

Page 20: Nelson: Automated multi-region container deployment

typical state

Page 21: Nelson: Automated multi-region container deployment

user activated

Page 22: Nelson: Automated multi-region container deployment

pending GC

Page 23: Nelson: Automated multi-region container deployment

pluggable

Page 24: Nelson: Automated multi-region container deployment

borrowed time

Page 25: Nelson: Automated multi-region container deployment

garbage collection

Page 26: Nelson: Automated multi-region container deployment

Graph Pruning

Page 27: Nelson: Automated multi-region container deployment

XX

Upgraded!

Page 28: Nelson: Automated multi-region container deployment

last two major revsXX X

Page 29: Nelson: Automated multi-region container deployment

last two featuresXX X

Page 30: Nelson: Automated multi-region container deployment

Namespaces.

Page 31: Nelson: Automated multi-region container deployment

machines

Page 32: Nelson: Automated multi-region container deployment

scheduler

Page 33: Nelson: Automated multi-region container deployment

namespaces

Page 34: Nelson: Automated multi-region container deployment

namespaces

entirely virtual!

Page 35: Nelson: Automated multi-region container deployment
Page 36: Nelson: Automated multi-region container deployment

root namespace

Page 37: Nelson: Automated multi-region container deployment

qa/unstable

Page 38: Nelson: Automated multi-region container deployment

qa/staging/tim

Page 39: Nelson: Automated multi-region container deployment
Page 40: Nelson: Automated multi-region container deployment

Discovery & Routing.

Page 41: Nelson: Automated multi-region container deployment

Discovery.• Discovery protocol written to Consul KV for every stack

• We call this Lighthouse protocol

• Application dependencies are declared a-priori.

• You cannot route to that which you do not tell Nelson about.

• Makes for awesome auditing and security.

• Language implementations need only consume the protocol.

Page 42: Nelson: Automated multi-region container deployment

Routing.• Non-prescriptive approach to routing tier implementation.

• Provides a control plane protocol describe routing actions.

• Typically implemented with Envoy, but you can choose.

• Minor application changes required.

• Incentivized these with tracing and context propagation.

• Models traffic shifting as a time vs traffic policy curve.

Page 43: Nelson: Automated multi-region container deployment
Page 44: Nelson: Automated multi-region container deployment

http://timperrett.com/2017/05/13/nomad-with-envoy-and-consul

embeded envoy

Page 45: Nelson: Automated multi-region container deployment

http://timperrett.com/2017/05/13/nomad-with-envoy-and-consul

sidecar envoy

Page 46: Nelson: Automated multi-region container deployment

http://timperrett.com/2017/05/13/nomad-with-envoy-and-consul

host-based envoy

Page 47: Nelson: Automated multi-region container deployment

Challenges• Non-trivial level of investment and execution.

• Tight integration with Hashistack is both pro or con.

• Containerizing legacy applications can be “interesting”.

• Migration can be a challenge if not collocated with “the new world”.

• Small organizations better served by existing solutions.

Page 48: Nelson: Automated multi-region container deployment

Future Work• Aim to open-source supporting and complimentary tools.

• Consul / Envoy integration. Cost analysis subsystem.

• Make Nelson easier to extend for third-parties

• eDSL for workflows, externalize policy algebra

• General “plugin” system is a possibility

• Listen to the community feedback.

Page 49: Nelson: Automated multi-region container deployment

Summary• Fully automated application lifecycle: no manual housekeeping.

• Choose whatever CI setup best fits your team.

• Secure your deployments.

• Transparent mTLS and rotating credentials.

• Automatic Vault policy management.

• Provide rigor to your application Death Star.

Page 50: Nelson: Automated multi-region container deployment

EOFtimperrett

verizon.github.io/nelson/