SlideShare a Scribd company logo
Why Kubernetes for Serverless?
by Krishna Kumar, Huawei India
CNCF Ambassador
Content
Evolution of Serverless world
& then…
Kubernetes Features towards Serverless…..
Containers – The History Highlights
1979
UNIX
chroot
provide an
isolated disk
space for each
process. Later in
1982 this was
added to BSD
FreeBSD
Jails
additional
process
sandboxing
features for
isolating the
filesystem, users,
networking, etc
2000 2001
Linux
VServer
securely partition
resources on a
computer system
(file system, CPU
time, network
addresses and
memory)
2004
Solaris
Containers
combination of
system resource
controls and the
boundary
separation
provided by
zones
2005
OpenVZ
isolated file
system, users
and user groups,
a process tree,
network, devices,
and IPC objects.
2006
Process
Containers
limiting,
accounting, and
isolating resource
usage (CPU,
memory, disk I/O,
network, etc.) of a
collection of
processes
2007
Control
Groups
Control Groups AKA
cgroups was
implemented by
Google and added to
the Linux Kernel in
2007
2011
Warden
Warden was
implemented by
CloudFoundry in
year 2011 by
using LXC at the
initial stage
2013
LMCTFY
lmctfy stands for
“Let Me Contain
That For You”. It is
the open source
version of Google’s
container stack
LXC
LXC stands for
LinuX Containers
and it is the first,
most complete
implementation of
Linux container
manager
2008 2013
Docker
Docker is the
most popular and
widely used
container
management
system as of
January 2016
2014
Rocket
Rocket is a much
similar initiative to
Docker started by
CoreOS for fixing
some of the
drawbacks
2016
Windows
Containers
Run Docker
containers on
Windows natively
without having to
run a virtual
machine to run
Docker
Virtual Machines, Containers and Unikernels
Evolution of Applications Development
MainFrame Client/Server SOA MSA Serverless
Serverless Evolution
2014-11 2015-10 2016-01 2016-2 2016-4 2016-5
Serverless
2016-6
OpenLambda
2016-7
DC/OS serverlessApcera
AWS Lambda
2016-3
Kubernetes for Serverless  - Serverless Summit 2017 - Krishna Kumar
https://www.cncf.io/
Serverless From BIG Players
• AWS lambda - https://aws.amazon.com/lambda/
• Azure Functions - https://azure.microsoft.com/en-in/services/functions/
• Google Cloud Functions - https://cloud.google.com/functions/
• IBM OpenWhisk - https://www.ibm.com/cloud-computing/bluemix/openwhisk
• Oracle Fn - https://blogs.oracle.com/emeapartnerweblogic/serverless-architecture-on-the-oracle-
paas-cloud-by-lucas-jellema
Serverless Implementations - Others
 Fission.io (https://github.com/fission/fission)
 Kubeless (https://github.com/bitnami/kubeless)
 Iron Functions (https://github.com/iron-io/functions)
 Fabric8’s (https://github.com/funktionio/funktion)
 Alex’s (https://github.com/alexellis/faas) (Use Docker Swarm)
 Galactic fog (https://github.com/GalacticFog)
 Ovrclk.com (not open source)
 Lightbend - www.lightbend.com
 Iceroad www.iceroad.io
 AuthO Webtasks - https://auth0.com/blog/building-serverless-apps-with-webtask/
https://github.com/anaibol/awesome-serverless
A Severless Architecture (Amazon Lambda)
Severless Architecture Benefits & Drawback
(From AWS)
Serverless is misnormal…...
It is Functions as a Service (FaaS)
Why Kubernetes for FaaS?
Kubernetes Orchestration Engine1
Setup
• On Cloud infrastructure
• Google
• AWS
• Azure
• IBM Blue Mix
• On local machine
• MiniKube
• Ubuntu on LXD
• Kubeadm
• IBM Cloud Private CE
Kubernetes – AutoScale with custom metrics
• With Horizontal Pod Autoscaling, Kubernetes
automatically scales the number of pods in a replication
controller, deployment or replica set based on observed
CPU utilization (or, with custom metrics support, on
some other application-provided metrics).
• Needs Heapster and Cadvisor (already a part of
Kubernetes)
• Resource Metric Source (CPU or Memory). Per-pod
resource metrics (like CPU),
• The key operational difference between FaaS and PaaS
is scaling. With most PaaS’s you still need to think about
scale.
• FaaS needs infrastructure and k8s supports that well.
From Function it creates services and manage its life
cycle.
• https://kubernetes.io/docs/tasks/run-
application/horizontal-pod-autoscale/
2
Kubernetes – Workloads
• StatefulSet - Stateful Application that needs reasonable handling
• Like Database
• In-memory Cache
• Peer – Peer applications that needs
storage
• Any application that needs network
identity
• Stateless - For stateless application to deal with complex workflow
• Like webservers
• Are stateless in nature that needs on-
demand scale
• Needs rolling update
• Jobs - Run once type of workloads
• Useful for running scripts, reports
and batch jobs
• Like DB-Query
• Like Spark / Hadoop processing
• CornJobs – Run once type of Jobs by repeat in a frequency
• Just like unix CornJob
• Runs a job at a given schedule
• DaemonSet – Run on all the Nodes as much as possible
• Runs in every node in the cluster.
• For starting monitoring applications
on every node.
• ReplicaSet – Run and manage multiple Pods lifecycle.
• Elementry Controller for managing
PODs
• Used by Deployment.
FaaS Workloads
• Time based processing/CRON job
• Time based recurring jobs, clean up etc.
• Event processing
• Servicing SaaS & cloud events like changes is
Storage, DB, etc. and to display it in graphical
way
• Web applications
• Single web page apps, that manage user
data store/display/customization.
• Mobile backend
• Mobile client can use HTTP APIs to
store/process, eg. Photos
• Real-time stream processing
• IoT devices can send messages for
stream analytics
• Real-time bot messaging
• Chat/Message bots
• Answer questions using AI (Cortana)
 FaaS functions are stateless. The ‘Twelve-
Factor App’ concept is also same.
3
12 factors
(solid
principle for
Cloud
Software
Architecture)
Codebase One codebase tracked in
revision control, many
deploys
Dependencies Explicitly declare and
isolate dependencies
Config Store configuration in
the environment
Backing Services Treat backing services as
attached resources
Build, release, run Strictly separate build
and run stages
Processes Execute the app as one
or more stateless
processes
Port binding Export services via port
binding
Concurrency Scale out via the process
model
Disposability Maximize robustness
with fast startup and
graceful shutdown
Dev/prod parity Keep development,
staging, and production
as similar as possible
Logs Treat logs as event
streams
Admin processes Run admin/management
tasks as one-off
processes
K8s Cloud Native and Serverless has same Workload Characteristics
Expose Service from Function4
 A Service in Kubernetes is an abstraction which defines a logical set of Pods and a
policy by which to access them.
 Services enable a loose coupling between dependent Pods. A Service is defined using
YAML (preferred) or JSON, like all Kubernetes objects.
 The set of Pods targeted by a Service is usually determined by a LabelSelector
 Although each Pod has a unique IP address, those IPs are not exposed outside the
cluster without a Service. Services allow your applications to receive traffic. Services
can be exposed in different ways by specifying a type in the ServiceSpec (ClusterIP,
NodePort, LoadBalancer, External Name)
 HTTP services from k8s from functions very easy to create.
 API based calls – deal with event handlers (notification from other services)
 Idle function only use storage and consume only CPU/memory when at use – trigger
fires.
Function can run at source level, or as buildpack or as docker images.
https://kubernetes.io/docs/tutorials/kubernetes-basics/expose-intro/
Associate functions with k8s watches, triggers, HTTP routes5
Watch resource from k8s API – Native integration with k8s
•POD problem
•Other events
•Do something
Create function and add them using CLI/etc.. Then associate functions with k8s watches, triggers, HTTP
routes.
Issue a watch request using normal http request - the API consumes and returns JSON messages.
Labels can be used to organize and to select subsets of objects. Labels can be attached to objects at
creation time and subsequently added and modified at any time.
Funktion – Apache Camel Connector (some thing happens do something)
Step Functions – One after another events. Call in sequence order.
https://stackoverflow.com/questions/35192712/kubernetes-watch-pod-events-with-api
Init Container6
A Pod can have multiple Containers
running apps within it, but it can also have
one or more Init Containers, which are
run before the app Containers are started.
Init Containers are exactly like regular
Containers, except:
•They always run to completion.
•Each one must complete successfully
before the next one is started. They all
must run to completion before the Pod
can be ready.
https://kubernetes.io/docs/concepts/workloads/pods/i
nit-containers/
Init Containers
Can be used for
- Sleep
- Register Pod
- Clone a git
- Place value to config file
Kuberntes Config Map7
Config map to inject function's code to the runtime pod.
The ConfigMap API resource provides mechanisms to inject
containers with configuration data while keeping containers
agnostic of Kubernetes
ConfigMaps allow you to decouple configuration artifacts
from image content to keep application portable.
ConfigMap is similar to Secrets, but provides a means of
working with strings that don’t contain sensitive
information
The ConfigMap’s data field contains the configuration data.
As shown in the example, this can be simple – like
individual properties defined using --from-literal – or
complex – like configuration files or JSON blobs defined
using --from-file. There is size limitations exists.
https://kubernetes.io/docs/tasks/configure-pod-
container/configmap/
Custom Resource Definitions (CRD) to simulate function's metadata8
From Kubeless documents (how they run):
•There is a CRD endpoint being deploy called function.k8s.io:
•Then function custom objects will be created under this CRD endpoint.
•function.spec contains function's metadata including code, handler, runtime, type (http or pubsub) and
probably its dependency file.
•Custom controller watch changes of function objects and react accordingly to deploy/delete K8S
deployment/svc/configmap. These containers fetch all the dependencies and share them with the function
runtimes using volumes.
•The runtimes are pre-built docker images that wrap the functions in an HTTP server or in a Kafka
consumer. Indeed, to be able to trigger functions via events we currently use Kafka.
•There are currently two type of functions supported in Kubeless: http-based and pubsub-based. A set of
Kafka and Zookeeper is installed into the kubeless namespace to handle the pubsub-based functions.
https://github.com/kubeless/kubeless/blob/master/docs/architecture.md
May be useful in some implementations………
Volume mount / storage for custom source load9
On-disk files in a container are ephemeral, which presents some problems for non-trivial
applications when running in containers. First, when a container crashes, kubelet will
restart it, but the files will be lost - the container starts with a clean state. Second, when
running containers together in a Pod it is often necessary to share files between those
containers. The Kubernetes Volume abstraction solves both of these problems.
https://kubernetes.io/docs/concepts/storage/volumes/
Runtime Source/Function
Everything is API Driven
Serverless Architecture
 Kubernetes is API Driven Model
 Functions in FaaS are triggered by event types defined by the
provider.
 Functions to be triggered as a response to inbound http requests,
typically in some kind of API gateway. (e.g. AWS API
Gateway, Webtask)
 Fundamentally FaaS is about running back end code without
managing your own server systems or your own server
applications. That is the key difference when comparing with other
modern architectural trends like containers and PaaS (Platform as a
Service.)
 FaaS is seen as a better choice for event driven style with few event
types per application component, and containers are seen as a better
choice for synchronous-request driven components with many entry
points.
 https://martinfowler.com/articles/serverless.html - Must read article!
10
Kubernetes properties for FaaS!
1) Automatic orchestration - Seemless Deployments of Install and remove.
2) Horizontal Autoscale - Custom metrics can be pulled out easily for scaling.
3) K8s Cloud Native and serverless has same Workload Characteristics.
4) Expose service from function - HTTP services from k8s functions very easy to create.
5) Associate functions with k8s watches, triggers, HTTP routes.
6) Init container to load the dependencies that function might have.
7) ConfigMap for runtime load.
8) Custom Resource Definitions (CRD) to simulate function's metadata.
9) Volume mount / storage for custom source load.
10)Everything Remote API Driven!
Fission on K8S
Put together you get - Kubernetes Serverless Architecture Models
Custom
Commercial
Deployments
Open Source Serverless comparison
Commercial Serverless Feature comparison
https://cloudacademy.com/blog/microsoft-azure-functions-vs-google-cloud-functions-fight-for-serverless-cloud-domination-continues/
Kubernetes for Serverless  - Serverless Summit 2017 - Krishna Kumar
Container Orchestration Comparison
Container Orchestration Comparison
https://apprenda.com/white-papers/container-orchestration-comparison-guide
Container Orchestration Comparison
Astonishing growth
Kubernetes still lead the pack
in comparison to other container orchestration!
Some of the materials used in this presentation are taken from web.
Its used here just for educational purpose only. Thanks to all for those wonderful contents.  
Thanks……

