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

Knative, the why, what, and how of Serverless on Kubernetes

Mark Chmarny
February 26, 2019

Knative, the why, what, and how of Serverless on Kubernetes

Knative (pronounced kay-nay-tiv) is a project created by Google. It provide a set of middleware components that are essential to build modern, source-centric, and container-based applications on Kubernetes, whether in the Cloud, on premises, or even in a third-party data center. This presentation overviews drivers for the Knative projects, it's current community, features, and capabilities.

Mark Chmarny

February 26, 2019
Tweet

More Decks by Mark Chmarny

Other Decks in Technology

Transcript

  1. Knative, the why, what, and how of Serverless on Kubernetes

    Mark Chmarny @mchmarny Technical Program Manager Google
  2. Kubernetes The de facto platform

  3. *Sources: COCOMO Model, CNCF.io Certified Providers 442 Years of effort*

    5,000+ Contributors 47k+ GitHub stars Kubernetes ecosystem
  4. Kubernetes handless... Scheduling Decide where my containers should run Lifecycle

    and health Keep my containers running despite failures Scaling Make sets of containers bigger or smaller Naming and discovery Find where my containers are now Load balancing Distribute traffic across a set of containers Storage volumes Provide data to containers Logging and monitoring Track what’s happening with my containers Debugging and introspection Enter or attach to containers Identity and authorization Control who can do things to my containers
  5. Photo by Erik Wilde, Licensed under CC BY-SA 2.0 Smooth

    surfaces
  6. Serverless On Kubernetes

  7. Serverless > Function

  8. Serverless > Compute Serverless > Function

  9. Serverless usage models Portable No servers Pay only for usage

    Event-driven developer perspective
  10. Serverless usage models Portable No servers Pay only for usage

    Event-driven developer perspective
  11. >13 “Serverless Platforms” OSS FaaS/PaaS/CaaS... most Kubernetes-based or migrating to

  12. Serverless stack Invokers Event Binding Kubernetes Platform Products Primitives Autoscaling

    Observability Build Routing ... DX Event Sources Runtimes ,,,
  13. Serverless stack Invokers Event Binding Kubernetes Platform Products Primitives Autoscaling

    Observability Build Routing ... DX Event Sources Runtimes ,,, Duplication of efforts Decreased portability Opportunity Lost
  14. Knative Serverless Ingredients

  15. Knative Kubernetes based open source building blocks for serverless [kay-native]

  16. • Set of primitives (build, events, serving...) • Solves for

    modern development patterns • Implements learnings from Google, partners • Ingredient or platform for Serverless github.com/knative Knative project
  17. • Wakes up workloads (activates) on request • Scales workloads

    up/down based on requests (0 pods when no use) • Turns developer app/function into a container/live URL (transparent build) • Collects runtime metrics and exports user-space telemetry • Automatically handles revision of code+config (rolls back if needed) • Can split traffic and enable gradual rollouts • Includes eventing system with configurable sources (triggers) Knative functionality
  18. Abstracts operational complexity, smooth infrastructure surface Universal supported by all

    major Cloud providers, enables portability Extendable platform with clear separation of concerns between operator and developer Knative for operator
  19. Want to Write code Don’t have to Build docker image

    Upload image to registry Deploy service Expose to the internet Setup logging & monitoring Scale workload... Knative for developer
  20. Knative launch partners

  21. Knative community enabled Build Serving Kubernetes Platform Products Primitives Events

    ... Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Pivotal riff TriggerMesh T-mobile Jazz
  22. “With Kubernetes, SAP Cloud Platform is making it easy for

    customers to embrace multi-cloud application development and deployment. Knative further enables SAP to accelerate enterprise-grade serverless and event-based applications. SAP Kyma is the first open source project being a lighthouse application for SAP on Knative.” Michael Wintergerst Vice President, SAP Knative impact
  23. “IBM Cloud is built on open technology, and the future

    of cloud will be created in the open. Combining what we’ve learned from the creation of Apache OpenWhisk, building serverless projects for enterprises, and our experience with Kubernetes and Istio, we plan to evolve Knative to bring serverless to a wider range of applications, developers and industries than ever before.” Jason McGee IBM Fellow and CTO, IBM Cloud Knative impact
  24. “Red Hat’s focus on the hybrid cloud is rooted in

    customer choice and we carry that same perspective to our work to make hybrid serverless a reality. By joining the Knative community, we are combining our deep enterprise Kubernetes and open source expertise to help create a common building block for serverless on top of Kubernetes across the hybrid cloud.” Chris Wright Red Hat Vice President and Chief Technology Officer Knative impact
  25. "We believe in providing choice for our internal customers (developers)

    who are building and deploying cloud native applications. And with Knative, we have been able to rapidly integrate Kubernetes-based building blocks in Jazz, our own open-source serverless toolchain. Knative and Kubernetes and Jazz are working beautifully together to accelerate T-Mobile's move to cloud native applications." Nicolas Criss Sr. Manager - Cloud Center Of Excellence, T-Mobile Knative value, today
  26. Knative in Action (aka demo time)

  27. Knative serving Benefits • Seamlessly scale up and down •

    Built-in traffic splitting between revisions • Integrates networking and service mesh automatically • Easy to reason about object model Pluggable • Connect to your own logging and monitoring platform, or use the built-in system • Auto-scaler can be tuned or swapped out for custom code
  28. Demo: Simple to start with (CLI or manifest)

  29. Confidential & Proprietary Knative Serving Primitives Knative Service High level

    abstraction for the application Configuration Current/desired state of an application Code & configuration separated (a la 12-factor) Revision Point in time snapshots for your code and configuration Route Maps traffic to revisions
  30. Knative on-cluster build Benefits • No cross-compiling toil • No

    need for Docker locally • Cloud caching, faster image push • Tooling ecosystem for Enterprise Policy to audit Builds Loosely coupled • Use it to get started, and graduate to decoupled CI • Keep your existing CI/CD to get started, and graduate to audited Builds
  31. Demo: Developer just want to write code (Src-to-URL, git-ops)

  32. Demo: Live workload update under load (Blue/green, Canary release)

  33. Demo: Autoscaling under load (1-n, n-0)

  34. Knative eventing Benefits • Declaratively bind between event producers and

    deployed services • Scales from just few events to live streams • Custom event pipelines to connect with your own existing systems
  35. Demo: Eventing on external trigger (IoT stream processing)

  36. Confidential & Proprietary Knative Eventing What is it? For loosely

    coupled, event-driven services Declaratively bind between event producers and Knative services Scales from just few events to live streams Custom event pipelines to connect with your own existing systems Event type Flow Event source Event type Event type Event consumer(s) KubernetesEventSource GitHubSource GcpPubSubSource AwsSqsSource ContainerSource CronJobSource
  37. Confidential & Proprietary Knative Eventing

  38. Knative value, today 1-step deploy Build & deploy with less

    config/code Source to container safely in your cluster Manage workloads Automatically deploys containers and provision ingress Go from source to URL Auto-scale Auto-scale your stateless container based workloads Scale down to zero
  39. Knative Principled Objects

  40. Knative defines primitives with clear separation of concerns Service, lite

    version of Knative objects spec: container: image: gcr.io/knative-samples/simple-app:latest env: - name: SIMPLE_MSG value: "Hello GCP Next 2018!" Service Knative, principled serving objects
  41. Configuration Service Knative, principled serving objects Knative defines primitives with

    clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor)
  42. Revision Configuration Service Knative, principled serving objects Knative defines primitives

    with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor) Revision Point in time snapshots for your code and configuration
  43. Revision Route Configuration Service Knative, principled serving objects Knative defines

    primitives with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor) Revision Point in time snapshots for your code and configuration Route Maps traffic to a revisions Supports fractional, named routing
  44. Eventing constructs : • Event Sources (producer) • Channel (pipelines)

    • Subscription (configuration) Event type Flow Event source Event type Event type Event consumer(s) Knative, principled eventing objects Warning: volatile development area!
  45. Install, Samples, Docs github.com/knative/docs GKE add-on g.co/serverlessaddon Want to contribute?

    knative/docs/community Have questions? knative.slack.com Anything else? @mchmarny Knative, ready for you
  46. Thank you.