DevOps Days Boston 2017: Developer first workflows for Kubernetes

Preview:

Citation preview

1

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

Richard Li

How do you ship better (cloud) software faster?

Microservices. (Multiple, asynchronous launches.)

4

Take the standard development process:

Code (Dev)

Test (QA)

Prod (Ops)

Release (Release)

Define (Product)

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

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.

7

How do you adopt a distributed development process?

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)

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.

10

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

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

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

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

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.

15

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

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.

17

How do you maximize productivity?

SPEED.(self sufficiency)

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

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

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

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.

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.

24

Your architecture for distributed development.

EnvoyMonolith

Service

Auth

• Canary routing • Authentication • URL mapping • L7 observability

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

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.

SAFETY.

28

A sample, multi-service application.

Envoy

Tasks

Search

Auth

29

<demo>

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

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.

32

Thanks!

Feedback/questions: richard@datawire.io

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!

Recommended