options Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless operational spectrum Managed by your cloud Container orchestration (k8s) Not serverless for programming or ops Container focused You manage infra Managed by your team Serverless containers Custom languages & runtimes Infra still cloud-managed
options Hosted FaaS/compute Managed by your cloud Container orchestration (k8s) Not serverless for programming or ops Container focused You manage infra Managed by your team Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless containers Custom languages & runtimes Infra still cloud-managed
scalable, serverless web applications. Deploy and scale Applications that react to Requests Cloud Functions Event-driven serverless compute platform. Deploy and scale Functions that react to Events
to a trigger event Microservices Cloud "glue" Node.js 6, Node.js 8, Python 3.7, Go 1.11 (bit.ly/gcf-go-alpha) Pricing: per 100ms & based on allocated memory Cloud Functions
you use, scale to zero Open-source, idiomatic experience Use any module, extension, or framework New supported runtimes: ◦ Node.js 8 ◦ Python 3.7 ◦ PHP 7.2
Not serverless for programming or ops Container focused You manage infra Hosted FaaS/compute Easiest dev experience Code focused Limited runtime options Managed by your team Serverless anywhere Knative / GKE serverless addon On prem or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless containers Custom languages & runtimes Infra still cloud-managed
kernel app libs libs kernel kernel libs app kernel libs app libs app libs app kernel libs app app app app Shared machines Virtual Machines Containers x x x x x x No isolation Common libs Highly coupled apps and OS Isolation No common libs Expensive and inefficient Hard to manage Isolation No common libs Less overhead Less dependency on host OS
blender ENV APP_HOME /app COPY . $APP_HOME WORKDIR $APP_HOME RUN pip install Flask EXPOSE 8080 CMD ["python", "app.py"] Don't be afraid of this Image It’s a method of packaging an application executable and its dependencies (runtime, libraries, configuration) Runtime and running as a set of resource-isolated processes.
or multi-cloud Code or containers Custom hardware (GPU, TPU, IoT, etc) Offline You manage infra Serverless anywhere Managed by your cloud Container orchestration (k8s) Not serverless for programming or ops Container focused You manage infra Hosted FaaS/compute Easiest dev experience Code focused Limited runtime options Managed by your team Serverless containers Custom languages & runtimes Infra still cloud-managed
Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Primitives riff OpenFaaS Jazz
Where should my job be run? Lifecycle: Keep my job running Discovery: Where is my job now? Constituency: Who is part of my job? Scale-up: Making my jobs bigger or smaller Auth{n,z}: Who can do things to my job? Monitoring: What’s happening with my job? Health: How is my job feeling? Container orchestration
Have to do Write code Build docker image Upload image to registry Deploy service Expose to the internet Setup logging & monitoring Scale workload Want to do Write code
clear separation of concerns So far, we used Service, a lite version of Knative objects spec: container: image: gcr.io/knative-samples/simple-app:latest env: - name: SIMPLE_MSG value: "Hello Serverlessconf SF!" Service
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
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 Route Configuration Service
revisionName: blue-green-00001 percent: 100 - revisionName: blue-green-00002 percent: 0 name: v2 Deploy updated version of the service • Blue continues to take 100% of traffic • Named route (v2) to green version Revision Route 100% Revision 0% v2 Configuration Configuration
Knative Events compatible with CNCF standard Cloud Events Knative scales down when you don’t need it Knative scales up linearly with your load • Supports unpredictable usage pattern • 1-n when you app starts taking traffic
developers care? • 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.
Event sources, event types • Buildpack build templates • Network configuration • Logging targets Some opinions may not be ideal for your use-case Kubernetes • Auto-scaling strategy • Function invokers • Message bus