devops days boston 2017: developer first workflows for kubernetes

32
1 Developer First Workflows on Kubernetes (adopting microservices to go faster) Richard Li

Upload: datawire

Post on 21-Jan-2018

301 views

Category:

Software


0 download

TRANSCRIPT

Page 1: DevOps Days Boston 2017: Developer first workflows for Kubernetes

1

Developer First Workflows on Kubernetes (adopting microservices to go faster)

Richard Li

Page 2: DevOps Days Boston 2017: Developer first workflows for Kubernetes

How do you ship better (cloud) software faster?

Page 3: DevOps Days Boston 2017: Developer first workflows for Kubernetes

Microservices. (Multiple, asynchronous launches.)

Page 4: DevOps Days Boston 2017: Developer first workflows for Kubernetes

4

Take the standard development process:

Code (Dev)

Test (QA)

Prod (Ops)

Release (Release)

Define (Product)

Page 5: DevOps Days Boston 2017: Developer first workflows for Kubernetes

5

… and make it distributed.

> No central release, test, dev cycle. Each person/team operates an independent development process. > Team needs to have the skills / knowledge to operate all aspects of the development process.

Service A Service B Service C

Page 6: DevOps Days Boston 2017: Developer first workflows for Kubernetes

6

Microservices is a distributed development process for cloud-native software.

> Not an architecture! Your architecture supports the process, and not the other way around.

Page 7: DevOps Days Boston 2017: Developer first workflows for Kubernetes

7

How do you adopt a distributed development process?

Page 8: DevOps Days Boston 2017: Developer first workflows for Kubernetes

8

Start by creating an independent process! (with a from-scratch API service)

New service

Monolith

independent process!!

(think spinning off a developer or dev team)

Page 9: DevOps Days Boston 2017: Developer first workflows for Kubernetes

9

1. Self-sufficiency. Each team needs to be self-sufficient in all aspects of the development cycle to avoid bottlenecks.

2. Safety. Since it’s hard to be an expert in every area of the development, need to insure an oops isn’t catastrophic.

Give the developer / dev team the ability to SUCCESSFULLY operate independently.

Page 10: DevOps Days Boston 2017: Developer first workflows for Kubernetes

10

Wait! Do I have to build these capabilities from scratch?

Page 11: DevOps Days Boston 2017: Developer first workflows for Kubernetes

11

• Massive community and ecosystem • 14M Docker hosts • 3300+ contributors • Lots of third party tools

• Build, package, and deploy your service (and dependencies!) in a consistent way

Page 12: DevOps Days Boston 2017: Developer first workflows for Kubernetes

12

• Massive community and ecosystem • 789 companies, 2505 developers • Google, Red Hat, Oracle, Microsoft

have embraced Kubernetes • 62% of K8S are on AWS • Mesosphere is embracing K8S on

DC/OS • Kubernetes is the cloud POSIX …

not just a container scheduler • Declarative definition of your cloud

infrastructure

Page 13: DevOps Days Boston 2017: Developer first workflows for Kubernetes

13

• Fast growing community and ecosystem • Lyft, Google, IBM, Verizon, Yahoo,

Datawire … • CNCF project

• Modern L7 proxy • Designed for distributed cloud

architectures (global rate-limiting, observability, circuit breakers, …)

• APIs for managing fleets of Envoy proxies

Page 14: DevOps Days Boston 2017: Developer first workflows for Kubernetes

14

1. Microservices is a distributed development workflow that helps you go faster.

2. Start your microservices journey by building an efficient workflow for your first services team, then your organization.

3. The Kubernetes ecosystem, Docker, and Envoy provide the foundational components you need to build that workflow.

Page 15: DevOps Days Boston 2017: Developer first workflows for Kubernetes

15

Getting started with microservices, using Kubernetes, Docker, and Envoy.

Page 16: DevOps Days Boston 2017: Developer first workflows for Kubernetes

5 Analyze metrics.

16

Prototyping workflow

Production workflow

Your developer-first workflow for building 1 service.

1 Bootstrap the service.

2 Code.

3 Run your code (in a dev Kube cluster).

4 Deploy to production Kubernetes cluster.

Page 17: DevOps Days Boston 2017: Developer first workflows for Kubernetes

17

How do you maximize productivity?

Page 18: DevOps Days Boston 2017: Developer first workflows for Kubernetes

SPEED.(self sufficiency)

Page 19: DevOps Days Boston 2017: Developer first workflows for Kubernetes

19

1 Bootstrap the service with a service template.