More Related Content

PDF
On Prem Container Cloud - Lessons Learned
PPTX
Introduction to chef
PDF
Crafting Kubernetes Operators
PPT
Sebastien goasguen cloud stack the next year
PDF
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
PPT
Sebastien goasguen cloud stack and docker
PPTX
NetflixOSS for Triangle Devops Oct 2013
PDF
Setup Hybrid Clusters Using Kubernetes Federation
On Prem Container Cloud - Lessons Learned
Introduction to chef
Crafting Kubernetes Operators
Sebastien goasguen cloud stack the next year
Large Scale Kubernetes on AWS at Europe's Leading Online Fashion Platform - A...
Sebastien goasguen cloud stack and docker
NetflixOSS for Triangle Devops Oct 2013
Setup Hybrid Clusters Using Kubernetes Federation

What's hot (18)

PDF
Apache OpenWhisk Serverless Computing
PDF
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
PPTX
CI Implementation with Kubernetes at LivePerson by Saar Demri
PPTX
Serverless Reality
PDF
The Operator Pattern - Managing Stateful Services in Kubernetes
PDF
A curtain-raiser to the container world Docker & Kubernetes
PDF
[Spark Summit 2017 NA] Apache Spark on Kubernetes
PPTX
Webcast - Making kubernetes production ready
PDF
Containerised ASP.NET Core apps with Kubernetes
PPTX
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
PDF
Sf bay area Kubernetes meetup dec8 2016 - deployment models
PPTX
DevOps with Azure, Kubernetes, and Helm Webinar
PDF
Using Serverless Architectures to build and provision modern infrastructures​
PDF
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
PDF
Everything You Need to Know About Docker and Storage by Ryan Wallner, ClusterHQ
PPTX
Netflix0SS Services on Docker
PPTX
使用 Prometheus 監控 Kubernetes Cluster
PDF
Nginx conference 2015
Apache OpenWhisk Serverless Computing
Proof of Concept: Serverless with Swarm by Nirmal Mehta, Booz Allen Hamilton
CI Implementation with Kubernetes at LivePerson by Saar Demri
Serverless Reality
The Operator Pattern - Managing Stateful Services in Kubernetes
A curtain-raiser to the container world Docker & Kubernetes
[Spark Summit 2017 NA] Apache Spark on Kubernetes
Webcast - Making kubernetes production ready
Containerised ASP.NET Core apps with Kubernetes
Training And Serving ML Model Using Kubeflow by Jayesh Sharma
Sf bay area Kubernetes meetup dec8 2016 - deployment models
DevOps with Azure, Kubernetes, and Helm Webinar
Using Serverless Architectures to build and provision modern infrastructures​
Containers and Developer Defined Data Centers - Evan Powell - Keynote in Bang...
Everything You Need to Know About Docker and Storage by Ryan Wallner, ClusterHQ
Netflix0SS Services on Docker
使用 Prometheus 監控 Kubernetes Cluster
Nginx conference 2015
Ad

