Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building PaaS on Kubernetes

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!

Jason Hansen

February 25, 2016
Tweet

More Decks by Jason Hansen

Other Decks in Technology

Transcript

  1. 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
  2. Simple CLI for: developer self service $ deis create Creating

    Application... done, created earthy-instinct Git remote deis added remote available at ssh://[email protected]: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 $
  3. 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 $
  4. 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 $
  5. 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 / $
  6. 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 }
  7. 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
  8. 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
  9. Kubernetes Kubernetes is a Cluster Manager Open Source Project Granted

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

    coupling via labels Name Resolution / Service Discovery Three Properties: What is Kubernetes?
  11. 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
  12. 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
  13. Kubernetes Declarative APIs Simple Abstractions Vibrant Community Informed by Years

    of Experience Promotes Loose Coupling Why Kubernetes?
  14. 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
  15. 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
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  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 Name: my-app-123hfa Labels: version=canary app=my-app Pod