1
DeveloperFirstWorkflowsonKubernetes
(adoptingmicroservicestogofaster)
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
Howdoyouadoptadistributed
developmentprocess?
8
Startbycreatinganindependentprocess!
(withafrom-scratchAPIservice)
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.
Givethedeveloper/devteamtheabilitytoSUCCESSFULLY
operateindependently.
10
Wait!DoIhavetobuildthese
capabilitiesfromscratch?
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
Gettingstartedwithmicroservices,
usingKubernetes,Docker,andEnvoy.
5 Analyze metrics.
16
Prototyping
workflow
Production
workflow
Yourdeveloper-firstworkflowforbuilding1service.
1 Bootstrap the service.
2 Code.
3 Run your code (in a dev Kube cluster).
4 Deploy to production Kubernetes cluster.
17
Howdoyoumaximize
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 locally
Run 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.
D
Update 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
Yourarchitecturefordistributeddevelopment.
EnvoyMonolith
Service
Auth
• Canary routing
• Authentication
• URL mapping
• L7 observability
Makingyourorganizationfaster.
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
Asample,multi-serviceapplication.
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!

DevOps Days Boston 2017: Developer first workflows for Kubernetes

  • 1.
  • 2.
    How do youship better (cloud) software faster?
  • 3.
  • 4.
    4 Take the standarddevelopment process: Code (Dev) Test (QA) Prod (Ops) Release (Release) Define (Product)
  • 5.
    5 … and makeit 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.
    6 Microservices is adistributed development process for cloud-native software. > Not an architecture! Your architecture supports the process, and not the other way around.
  • 7.
  • 8.
  • 9.
    9 1. Self-sufficiency. Eachteam 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. Givethedeveloper/devteamtheabilitytoSUCCESSFULLY operateindependently.
  • 10.
  • 11.
    11 • Massive communityand ecosystem • 14M Docker hosts • 3300+ contributors • Lots of third party tools • Build, package, and deploy your service (and dependencies!) in a consistent way
  • 12.
    12 • Massive communityand 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.
    13 • Fast growingcommunity 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.
    14 1. Microservices isa 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.
  • 16.
    5 Analyze metrics. 16 Prototyping workflow Production workflow Yourdeveloper-firstworkflowforbuilding1service. 1Bootstrap the service. 2 Code. 3 Run your code (in a dev Kube cluster). 4 Deploy to production Kubernetes cluster.
  • 17.
  • 18.
  • 19.
    19 1 Bootstrap theservice 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
  • 20.
    Realism: How closelydoes 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 locally Run 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.
    21 3 Deploy todevelopment 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.
    22 4 Deploy toproduction 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 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.
    23 5 Analyze metrics. ADeploy 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.
  • 25.
    Makingyourorganizationfaster. Team A TeamB Team C 1 2 3 4 5 1 2 3 4 5 1 2 3 4 5
  • 26.
    26 1. Microservices isa 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.
  • 27.
  • 28.
  • 29.
  • 30.
    We have FEARLESSLYpushed a (buggy) update into production!
  • 31.
    31 1. Microservices isa 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.
    32 Thanks! Feedback/questions: richard@datawire.io Tutorial todo 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!