Viewers also liked (14)

PDF
Democratizing Serverless—The Open Source Fn Project - Serverless Summit
PDF
Blockchain - Apt Store for Serverless Apps - Nasir - Serverless Summit
PPTX
Serverless Summit India 2017: Fission
PDF
Serverless Summit - Quiz
PDF
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
PPTX
Serverless: Why is it hot and What is it not?
PDF
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
PPTX
Serverless in azure
PDF
Serverless Architecture Patterns - Manoj Ganapathi - Serverless Summit
PDF
Build a Chatbot in Ten Minutes - Dave Kerr - Serverless Summit
PDF
Application Security in a Container World - Akash Mahajan - BCC 2017
PDF
KUBERNETES AS A FRAMEWORK FOR WRITING DEVOPS & MICROSERVICES TOOLING
PDF
How to Contribute to Cloud Native Computing Foundation
PDF
Containers & Cloud Native Ops Cloud Foundry Approach
Democratizing Serverless—The Open Source Fn Project - Serverless Summit
Blockchain - Apt Store for Serverless Apps - Nasir - Serverless Summit
Serverless Summit India 2017: Fission
Serverless Summit - Quiz
Creating Event Driven Serverless Applications - Sandeep - Adobe - Serverless ...
Serverless: Why is it hot and What is it not?
IoT and Serverless - AWS - Serverless Summit - Madhusudan Shekar
Serverless in azure
Serverless Architecture Patterns - Manoj Ganapathi - Serverless Summit
Build a Chatbot in Ten Minutes - Dave Kerr - Serverless Summit
Application Security in a Container World - Akash Mahajan - BCC 2017
KUBERNETES AS A FRAMEWORK FOR WRITING DEVOPS & MICROSERVICES TOOLING
How to Contribute to Cloud Native Computing Foundation
Containers & Cloud Native Ops Cloud Foundry Approach
Ad