$ git clone $URL

todo/ Dockerfile # How do you build your code + container k8s/ # How should Kubernetes run your service tf/ # What non-Kubernetes resources need to be provisioned app.py # stub for your application service.yaml # Metadata about your service

Page 20: DevOps Days Boston 2017: Developer first workflows for Kubernetes

Realism: How closely does this mirror production?

Fast feedback cycle for developers

Low setup and maintenance cost for developers

Scalability as your application gets more complex

Run entire system locallyRun business logic

locally, cloud resources remote

Single service local, all other services remote All remote development

100% remote development100% local development

2 Code. Build a productive development environment.

Docker or Minikube

Telepresence + Kubernetes

Kubernetes + CI/CD

Set up local drivers to cloud resources

Page 21: DevOps Days Boston 2017: Developer first workflows for Kubernetes

21

3 Deploy to development Kubernetes cluster.

A Build a container image that contains your code, dependencies, and configuration, based on the Dockerfile.

B Tag the image.

C Push image to a container registry.

D Update Kubernetes manifest with tag.

docker build

docker tag

docker push

E Apply Kubernetes manifest to cluster.

Start with a Kubernetes manifest template, and instantiate the image tag (and other variables, too) into

the template.

kubectl apply

F Repeat for all dependencies.

e.g., other services

Page 22: DevOps Days Boston 2017: Developer first workflows for Kubernetes

22

4 Deploy to production Kubernetes cluster.

A Build a container image that contains your code, dependencies, and configuration, based on the Dockerfile.

B Tag the image.

C Push image to a container registry.

DUpdate Kubernetes manifest with production config data and update Envoy configuration for canary routing.

Keep the same environment & deploy process for dev/prod to eliminate environmental differences.

E Apply Kubernetes manifest to cluster.

F Repeat for all dependencies, including Envoy. Envoy deploys the same way as any other service.

Page 23: DevOps Days Boston 2017: Developer first workflows for Kubernetes

23

5 Analyze metrics.

A Deploy each service behind Envoy.

B

C Add additional service-specific metrics as appropriate.

Automatically measure L7 throughput, latency, and availability for the service via Envoy.

D Collect metrics in Prometheus or equivalent.

Page 24: DevOps Days Boston 2017: Developer first workflows for Kubernetes

24

Your architecture for distributed development.

EnvoyMonolith

Service

Auth

• Canary routing • Authentication • URL mapping • L7 observability

Page 25: DevOps Days Boston 2017: Developer first workflows for Kubernetes

Making your organization faster.

Team A Team B Team C

1

2

3

4

5

1

2

3

4

5

1

2

3

4

5

Page 26: DevOps Days Boston 2017: Developer first workflows for Kubernetes

26

1. Microservices is a distributed development workflow that helps you go faster.

2. Start your microservices journey by building an efficient workflow for your first services team, then your organization.

3. The Kubernetes ecosystem, Docker, and Envoy provide the foundational components you need to build that workflow.

4. To maximize productivity, optimize the loop. Make your workflow from source code to getting feedback as fast as possible — which means self-sufficiency.

Page 27: DevOps Days Boston 2017: Developer first workflows for Kubernetes

SAFETY.

Page 28: DevOps Days Boston 2017: Developer first workflows for Kubernetes

28

A sample, multi-service application.

Envoy

Tasks

Search

Auth

Page 29: DevOps Days Boston 2017: Developer first workflows for Kubernetes

29

<demo>

Page 30: DevOps Days Boston 2017: Developer first workflows for Kubernetes

We have FEARLESSLY pushed a (buggy) update into production!

Page 31: DevOps Days Boston 2017: Developer first workflows for Kubernetes

31

1. Microservices is a distributed development workflow that helps you go faster.

2. Start your microservices journey by building an efficient workflow for your first services team, then your organization.

3. The Kubernetes ecosystem, Docker, and Envoy provide the foundational components you need to build that workflow.

4. To maximize productivity, make your workflow from source code to getting feedback as fast as possible.

5. An efficient workflow lets teams be safely self-sufficient — letting them to move fast and not break things.

Page 32: DevOps Days Boston 2017: Developer first workflows for Kubernetes

32

Thanks!

Feedback/questions: [email protected]

Tutorial to do this yourself: http://www.datawire.io/guide/development/fast-develop-deploy-canary-workflow/

Open source tools for developers on K8S: https://www.datawire.io (Telepresence, Forge, Ambassador)

We’re hiring an OSS/C++ engineer to work on Envoy!