Serverless on your own terms using Knative at Knative Meetup by AT&T in LAX
My "Serverless on your own terms" preso from the Knative meetup in LAX hosted by AT&T - Knative Meetup: Intersection of Kubernetes and Serverless; Present and Future.
(up/down to 0) • Manages code/config revisions • Integrates service mesh (request path/services access control) • Supports custom domains and certificate management Pluggable • Connect with other GCP services like Cloud Build and Stackdriver • Extend with partner integrations like GitLab and Datadog
name) kubectl get revisions -n demo -l serving.knative.dev/service=mysrv NAME SERVICE NAME GENERATION READY REASON mysrv-qtz5p mysrv-qtz5p-service 2 True mysrv-vq25k mysrv-vq25k-service 3 True # List routes for specific service kubectl get routes -n demo -l serving.knative.dev/service=mysrv NAME DOMAIN READY REASON mysrv mysrv.demo.knative.tech True # Edit service route to point to specific revision # (status/traffic[n]/revisionName) kubectl edit route mysrv -n demo Knative Revision Demo Revision 1 Revision 2 Revision 3 Configuration Route Service
revision • Create named route to new revision • Continue sending all traffic to original revision • Send progressively larger % of traffic to new revision • Monitor metrics/logs • Migrate all traffic to new revision • Create named route to previous revision Full demo walk-through: https://github.com/mchmarny/knative-demos/tree/master/blue-green-deploy Significant changes in v4 & v5, new/better approach coming: https://github.com/knative/serving/pull/3562
or build your own • Plugable channel implementation (e.g. PubSub. Kafka, In-Memory) Benefits • Orchestrates on/off cluster event sources • Binds declaratively event sources, triggers, and services • Scales from just few events to live streaming pipelines • Uses standard CloudEvents
for pushing events into Knative Apache Kafka Brings Apache Kafka messages into Knative AWS SQS Brings AWS Simple Queue Service messages into Knative Cron Job Uses an in-memory timer to produce events on the specified Cron schedule. GCP PubSub Brings GCP PubSub messages into Knative GitHub Brings GitHub organization/repository events into Knative GitLab Brings GitLab repository events into Knative. Google Cloud Scheduler Google Cloud Scheduler events in Knative when jobs are triggered Google Cloud Storage Brings Google Cloud Storage bucket/object events into Knative Kubernetes Brings Kubernetes cluster/infrastructure events into Knative Full lists: https://github.com/knative/docs/tree/master/docs/eventing/sources Knative Event Sources
serving URL templates • No cross-compiling toil or need for Docker locally • Cloud caching, elasticity of build resources Loosely coupled • Supports decoupled CI/CD (e.g. Cloud Build or Jenkins X) • Ecosystem for enterprise tooling to manage policy and audit builds
build.yaml # GitOps (Cloud Build or your CI/CD platform like Jenkins X) git commit # on branch triggers build for test deployment git tag/release # triggers deployment pipeline to active service # Local Build & Deploy docker build/tag/publish # uses Dockerfile Kubectl/knctl deploy --image… # github.com/cppforlife/knctl # ko for quick iteration, no Dockerfile, golang only github.com/google/ko ko apply -f config.yaml Knative Build Options
(Last Week, videos available) Knative a Year Later: Serverless, Kubernetes and You bit.ly/kn-1yl Generating Events from Your Internal Systems with Knative bit.ly/kn-events KubeCon Barcelona (May 20, 2019) Serverless Practitioners Summit bit.ly/kn-barcelona