Similar to Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar (20)

PPTX
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
PDF
DevJam 2019 - Introduction to Kubernetes
PPTX
Introduction to Kubernetes
PDF
Introduction to Kubernetes Workshop
PDF
Docker Madison, Introduction to Kubernetes
PPTX
Introduction to kubernetes
PDF
Kubernetes: My BFF
PDF
Kubernetes Basics - ICP Workshop Batch II
PPTX
Introduction+to+Kubernetes-Details-D.pptx
PDF
Kubernetes From Scratch .pdf
PPTX
Introduction to Kubernetes
PPTX
TRAINING_ABOUT_KUBERNETES_Nguyen_Si_Nhan.pptx
PPTX
Kubernetes PPT.pptx
PPTX
Kubernetes Overview 101.pptxKubernetes Overview 101.pptx
PDF
Intro to Kubernetes
PDF
Scaling Microservices with Kubernetes
PDF
Kubernetes Architecture - beyond a black box - Part 1
PPTX
08 - kubernetes.pptx
PPTX
A brief study on Kubernetes and its components
PPTX
Kubernetes overview 101
01 - VMUGIT - Lecce 2018 - Fabio Rapposelli, VMware
DevJam 2019 - Introduction to Kubernetes
Introduction to Kubernetes
Introduction to Kubernetes Workshop
Docker Madison, Introduction to Kubernetes
Introduction to kubernetes
Kubernetes: My BFF
Kubernetes Basics - ICP Workshop Batch II
Introduction+to+Kubernetes-Details-D.pptx
Kubernetes From Scratch .pdf
Introduction to Kubernetes
TRAINING_ABOUT_KUBERNETES_Nguyen_Si_Nhan.pptx
Kubernetes PPT.pptx
Kubernetes Overview 101.pptxKubernetes Overview 101.pptx
Intro to Kubernetes
Scaling Microservices with Kubernetes
Kubernetes Architecture - beyond a black box - Part 1
08 - kubernetes.pptx
A brief study on Kubernetes and its components
Kubernetes overview 101

