Save 37% off PRO during our Black Friday Sale! »

Building PaaS on Kubernetes

Db60ccd5a0d573877760f059202d06ed?s=47 Jason Hansen
February 25, 2016

Building PaaS on Kubernetes

Presentation given at the Cloud Native Apps meetup in San Francisco on 2/25/2016 (http://www.meetup.com/Cloud-Native-Apps-SF/events/228647337/)

With bonus material on Kubernetes label selectors!

Db60ccd5a0d573877760f059202d06ed?s=128

Jason Hansen

February 25, 2016
Tweet

Transcript

  1. Jason Hansen jhansen@deis.com @slackX deis.com | github.com/deis/workflow

  2. What is Deis? Open Source, container-based Platform as a Service

    Quickly and easily application deploy. Small footprint, easy to deploy. Developers Operations Supports multiple language buildpacks. Native support for Dockerfile
 and Docker Image applications. Composable architecture
 allows simple customization. Supports bare metal,
 public and private clouds. github.com/deis/workflow
  3. Simple CLI for: developer self service $ deis create Creating

    Application... done, created earthy-instinct Git remote deis added remote available at ssh://git@deis.beef.slack.io:2222/earthy- instinct.git $ git push deis master Starting build... but first, coffee! -----> Go app detected -----> Checking Godeps/Godeps.json file. -----> Installing go1.4.2... done -----> Running: godep go install -tags heroku ./... -----> Discovering process types Procfile declares types -> web -----> Compiled slug size is 1.7M Build complete. Launching app. Done, earthy-instinct:v2 deployed to Deis $
  4. Simple CLI for: scaling and configuration $ deis scale web=5

    Scaling processes... but first, coffee! done in 4s === earthy-instinct Processes --- web: earthy-instinct-v2-web-5ouqz up (v2) earthy-instinct-v2-web-afulr up (v2) earthy-instinct-v2-web-ct7ri up (v2) earthy-instinct-v2-web-wydts up (v2) earthy-instinct-v2-web-nqxvm up (v2) $ deis config:set POWERED_BY=Kubernetes Creating config... done === earthy-instinct Config POWERED_BY Kubernetes $
  5. Simple CLI for: release and rollback $ deis releases ===

    earthy-instinct Releases v3 2016-02-20T23:12:34UTC jhansen added POWERED_BY v2 2016-02-20T23:07:35UTC jhansen deployed acaa8a5 v1 2016-02-20T23:07:09UTC jhansen created initial release $ deis rollback Rolling back one release... done, v4 $ deis releases === earthy-instinct Releases v4 2016-02-20T23:13:53UTC jhansen rolled back to v2 v3 2016-02-20T23:12:34UTC jhansen added POWERED_BY v2 2016-02-20T23:07:35UTC jhansen deployed acaa8a5 v1 2016-02-20T23:07:09UTC jhansen created initial release $
  6. Simple CLI for: logs $ deis logs earthy-instinct-v4-web-ppog6 -- 2016/02/20

    23:18:03 10.2.62.0 GET / earthy-instinct-v4-web-ilcwj -- 2016/02/20 23:18:04 10.2.47.0 GET / earthy-instinct-v4-web-ilcwj -- 2016/02/20 23:18:04 10.2.62.0 GET / earthy-instinct-v4-web-hhvum -- 2016/02/20 23:18:04 10.2.29.1 GET / earthy-instinct-v4-web-hhvum -- 2016/02/20 23:18:05 10.2.47.0 GET / earthy-instinct-v4-web-ppog6 -- 2016/02/20 23:18:05 10.2.29.1 GET / earthy-instinct-v4-web-ilcwj -- 2016/02/20 23:18:06 10.2.47.0 GET / earthy-instinct-v4-web-ilcwj -- 2016/02/20 23:18:06 10.2.29.1 GET / earthy-instinct-v4-web-ppog6 -- 2016/02/20 23:18:06 10.2.47.0 GET / earthy-instinct-v4-web-ppog6 -- 2016/02/20 23:18:07 10.2.47.0 GET / $
  7. How does Deis work?

  8. Virtual Infrastructure Layer 2 Physical Infrastructure Layer 1 Operating System

    Layer 3 Container Engine Layer 4 Scheduling Layer 5 Orchestration Layer 6 Workflow Layer 7 }
  9. Compute: Cloud / Bare Metal Provisioning Compute OS Scheduling Orchestration

    Workflow Software Defined Networking Software Defined Storage } Container Image Registry Customer App CI Container Runtime Containers Image Simple REST API Authn / Authz Edge Routing Release and Rollback Log Aggregation Source to Image Alerting Monitoring Containers Image App Definition Service Binding
  10. Fleet Swarm Mesos K8S Resource
 Aware No Yes Yes Yes

    Maturity 1.0 1.0 Very 1.1 Scale 3-25 (etcd2) 1000* 1000+ 100+ Resource
 Reqs. Small Small Large Small / Medium Community Medium Small Large Large / Growing Complexity Low Low High Medium Deis v1 Deis v2
  11. Kubernetes Kubernetes is a Cluster Manager Open Source Project Granted

    to CNCF by Google https://github.com/kubernetes/kubernetes What is Kubernetes?
  12. Kubernetes Kubernetes is a Cluster Manager. Dynamic container placement Loose

    coupling via labels Name Resolution / Service Discovery Three Properties: What is Kubernetes?
  13. Public / Private Cloud / Bare Metal Kubernetes Deis Workflow

    + Kubernetes: Overview Simple REST API Source to Image Builder Log Aggregation Application Release & Rollback Authn / Authz Edge Routing Deis Workflow Developers deis CLI git push deis master Operators deisctl CLI Helm kubectl
  14. Public / Private Cloud / Bare Metal Deis Managed App

    C Deis Managed App D Deis Managed App B Kubernetes Workload A Kubernetes Workload B Kubernetes Workload C Kubernetes Workload D Deis Workflow + Kubernetes: Detail Package Management HELM Deis Workflow & Managed Apps Simple REST API Source to Image Builder Log Aggregation Application Release & Rollback Authn / Authz Edge Routing Kubernetes Cluster Operators deisctl CLI Helm kubectl Developers deis CLI git push deis master
  15. Kubernetes Declarative APIs Simple Abstractions Vibrant Community Informed by Years

    of Experience Promotes Loose Coupling Why Kubernetes?
  16. namespace=deis deis-router LoadBalancer: AWS ELB: 80, 443, 2222 namespace=app-a SVC:

    app-a Pod: app-a-v1-b Pod: app-a-v1-a RC: app-a-v1 deis-database deis-workflow deis-minio deis-registry deis-builder deis-etcd Kubernetes Cluster
  17. DEMO TIME!

  18. Questions?

  19. https://github.com/deis/workflow Beta Soon! Release EO Q1

  20. HTTPS://HELM.SH

  21. None
  22. Kubernetes Service Development Timeline Replication Controller: v1 App Pod App

    Pod Release 1 Re Deis Workflow Edge Routing + SSL Termination Deis Workflow: Deploying to Kubernetes Customers Application Requests Developers git push deis master
  23. Kubernetes Service Development Timeline Replication Controller: v1 App Pod App

    Pod Release 1 Replication Controller: v2 App Pod App Pod Release 2 Re Deis Workflow Edge Routing + SSL Termination Deploying to Kubernetes
  24. Kubernetes Service Replication Controller: v1 App Pod App Pod Release

    1 Replication Controller: v2 App Pod App Pod Release 2 Replication Controller: v3 App Pod App Pod Release3 w nation bernetes
  25. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod
  26. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    1 Label Selectors: version=2 app=my-app ReplicationController Replicas: 2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod
  27. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    1 Label Selectors: version=2 app=my-app ReplicationController Replicas: 2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod Name: my-app-19sdfd Labels: version=2 app=my-app Pod
  28. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    2 Label Selectors: version=2 app=my-app ReplicationController Replicas: 1 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-19sdfd Labels: version=2 app=my-app Pod Name: my-app-xaj712 Labels: version=2 app=my-app Pod
  29. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    2 Label Selectors: version=2 app=my-app ReplicationController Replicas: 0 Label Selectors: version=1 app=my-app Name: my-app-19sdfd Labels: version=2 app=my-app Pod Name: my-app-0q2a87 Labels: version=2 app=my-app Pod
  30. Name: my-app-xaj712 Labels: version=1 app=my-app Pod

  31. ReplicationController Replicas: 2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels:

    version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod
  32. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod
  33. Service: My App Name: my-app Label Selectors: app=my-app ReplicationController Replicas:

    2 Label Selectors: version=1 app=my-app Name: my-app-xaj712 Labels: version=1 app=my-app Pod Name: my-app-lka2ja Labels: version=1 app=my-app Pod Name: my-app-123hfa Labels: version=canary app=my-app Pod