SlideShare a Scribd company logo
@BretMcG github.com/bretmcg
Knative and Kubernetes:
Bringing serverless to more
developers
Bret McGowen
@BretMcG
Developer Advocate
Google
linktr.ee/bretmcg
Connect with me
GitHub - github.com/bretmcg
SlideShare - slideshare.net/bretmc
My LinkTree - inktr.ee/bretmcg
YouTube - youtube.com/c/BretMcG
Speaker Deck - speakerdeck.com/bretmcg
Sessionize - sessionize.com/bretmcg
LinkedIn - linkedin.com/in/bretmcgowen
Instagram - instagram.com/bret.mcgowen
@BretMcG github.com/bretmcg
Serverless swear words
Contai***s
Kubern****s
Infrastr****re
Offl*ne
Cluster of virt*** mach***s
.
@BretMcG github.com/bretmcg
Serverless model(s)
Operational model
Fully managed security Pay only for usage
No servers
Event-driven Open
Service-based
Programming model
@BretMcG github.com/bretmcg
Keep the serverless programming model,
however your infrastructure is managed.
Operational model
Fully managed security Pay only for usage
No servers
Event-driven Open
Service-based
Programming model
@BretMcG github.com/bretmcg
Hosted FaaS/compute
Easiest dev experience
Code focused
Limited runtime 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
@BretMcG github.com/bretmcg
Hosted FaaS/compute
Easiest dev experience
Code focused
Limited runtime 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
@BretMcG github.com/bretmcg
Serverless Compute on Cloud
Platform
App Engine Standard
Highly 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
@BretMcG github.com/bretmcg
Back end code functions that automatically run in
response 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
@BretMcG github.com/bretmcg
Cloud Functions as cloud glue
Access 20+ Google
services from GCF
Cloud Storage
Cloud Pub/Sub
HTTPS
Firebase
Cloud Scheduler
@BretMcG github.com/bretmcg
Cloud Functions announcements
Generally Available (with SLA!)
Python 3.7, Node 8
Tokyo, Belgium, Iowa
Environment Variables
Cloud Scheduler
New!
Ubuntu 18.04 with many packages
(ffmpeg, imagemagick, headless Chrome)
Security Controls: VPC, IAM
Scaling Controls
Cloud SQL Direct Connect
@BretMcG github.com/bretmcg
App Engine: 2nd generation runtimes
New!
Pay for what 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
@BretMcG github.com/bretmcg
Serverless containers
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 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
@BretMcG github.com/bretmcg
First, a word about
containers....
Containers != Kubernetes
(I'm fired now)
@BretMcG github.com/bretmcg
What are containers?
app
libs
kernel
libs
app app
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
@BretMcG github.com/bretmcg
FROM python
RUN apt-get update && apt-get install -y 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.
@BretMcG github.com/bretmcg
Bad news friends...
All major clouds run their functions as containers
behind the scenes.
@BretMcG github.com/bretmcg
Everything at Google
runs in containers:
Gmail, Web Search, Maps, ...
MapReduce, batch, ...
GFS, Colossus, ...
Even GCE itself: VMs in containers
We launch over
4 billion containers
per week.
@BretMcG github.com/bretmcg
Demo: containers aren’t scary
@BretMcG github.com/bretmcg
Two serverless challenges today
Dependencies
Constrained runtimes,
frameworks and packages
Multi-Cloud
Unable to run your workloads
on-prem, in the cloud or on a
third party service provider
1 2
@BretMcG github.com/bretmcg
Serverless containers
Secure on gVisor
Fully managed
BYO workloads
Pay for use & stateless
Alpha invitations coming
later this year
Sign up: g.co/serverlesscontainers
New: serverless containers on GCF (EAP)
@BretMcG github.com/bretmcg
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 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
@BretMcG github.com/bretmcg
Meet Knative: serverless on Kubernetes
Kubernetes-based
building blocks for
serverless workloads
Build - Serving - Events
*kay-native
@BretMcG github.com/bretmcg
Knative partners
@BretMcG github.com/bretmcg
Knative isn't
Not an open source FaaS developer-facing product
It's primitives, not a product
Not the right solution for everyone
@BretMcG github.com/bretmcg
The Knative stack
Kubernetes + Istio
Platform
@BretMcG github.com/bretmcg
The Knative stack
Knative
Build Serving Events
Kubernetes + Istio
Platform
Primitives
@BretMcG github.com/bretmcg
Knative
Build Serving Events
Kubernetes + Istio
Platform
Products
Serverless Containers on GCF GKE Serverless Add-on SAP Kyma
Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions
Primitives
riff OpenFaaS Jazz
@BretMcG github.com/bretmcg
@BretMcG github.com/bretmcg
What is Kubernetes?
@BretMcG github.com/bretmcg
*Sources: COCOMO Model, CNCF.io Certified Providers
442 Years of effort* 5,000+ Contributors 30k+ GitHub stars
The incredible Kubernetes ecosystem
@BretMcG github.com/bretmcg
Isolation: Keep jobs from interfering with
each other
Scheduling: 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
@BretMcG github.com/bretmcg
Kubernetes abstracts away infrastructure
Nodes
Master
@BretMcG github.com/bretmcg
Developers using Kubernetes still have a lot to do
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
@BretMcG github.com/bretmcg
Reasons for using Kubernetes (2014) vs
hosted serverless (2014)
Reduce lock-in
Performance
Multi-cloud
Customizability
Use custom hardware (GPU, TPU, IoT, etc)
Offline/reduced connectivity
Existing on-prem infrastructure
Existing applications
@BretMcG github.com/bretmcg
Everybody got all fired up
about Kubernetes and
microservices and then were
like ‘Oh s----, what’s going on?’
Istio lets us view our entire
system and find trouble spots.
Anonymous early adopter
Observability:
@BretMcG github.com/bretmcg
Traffic control Observability Fault-injection
Security Hybrid cloud
Istio
@BretMcG github.com/bretmcg
Example: canaries & traffic steering
destination: pictures.example.local
match:
httpHeaders:
user-agent:
regex: ^(.*?;)?(iPhone)(;.*)?$
precedence: 2
route:
- tags:
version: 2.0-alpha
env: staging
pictures
version: 2.0-alpha
env: staging
version: 1.5
env: prod
Proxy
Frontend
Pictures
Proxy
Pictures
Proxy
@BretMcG github.com/bretmcg
Kubernetes provides a good operator experience.
What about developer experience?
@BretMcG github.com/bretmcg
Demo: deploy an app on Knative
@BretMcG github.com/bretmcg
Knative Serving defines principled objects
Knative defines primitives with 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
@BretMcG github.com/bretmcg
Configuration
Service
Knative Serving defines principled objects
Knative defines primitives with clear separation of concerns
Configuration
Current/desired state for your application
Code & configuration (separated, ala 12 factor)
@BretMcG github.com/bretmcg
Revision
Configuration
Service
Knative Serving defines principled 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
@BretMcG github.com/bretmcg
Knative Serving defines principled objects
Revision
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
Route
Configuration
Service
@BretMcG github.com/bretmcg
Demo: Blue-green deployment
@BretMcG github.com/bretmcg
Blue-green deployment model
Route
100%
Revision
Configuration
kind: Route
...
spec:
traffic:
- revisionName: blue-green-00001
percent: 100
@BretMcG github.com/bretmcg
Blue-green deployment model
kind: Route
...
spec:
traffic:
- 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
@BretMcG github.com/bretmcg
Blue-green deployment model
Update service configuration
● Send % of traffic to green
● Still have explicit v2 route
kind: Route
...
spec:
traffic:
- revisionName: blue-green-00001
percent: 50
- revisionName: blue-green-00002
percent: 50
name: v2
Revision
Route
98%
Revision
2% (Experiment)
Configuration
Configuration
Revision
Route
Revision
Configuration
Configuration
@BretMcG github.com/bretmcg
Blue-green deployment model
Update service configuration
● Incrementally add %, until all traffic is on green
● Keep explicit named route to blue
Secured with RBAC-based ACL
kind: Route
...
spec:
traffic:
- revisionName: blue-green-00001
percent: 0
name: v1
- revisionName: blue-green-00002
percent: 100
Revision
Route
0%
v1
Revision
100%
Configuration
Configuration
Revision
Route
Revision
Configuration
Configuration
@BretMcG github.com/bretmcg
Blue-green deployment model
Revision
Route
0%
v1
Revision
100%
Configuration
Configuration
Revision
Route
Revision
Configuration
Configuration
Demo: Deploying and updating live service
@BretMcG github.com/bretmcg
More Knative pieces
Knative Build enables source/git based deployments
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
@BretMcG github.com/bretmcg
Knative auto-builds
Supports GitOps or
src-to-URL
development patterns
Why 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.
@BretMcG github.com/bretmcg
Knative has opinions but is extensible
Knative API
● 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
@BretMcG github.com/bretmcg
GKE serverless add-on
Available for all later this year
Request early access today at
g.co/serverlessaddon GKE serverless add-on
@BretMcG github.com/bretmcg
The goal is more serverless
experiences for more
developers. Even if it’s not
perfectly serverless, happy devs
will drive organizational change.
@BretMcG github.com/bretmcg
Resources
cloud.google.com/serverless
Knative
github.com/knative
slack.knative.dev
GKE serverless add-on (sign-up)
g.co/serverlessaddon
Containers on Cloud Functions (sign-up)
g.co/serverlesscontainers
Thank you!
Bret McGowen
@BretMcG
@BretMcG github.com/bretmcg
Connect with me
GitHub - github.com/bretmcg
SlideShare - slideshare.net/bretmc
My LinkTree - inktr.ee/bretmcg
YouTube - youtube.com/c/BretMcG
Speaker Deck - speakerdeck.com/bretmcg
Sessionize - sessionize.com/bretmcg
LinkedIn - linkedin.com/in/bretmcgowen
Instagram - instagram.com/bret.mcgowen
Thank you!
Bret McGowen
@BretMcG

More Related Content

PDF
Where should I run my code? Serverless, Containers, Virtual Machines and more
PDF
Deep dive into serverless on Google Cloud
PDF
Exploring the GitHub Service Universe
PDF
Join Our Party: The Cloud Native Adventure Brigade (TCSW 2019)
PDF
Anthos Security: modernize your security posture for cloud native applications
PDF
From localhost to the cloud: A Journey of Deployments
PDF
English - Lauching a Public PaaS on Open Source Getup & OpenShift Origin - FI...
PPTX
Biscuit, the cryptotoken you can share safely with your ap is
Where should I run my code? Serverless, Containers, Virtual Machines and more
Deep dive into serverless on Google Cloud
Exploring the GitHub Service Universe
Join Our Party: The Cloud Native Adventure Brigade (TCSW 2019)
Anthos Security: modernize your security posture for cloud native applications
From localhost to the cloud: A Journey of Deployments
English - Lauching a Public PaaS on Open Source Getup & OpenShift Origin - FI...
Biscuit, the cryptotoken you can share safely with your ap is

Similar to Knative and Kubernetes - bringing serverless to more developers (20)

PPTX
Scientific Computing @ Fred Hutch
PDF
Rejekts 24 EU No GitOps Pain, No Platform Gain
PDF
Gitops Hands On
PPTX
The Reality of DIY Kubernetes vs. PKS
PDF
Heroku to Kubernetes & Gihub to Gitlab success story
PDF
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
PDF
給 RD 的 Kubernetes 初體驗
PDF
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
PDF
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
PPTX
What should you know about Net Core?
PPTX
IBM MQ in containers MQTC 2017
PDF
Kubernetes Operability Tooling (GOTO Chicago 2019)
PDF
Kubecon seattle 2018 workshop slides
PDF
Building a dev pipeline using GitHub Actions, Node.js, and AWS ECS Fargate
PPTX
APIs at the Edge
PDF
Google Cloud Networking Deep Dive
PDF
How to manage Kubernetes at scale with just git
PDF
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
PPTX
ClusterEurope2018 - Bootcamp Kubernetes - présentation
PDF
[2020 git lab commit] continuous infrastructure
Scientific Computing @ Fred Hutch
Rejekts 24 EU No GitOps Pain, No Platform Gain
Gitops Hands On
The Reality of DIY Kubernetes vs. PKS
Heroku to Kubernetes & Gihub to Gitlab success story
Webinar: End to End Security & Operations with Chainguard and Weave GitOps
給 RD 的 Kubernetes 初體驗
TDC2017 | São Paulo - Trilha Cloud Computing How we figured out we had a SRE ...
PuppetConf 2017: Zero to Kubernetes -Scott Coulton, Puppet
What should you know about Net Core?
IBM MQ in containers MQTC 2017
Kubernetes Operability Tooling (GOTO Chicago 2019)
Kubecon seattle 2018 workshop slides
Building a dev pipeline using GitHub Actions, Node.js, and AWS ECS Fargate
APIs at the Edge
Google Cloud Networking Deep Dive
How to manage Kubernetes at scale with just git
Resilient microservices with Kubernetes - Mete Atamel - Codemotion Rome 2017
ClusterEurope2018 - Bootcamp Kubernetes - présentation
[2020 git lab commit] continuous infrastructure
Ad

More from Bret McGowen - NYC Google Developer Advocate (9)

PDF
Firebase Codelab - 2018 Milano
PDF
Supercharge your app with Cloud Functions for Firebase
PDF
Serverless with Google Cloud
PDF
Google Home and Google Assistant Workshop: Build your own serverless Action o...
PDF
Machine learning with Google machine learning APIs - Puppy or Muffin?
PDF
Google Machine Learning APIs - puppies or muffins?
PDF
Cloud Spin - building a photo booth with the Google Cloud Platform
PDF
Firebase Code Lab - 2015 GDG Buffalo DevFest
Firebase Codelab - 2018 Milano
Supercharge your app with Cloud Functions for Firebase
Serverless with Google Cloud
Google Home and Google Assistant Workshop: Build your own serverless Action o...
Machine learning with Google machine learning APIs - Puppy or Muffin?
Google Machine Learning APIs - puppies or muffins?
Cloud Spin - building a photo booth with the Google Cloud Platform
Firebase Code Lab - 2015 GDG Buffalo DevFest
Ad

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PDF
Machine learning based COVID-19 study performance prediction
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
Big Data Technologies - Introduction.pptx
PPTX
sap open course for s4hana steps from ECC to s4
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Advanced methodologies resolving dimensionality complications for autism neur...
NewMind AI Weekly Chronicles - August'25 Week I
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Machine learning based COVID-19 study performance prediction
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Big Data Technologies - Introduction.pptx
sap open course for s4hana steps from ECC to s4
Building Integrated photovoltaic BIPV_UPV.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
Understanding_Digital_Forensics_Presentation.pptx
Programs and apps: productivity, graphics, security and other tools
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy

Knative and Kubernetes - bringing serverless to more developers

  • 1. @BretMcG github.com/bretmcg Knative and Kubernetes: Bringing serverless to more developers Bret McGowen @BretMcG Developer Advocate Google linktr.ee/bretmcg Connect with me GitHub - github.com/bretmcg SlideShare - slideshare.net/bretmc My LinkTree - inktr.ee/bretmcg YouTube - youtube.com/c/BretMcG Speaker Deck - speakerdeck.com/bretmcg Sessionize - sessionize.com/bretmcg LinkedIn - linkedin.com/in/bretmcgowen Instagram - instagram.com/bret.mcgowen
  • 2. @BretMcG github.com/bretmcg Serverless swear words Contai***s Kubern****s Infrastr****re Offl*ne Cluster of virt*** mach***s .
  • 3. @BretMcG github.com/bretmcg Serverless model(s) Operational model Fully managed security Pay only for usage No servers Event-driven Open Service-based Programming model
  • 4. @BretMcG github.com/bretmcg Keep the serverless programming model, however your infrastructure is managed. Operational model Fully managed security Pay only for usage No servers Event-driven Open Service-based Programming model
  • 5. @BretMcG github.com/bretmcg Hosted FaaS/compute Easiest dev experience Code focused Limited runtime 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
  • 6. @BretMcG github.com/bretmcg Hosted FaaS/compute Easiest dev experience Code focused Limited runtime 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
  • 7. @BretMcG github.com/bretmcg Serverless Compute on Cloud Platform App Engine Standard Highly 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
  • 8. @BretMcG github.com/bretmcg Back end code functions that automatically run in response 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
  • 9. @BretMcG github.com/bretmcg Cloud Functions as cloud glue Access 20+ Google services from GCF Cloud Storage Cloud Pub/Sub HTTPS Firebase Cloud Scheduler
  • 10. @BretMcG github.com/bretmcg Cloud Functions announcements Generally Available (with SLA!) Python 3.7, Node 8 Tokyo, Belgium, Iowa Environment Variables Cloud Scheduler New! Ubuntu 18.04 with many packages (ffmpeg, imagemagick, headless Chrome) Security Controls: VPC, IAM Scaling Controls Cloud SQL Direct Connect
  • 11. @BretMcG github.com/bretmcg App Engine: 2nd generation runtimes New! Pay for what 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
  • 12. @BretMcG github.com/bretmcg Serverless containers 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 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
  • 13. @BretMcG github.com/bretmcg First, a word about containers.... Containers != Kubernetes (I'm fired now)
  • 14. @BretMcG github.com/bretmcg What are containers? app libs kernel libs app app 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
  • 15. @BretMcG github.com/bretmcg FROM python RUN apt-get update && apt-get install -y 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.
  • 16. @BretMcG github.com/bretmcg Bad news friends... All major clouds run their functions as containers behind the scenes.
  • 17. @BretMcG github.com/bretmcg Everything at Google runs in containers: Gmail, Web Search, Maps, ... MapReduce, batch, ... GFS, Colossus, ... Even GCE itself: VMs in containers We launch over 4 billion containers per week.
  • 19. @BretMcG github.com/bretmcg Two serverless challenges today Dependencies Constrained runtimes, frameworks and packages Multi-Cloud Unable to run your workloads on-prem, in the cloud or on a third party service provider 1 2
  • 20. @BretMcG github.com/bretmcg Serverless containers Secure on gVisor Fully managed BYO workloads Pay for use & stateless Alpha invitations coming later this year Sign up: g.co/serverlesscontainers New: serverless containers on GCF (EAP)
  • 21. @BretMcG github.com/bretmcg 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 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
  • 22. @BretMcG github.com/bretmcg Meet Knative: serverless on Kubernetes Kubernetes-based building blocks for serverless workloads Build - Serving - Events *kay-native
  • 24. @BretMcG github.com/bretmcg Knative isn't Not an open source FaaS developer-facing product It's primitives, not a product Not the right solution for everyone
  • 25. @BretMcG github.com/bretmcg The Knative stack Kubernetes + Istio Platform
  • 26. @BretMcG github.com/bretmcg The Knative stack Knative Build Serving Events Kubernetes + Istio Platform Primitives
  • 27. @BretMcG github.com/bretmcg Knative Build Serving Events Kubernetes + Istio Platform Products Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Primitives riff OpenFaaS Jazz
  • 30. @BretMcG github.com/bretmcg *Sources: COCOMO Model, CNCF.io Certified Providers 442 Years of effort* 5,000+ Contributors 30k+ GitHub stars The incredible Kubernetes ecosystem
  • 31. @BretMcG github.com/bretmcg Isolation: Keep jobs from interfering with each other Scheduling: 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
  • 32. @BretMcG github.com/bretmcg Kubernetes abstracts away infrastructure Nodes Master
  • 33. @BretMcG github.com/bretmcg Developers using Kubernetes still have a lot to do 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
  • 34. @BretMcG github.com/bretmcg Reasons for using Kubernetes (2014) vs hosted serverless (2014) Reduce lock-in Performance Multi-cloud Customizability Use custom hardware (GPU, TPU, IoT, etc) Offline/reduced connectivity Existing on-prem infrastructure Existing applications
  • 35. @BretMcG github.com/bretmcg Everybody got all fired up about Kubernetes and microservices and then were like ‘Oh s----, what’s going on?’ Istio lets us view our entire system and find trouble spots. Anonymous early adopter Observability:
  • 36. @BretMcG github.com/bretmcg Traffic control Observability Fault-injection Security Hybrid cloud Istio
  • 37. @BretMcG github.com/bretmcg Example: canaries & traffic steering destination: pictures.example.local match: httpHeaders: user-agent: regex: ^(.*?;)?(iPhone)(;.*)?$ precedence: 2 route: - tags: version: 2.0-alpha env: staging pictures version: 2.0-alpha env: staging version: 1.5 env: prod Proxy Frontend Pictures Proxy Pictures Proxy
  • 38. @BretMcG github.com/bretmcg Kubernetes provides a good operator experience. What about developer experience?
  • 40. @BretMcG github.com/bretmcg Knative Serving defines principled objects Knative defines primitives with 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
  • 41. @BretMcG github.com/bretmcg Configuration Service Knative Serving defines principled objects Knative defines primitives with clear separation of concerns Configuration Current/desired state for your application Code & configuration (separated, ala 12 factor)
  • 42. @BretMcG github.com/bretmcg Revision Configuration Service Knative Serving defines principled 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. @BretMcG github.com/bretmcg Knative Serving defines principled objects Revision 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 Route Configuration Service
  • 45. @BretMcG github.com/bretmcg Blue-green deployment model Route 100% Revision Configuration kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 100
  • 46. @BretMcG github.com/bretmcg Blue-green deployment model kind: Route ... spec: traffic: - 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
  • 47. @BretMcG github.com/bretmcg Blue-green deployment model Update service configuration ● Send % of traffic to green ● Still have explicit v2 route kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 50 - revisionName: blue-green-00002 percent: 50 name: v2 Revision Route 98% Revision 2% (Experiment) Configuration Configuration Revision Route Revision Configuration Configuration
  • 48. @BretMcG github.com/bretmcg Blue-green deployment model Update service configuration ● Incrementally add %, until all traffic is on green ● Keep explicit named route to blue Secured with RBAC-based ACL kind: Route ... spec: traffic: - revisionName: blue-green-00001 percent: 0 name: v1 - revisionName: blue-green-00002 percent: 100 Revision Route 0% v1 Revision 100% Configuration Configuration Revision Route Revision Configuration Configuration
  • 49. @BretMcG github.com/bretmcg Blue-green deployment model Revision Route 0% v1 Revision 100% Configuration Configuration Revision Route Revision Configuration Configuration Demo: Deploying and updating live service
  • 50. @BretMcG github.com/bretmcg More Knative pieces Knative Build enables source/git based deployments 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
  • 51. @BretMcG github.com/bretmcg Knative auto-builds Supports GitOps or src-to-URL development patterns Why 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.
  • 52. @BretMcG github.com/bretmcg Knative has opinions but is extensible Knative API ● 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
  • 53. @BretMcG github.com/bretmcg GKE serverless add-on Available for all later this year Request early access today at g.co/serverlessaddon GKE serverless add-on
  • 54. @BretMcG github.com/bretmcg The goal is more serverless experiences for more developers. Even if it’s not perfectly serverless, happy devs will drive organizational change.
  • 55. @BretMcG github.com/bretmcg Resources cloud.google.com/serverless Knative github.com/knative slack.knative.dev GKE serverless add-on (sign-up) g.co/serverlessaddon Containers on Cloud Functions (sign-up) g.co/serverlesscontainers Thank you! Bret McGowen @BretMcG
  • 56. @BretMcG github.com/bretmcg Connect with me GitHub - github.com/bretmcg SlideShare - slideshare.net/bretmc My LinkTree - inktr.ee/bretmcg YouTube - youtube.com/c/BretMcG Speaker Deck - speakerdeck.com/bretmcg Sessionize - sessionize.com/bretmcg LinkedIn - linkedin.com/in/bretmcgowen Instagram - instagram.com/bret.mcgowen Thank you! Bret McGowen @BretMcG