More from CodeOps Technologies LLP (20)

PDF
AWS Serverless Event-driven Architecture - in lastminute.com meetup
PPTX
Understanding azure batch service
PDF
DEVOPS AND MACHINE LEARNING
PDF
SERVERLESS MIDDLEWARE IN AZURE FUNCTIONS
PPT
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
PPTX
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
PPTX
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
PPTX
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
PPTX
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
PPTX
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
PPTX
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
PDF
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
PDF
YAML Tips For Kubernetes by Neependra Khare
PDF
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
PPTX
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
PDF
Jet brains space intro presentation
PDF
Functional Programming in Java 8 - Lambdas and Streams
PPTX
Distributed Tracing: New DevOps Foundation
PDF
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
PDF
Improve customer engagement and productivity with conversational ai
AWS Serverless Event-driven Architecture - in lastminute.com meetup
Understanding azure batch service
DEVOPS AND MACHINE LEARNING
SERVERLESS MIDDLEWARE IN AZURE FUNCTIONS
BUILDING SERVERLESS SOLUTIONS WITH AZURE FUNCTIONS
APPLYING DEVOPS STRATEGIES ON SCALE USING AZURE DEVOPS SERVICES
BUILD, TEST & DEPLOY .NET CORE APPS IN AZURE DEVOPS
CREATE RELIABLE AND LOW-CODE APPLICATION IN SERVERLESS MANNER
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
WRITE SCALABLE COMMUNICATION APPLICATION WITH POWER OF SERVERLESS
Deploy Microservices To Kubernetes Without Secrets by Reenu Saluja
Leverage Azure Tech stack for any Kubernetes cluster via Azure Arc by Saiyam ...
YAML Tips For Kubernetes by Neependra Khare
Must Know Azure Kubernetes Best Practices And Features For Better Resiliency ...
Monitor Azure Kubernetes Cluster With Prometheus by Mamta Jha
Jet brains space intro presentation
Functional Programming in Java 8 - Lambdas and Streams
Distributed Tracing: New DevOps Foundation
"Distributed Tracing: New DevOps Foundation" by Jayesh Ahire
Improve customer engagement and productivity with conversational ai

Recently uploaded (20)

PDF
System and Network Administraation Chapter 3
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Online Work Permit System for Fast Permit Processing
PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPT
JAVA ppt tutorial basics to learn java programming
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
ManageIQ - Sprint 268 Review - Slide Deck
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
ai tools demonstartion for schools and inter college
PDF
medical staffing services at VALiNTRY
PPTX
history of c programming in notes for students .pptx
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
Understanding Forklifts - TECH EHS Solution
DOCX
The Five Best AI Cover Tools in 2025.docx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
System and Network Administraation Chapter 3
Operating system designcfffgfgggggggvggggggggg
Online Work Permit System for Fast Permit Processing
2025 Textile ERP Trends: SAP, Odoo & Oracle
JAVA ppt tutorial basics to learn java programming
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
ManageIQ - Sprint 268 Review - Slide Deck
Upgrade and Innovation Strategies for SAP ERP Customers
How to Migrate SBCGlobal Email to Yahoo Easily
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
ai tools demonstartion for schools and inter college
medical staffing services at VALiNTRY
history of c programming in notes for students .pptx
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Understanding Forklifts - TECH EHS Solution
The Five Best AI Cover Tools in 2025.docx
Design an Analysis of Algorithms II-SECS-1021-03
Lecture 3: Operating Systems Introduction to Computer Hardware Systems

Kubernetes for Serverless - Serverless Summit 2017 - Krishna Kumar

  • 1. Why Kubernetes for Serverless? by Krishna Kumar, Huawei India CNCF Ambassador
  • 2. Content Evolution of Serverless world & then… Kubernetes Features towards Serverless…..
  • 3. Containers – The History Highlights 1979 UNIX chroot provide an isolated disk space for each process. Later in 1982 this was added to BSD FreeBSD Jails additional process sandboxing features for isolating the filesystem, users, networking, etc 2000 2001 Linux VServer securely partition resources on a computer system (file system, CPU time, network addresses and memory) 2004 Solaris Containers combination of system resource controls and the boundary separation provided by zones 2005 OpenVZ isolated file system, users and user groups, a process tree, network, devices, and IPC objects. 2006 Process Containers limiting, accounting, and isolating resource usage (CPU, memory, disk I/O, network, etc.) of a collection of processes 2007 Control Groups Control Groups AKA cgroups was implemented by Google and added to the Linux Kernel in 2007 2011 Warden Warden was implemented by CloudFoundry in year 2011 by using LXC at the initial stage 2013 LMCTFY lmctfy stands for “Let Me Contain That For You”. It is the open source version of Google’s container stack LXC LXC stands for LinuX Containers and it is the first, most complete implementation of Linux container manager 2008 2013 Docker Docker is the most popular and widely used container management system as of January 2016 2014 Rocket Rocket is a much similar initiative to Docker started by CoreOS for fixing some of the drawbacks 2016 Windows Containers Run Docker containers on Windows natively without having to run a virtual machine to run Docker
  • 5. Evolution of Applications Development MainFrame Client/Server SOA MSA Serverless
  • 6. Serverless Evolution 2014-11 2015-10 2016-01 2016-2 2016-4 2016-5 Serverless 2016-6 OpenLambda 2016-7 DC/OS serverlessApcera AWS Lambda 2016-3
  • 9. Serverless From BIG Players • AWS lambda - https://aws.amazon.com/lambda/ • Azure Functions - https://azure.microsoft.com/en-in/services/functions/ • Google Cloud Functions - https://cloud.google.com/functions/ • IBM OpenWhisk - https://www.ibm.com/cloud-computing/bluemix/openwhisk • Oracle Fn - https://blogs.oracle.com/emeapartnerweblogic/serverless-architecture-on-the-oracle- paas-cloud-by-lucas-jellema
  • 10. Serverless Implementations - Others  Fission.io (https://github.com/fission/fission)  Kubeless (https://github.com/bitnami/kubeless)  Iron Functions (https://github.com/iron-io/functions)  Fabric8’s (https://github.com/funktionio/funktion)  Alex’s (https://github.com/alexellis/faas) (Use Docker Swarm)  Galactic fog (https://github.com/GalacticFog)  Ovrclk.com (not open source)  Lightbend - www.lightbend.com  Iceroad www.iceroad.io  AuthO Webtasks - https://auth0.com/blog/building-serverless-apps-with-webtask/
  • 12. A Severless Architecture (Amazon Lambda)
  • 13. Severless Architecture Benefits & Drawback (From AWS)
  • 14. Serverless is misnormal…... It is Functions as a Service (FaaS)
  • 16. Kubernetes Orchestration Engine1 Setup • On Cloud infrastructure • Google • AWS • Azure • IBM Blue Mix • On local machine • MiniKube • Ubuntu on LXD • Kubeadm • IBM Cloud Private CE
  • 17. Kubernetes – AutoScale with custom metrics • With Horizontal Pod Autoscaling, Kubernetes automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics). • Needs Heapster and Cadvisor (already a part of Kubernetes) • Resource Metric Source (CPU or Memory). Per-pod resource metrics (like CPU), • The key operational difference between FaaS and PaaS is scaling. With most PaaS’s you still need to think about scale. • FaaS needs infrastructure and k8s supports that well. From Function it creates services and manage its life cycle. • https://kubernetes.io/docs/tasks/run- application/horizontal-pod-autoscale/ 2
  • 18. Kubernetes – Workloads • StatefulSet - Stateful Application that needs reasonable handling • Like Database • In-memory Cache • Peer – Peer applications that needs storage • Any application that needs network identity • Stateless - For stateless application to deal with complex workflow • Like webservers • Are stateless in nature that needs on- demand scale • Needs rolling update • Jobs - Run once type of workloads • Useful for running scripts, reports and batch jobs • Like DB-Query • Like Spark / Hadoop processing • CornJobs – Run once type of Jobs by repeat in a frequency • Just like unix CornJob • Runs a job at a given schedule • DaemonSet – Run on all the Nodes as much as possible • Runs in every node in the cluster. • For starting monitoring applications on every node. • ReplicaSet – Run and manage multiple Pods lifecycle. • Elementry Controller for managing PODs • Used by Deployment. FaaS Workloads • Time based processing/CRON job • Time based recurring jobs, clean up etc. • Event processing • Servicing SaaS & cloud events like changes is Storage, DB, etc. and to display it in graphical way • Web applications • Single web page apps, that manage user data store/display/customization. • Mobile backend • Mobile client can use HTTP APIs to store/process, eg. Photos • Real-time stream processing • IoT devices can send messages for stream analytics • Real-time bot messaging • Chat/Message bots • Answer questions using AI (Cortana)  FaaS functions are stateless. The ‘Twelve- Factor App’ concept is also same. 3 12 factors (solid principle for Cloud Software Architecture) Codebase One codebase tracked in revision control, many deploys Dependencies Explicitly declare and isolate dependencies Config Store configuration in the environment Backing Services Treat backing services as attached resources Build, release, run Strictly separate build and run stages Processes Execute the app as one or more stateless processes Port binding Export services via port binding Concurrency Scale out via the process model Disposability Maximize robustness with fast startup and graceful shutdown Dev/prod parity Keep development, staging, and production as similar as possible Logs Treat logs as event streams Admin processes Run admin/management tasks as one-off processes K8s Cloud Native and Serverless has same Workload Characteristics
  • 19. Expose Service from Function4  A Service in Kubernetes is an abstraction which defines a logical set of Pods and a policy by which to access them.  Services enable a loose coupling between dependent Pods. A Service is defined using YAML (preferred) or JSON, like all Kubernetes objects.  The set of Pods targeted by a Service is usually determined by a LabelSelector  Although each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service. Services allow your applications to receive traffic. Services can be exposed in different ways by specifying a type in the ServiceSpec (ClusterIP, NodePort, LoadBalancer, External Name)  HTTP services from k8s from functions very easy to create.  API based calls – deal with event handlers (notification from other services)  Idle function only use storage and consume only CPU/memory when at use – trigger fires. Function can run at source level, or as buildpack or as docker images. https://kubernetes.io/docs/tutorials/kubernetes-basics/expose-intro/
  • 20. Associate functions with k8s watches, triggers, HTTP routes5 Watch resource from k8s API – Native integration with k8s •POD problem •Other events •Do something Create function and add them using CLI/etc.. Then associate functions with k8s watches, triggers, HTTP routes. Issue a watch request using normal http request - the API consumes and returns JSON messages. Labels can be used to organize and to select subsets of objects. Labels can be attached to objects at creation time and subsequently added and modified at any time. Funktion – Apache Camel Connector (some thing happens do something) Step Functions – One after another events. Call in sequence order. https://stackoverflow.com/questions/35192712/kubernetes-watch-pod-events-with-api
  • 21. Init Container6 A Pod can have multiple Containers running apps within it, but it can also have one or more Init Containers, which are run before the app Containers are started. Init Containers are exactly like regular Containers, except: •They always run to completion. •Each one must complete successfully before the next one is started. They all must run to completion before the Pod can be ready. https://kubernetes.io/docs/concepts/workloads/pods/i nit-containers/ Init Containers Can be used for - Sleep - Register Pod - Clone a git - Place value to config file
  • 22. Kuberntes Config Map7 Config map to inject function's code to the runtime pod. The ConfigMap API resource provides mechanisms to inject containers with configuration data while keeping containers agnostic of Kubernetes ConfigMaps allow you to decouple configuration artifacts from image content to keep application portable. ConfigMap is similar to Secrets, but provides a means of working with strings that don’t contain sensitive information The ConfigMap’s data field contains the configuration data. As shown in the example, this can be simple – like individual properties defined using --from-literal – or complex – like configuration files or JSON blobs defined using --from-file. There is size limitations exists. https://kubernetes.io/docs/tasks/configure-pod- container/configmap/
  • 23. Custom Resource Definitions (CRD) to simulate function's metadata8 From Kubeless documents (how they run): •There is a CRD endpoint being deploy called function.k8s.io: •Then function custom objects will be created under this CRD endpoint. •function.spec contains function's metadata including code, handler, runtime, type (http or pubsub) and probably its dependency file. •Custom controller watch changes of function objects and react accordingly to deploy/delete K8S deployment/svc/configmap. These containers fetch all the dependencies and share them with the function runtimes using volumes. •The runtimes are pre-built docker images that wrap the functions in an HTTP server or in a Kafka consumer. Indeed, to be able to trigger functions via events we currently use Kafka. •There are currently two type of functions supported in Kubeless: http-based and pubsub-based. A set of Kafka and Zookeeper is installed into the kubeless namespace to handle the pubsub-based functions. https://github.com/kubeless/kubeless/blob/master/docs/architecture.md May be useful in some implementations………
  • 24. Volume mount / storage for custom source load9 On-disk files in a container are ephemeral, which presents some problems for non-trivial applications when running in containers. First, when a container crashes, kubelet will restart it, but the files will be lost - the container starts with a clean state. Second, when running containers together in a Pod it is often necessary to share files between those containers. The Kubernetes Volume abstraction solves both of these problems. https://kubernetes.io/docs/concepts/storage/volumes/ Runtime Source/Function
  • 25. Everything is API Driven Serverless Architecture  Kubernetes is API Driven Model  Functions in FaaS are triggered by event types defined by the provider.  Functions to be triggered as a response to inbound http requests, typically in some kind of API gateway. (e.g. AWS API Gateway, Webtask)  Fundamentally FaaS is about running back end code without managing your own server systems or your own server applications. That is the key difference when comparing with other modern architectural trends like containers and PaaS (Platform as a Service.)  FaaS is seen as a better choice for event driven style with few event types per application component, and containers are seen as a better choice for synchronous-request driven components with many entry points.  https://martinfowler.com/articles/serverless.html - Must read article! 10
  • 26. Kubernetes properties for FaaS! 1) Automatic orchestration - Seemless Deployments of Install and remove. 2) Horizontal Autoscale - Custom metrics can be pulled out easily for scaling. 3) K8s Cloud Native and serverless has same Workload Characteristics. 4) Expose service from function - HTTP services from k8s functions very easy to create. 5) Associate functions with k8s watches, triggers, HTTP routes. 6) Init container to load the dependencies that function might have. 7) ConfigMap for runtime load. 8) Custom Resource Definitions (CRD) to simulate function's metadata. 9) Volume mount / storage for custom source load. 10)Everything Remote API Driven!
  • 27. Fission on K8S Put together you get - Kubernetes Serverless Architecture Models Custom Commercial Deployments
  • 29. Commercial Serverless Feature comparison https://cloudacademy.com/blog/microsoft-azure-functions-vs-google-cloud-functions-fight-for-serverless-cloud-domination-continues/
  • 34. Kubernetes still lead the pack in comparison to other container orchestration! Some of the materials used in this presentation are taken from web. Its used here just for educational purpose only. Thanks to all for those wonderful contents.   Thanks……