Service Mesh and
Serverless Chatbots with
Linkerd, K8s and
OpenFaaS
Sergio Méndez
Unidos compartiendo y aprendiendo
#SGVirtual
About me
● Operating Systems Professor
● Entrepreneur(curzona.com)
● Cloud Native enthusiast
● DevOps Consultor
● (Cloud-Native)+GT Meetup
Organizer
Sergio Méndez
Service Mesh and Serverless Chatbots
with Linkerd, K8s and OpenFaaS
IT Infrastructure Evolution
Ref: Tal, L. (2019). Serverless Security. O’Reilly Media.
Monolith Containers
Orchestrators
Serverless
Ref: Tal, L. (2019). Serverless Security. O’Reilly Media.
Ref: https://blogs.gartner.com/tony-iams/containers-serverless-computing-pave-way-cloud-native-infrastructure/
Basic concepts
#1 Cloud Native
Cloud-native is an approach to building and
running applications that exploits the advantages
of the cloud computing model.
Ref: https://tanzu.vmware.com/de/cloud-native
#2 Cloud Native
Cloud native technologies empower organizations
to build and run scalable applications in modern,
dynamic environments such as public, private, and
hybrid clouds. Containers, service meshes,
microservices, immutable infrastructure, and
declarative APIs exemplify this approach.
Ref: https://github.com/cncf/toc/blob/master/DEFINITION.md
What is serverless?
“An architectural approach to software solutions
that relies on small independent functions running
on transient servers in an elastic runtime
environment.”
Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
Serverless means a high level server abstraction,
so you don't need to manage your servers
anymore.
Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
The fallacies of distributed
computing”
● The network is
reliable
● Latency is zero
● Bandwidth is
infinite
● The network is
secure
● Topology doesn’t
change
● There is one
administrator
● Transport cost is zero
● The network is
homogeneous
Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
Serverless Platform features
● Event-Driven
● Streaming Data
● Auto-Scaling
● Fault Tolerance
Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
The Goods and the Bads
● Cheaper than the
traditional cloud
● Scalable
● Lower Ops costs
● Focus on user
experience/Devs
Ref: https://dzone.com/articles/the-good-and-the-bad-of-serverless-architecture
● Vendor lock-in
● Learning curve
● Unsuitable for
long-term tasks
● Doesnt support
many languages
About controlling the system
“they have a great deal of control over the
design and definition of the solution but very
little control over the system once it is
deployed to the platform.”
Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
Use Cases
● Internet of Things applications
● Virtual assistants and chatbots
● Auto-scaling Websites and APIs
● Event streaming(pub/sub,logs)
● Image and Video Manipulation
● Processing Events and SaaS
● Multi-language Applications
● CI/CD
Ref: https://serverless.com/learn/use-cases/
What is Service Mesh?
Is a dedicated infrastructure layer for handling
service-to-service communication in order to make
it visible, manageable, and controlled. Generally
every service mesh is implemented as a series (or a
“mesh”) of interconnected network proxies
designed to better manage service traffic.
Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
Ref: https://containerjournal.com/topics/container-ecosystems/what-is-service-mesh-and-why-do-we-need-it/
Ref: https://containerjournal.com/topics/container-ecosystems/what-is-service-mesh-and-why-do-we-need-it/
Service Mesh has 2
components:
● data plane
● control plane
Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
Data plane
The data plane is the layer responsible for moving
your data (e.g., service requests) through your
service topology in real time. Because this layer is
implemented as a series of interconnected proxies
and commonly deployed as one per
communication endpoint. Just how “transparent”
the communication is depends on the specific
endpoint type you choose.
Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
Control plane
A control plane exposes new primitives you can
use to alter how your services communicate. You
use the new primitives to compose some form of
policy: routing decisions, authorization, rate limits,
and so on. When that policy is ready for use, the
data plane can reference that new policy and alter
its behavior accordingly.
Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
Linkerd is an ultralight service mesh for
Kubernetes. It gives you observability,
reliability, and security without requiring
any code changes.
Ref: https://linkerd.io/
Ref: https://linkerd.io/
What does Linkerd do?
● Observability: Service-level
golden metrics: success rates,
latencies, throughput. Service
topologies.
● Reliability: Retries, timeouts, load
balancing, circuit breaking
● Security: Transparent mTLS, cert
management and rotation,
policy
In an ultralight package focused on
operational simplicity first and
foremost.
Ref: https://linkerd.io/
Why should I care?
Linkerd gives ...
... platform owners (SREs, architects)
... the observability, reliability, and security primitives
... that are critical for cloud native architectures
... with no developer involvement!
Linkerd doesn't just solve technical problems,
it solves socio-technical problems: by
decoupling them developers, it gives platform
owners control over their destiny.
👈 Who?
👈 What?
👈 Why?
👈 The magic
Ref: https://linkerd.io/
OpenFaaS
OpenFaaS is an open source serverless platform
to provide an easy for developers to deploy
event-driven functions and microservices to
Kubernetes without repetitive, boiler-plate coding.
Package your code or an existing binary in a
Docker image to get a highly scalable endpoint
with auto-scaling and metrics.
Ref: https://www.openfaas.com/
Features
● Ease UI portal and one-click install functions
● Package functions in any language for
Linux/Windows using Docker/OCI image
● Portable, runs on existing hardware,
public/private cloud, Kubernetes and Docker
Swarm native
● CLI, YAML format for templating/defining
functions
● Auto-scales as demand increases
Ref: https://www.openfaas.com/
OpenFaaS Layers
Ref: https://www.openfaas.com/
Reference Architecture
Ref: https://docs.openfaas.com/architecture/stack/#conceptual-workflow
Serverless Real Use Case
Telecom needs
Build a tool to create assisted chatbots that
automate sales, support, monitoring, etc., using IM
APIs from Slack, Telegram, Whatsapp, Facebook,
etc.
Telecom Application requirements
● Prevent vendor lock-in
● Fast integration with technologies
● Short development time
● Implement DevOps & CI/CD
● Spend less money on cloud infrastructure
● Performance
● Resilience system
● Observability
Solution
● OpenFaaS(Serverless Platform)
● Linkerd(Canary Deployments, Observability)
● Kubernetes(Scaling & Orchestration)
Chatbot interactions
Instant
Messengers Platform
Ref: https://www.doc.ic.ac.uk/project/examples/2005/163/g0516334/index.html
Serverless Chatbot Architecture
Ref: https://github.com/openfaas-incubator/openfaas-linkerd2
Benefits for this solution
● Zero vendor lock-in
● Fast integration with technologies
● Short development time
● CI/CD ready platform
● Spend less money in a smart way
● Autoscalable application
● Resilience system
● Observability without modifications
Demo
This demo shows:
● Claudia Slack Chatbot
● OpenFaaS functions templates
● Linkerd integrations
● Canary deployments
● Observability
https://github.com/sergioarmgpl/
linkerd-chatbots-openfaas
Questions
References
● George Miranda, The Service Mesh, O’Reilly Media
● Liran Tal. Serverless Security. O’Reilly Media
● Linkerd, https://linkerd.io
● OpenFaas, https://www.openfaas.com
● Container Journal, https://bit.ly/38qR3I9
● Imperial College, Agents. https://bit.ly/2UmXFRV
● Serverless Use Cases, https://bit.ly/33uDO7F
Resources
● https://linkerd.io
● https://www.openfaas.com
Facebook:
https://www.facebook.com/groups/cloudnativeplusgt
Youtube: https://bit.ly/324h9N5
Meetup:
https://www.meetup.com/cloud-native-plus-gt
Twitter: https://twitter.com/cloudnativepgt
Personal email
sergioarm.gpl@gmail.com
Social networks
@sergioarmgpl

Service Mesh and Serverless Chatbots with Linkerd, K8s and OpenFaaS

  • 1.
    Service Mesh and ServerlessChatbots with Linkerd, K8s and OpenFaaS Sergio Méndez Unidos compartiendo y aprendiendo #SGVirtual
  • 3.
    About me ● OperatingSystems Professor ● Entrepreneur(curzona.com) ● Cloud Native enthusiast ● DevOps Consultor ● (Cloud-Native)+GT Meetup Organizer Sergio Méndez
  • 4.
    Service Mesh andServerless Chatbots with Linkerd, K8s and OpenFaaS
  • 5.
  • 6.
    Ref: Tal, L.(2019). Serverless Security. O’Reilly Media.
  • 7.
    Monolith Containers Orchestrators Serverless Ref: Tal,L. (2019). Serverless Security. O’Reilly Media.
  • 8.
  • 9.
  • 10.
    #1 Cloud Native Cloud-nativeis an approach to building and running applications that exploits the advantages of the cloud computing model. Ref: https://tanzu.vmware.com/de/cloud-native
  • 11.
    #2 Cloud Native Cloudnative technologies empower organizations to build and run scalable applications in modern, dynamic environments such as public, private, and hybrid clouds. Containers, service meshes, microservices, immutable infrastructure, and declarative APIs exemplify this approach. Ref: https://github.com/cncf/toc/blob/master/DEFINITION.md
  • 12.
    What is serverless? “Anarchitectural approach to software solutions that relies on small independent functions running on transient servers in an elastic runtime environment.” Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
  • 13.
    Serverless means ahigh level server abstraction, so you don't need to manage your servers anymore. Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
  • 14.
    The fallacies ofdistributed computing” ● The network is reliable ● Latency is zero ● Bandwidth is infinite ● The network is secure ● Topology doesn’t change ● There is one administrator ● Transport cost is zero ● The network is homogeneous Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
  • 15.
    Serverless Platform features ●Event-Driven ● Streaming Data ● Auto-Scaling ● Fault Tolerance Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
  • 16.
    The Goods andthe Bads ● Cheaper than the traditional cloud ● Scalable ● Lower Ops costs ● Focus on user experience/Devs Ref: https://dzone.com/articles/the-good-and-the-bad-of-serverless-architecture ● Vendor lock-in ● Learning curve ● Unsuitable for long-term tasks ● Doesnt support many languages
  • 17.
    About controlling thesystem “they have a great deal of control over the design and definition of the solution but very little control over the system once it is deployed to the platform.” Ref: Amundsen M. (2020). What is serverless?. O’Reilly Media
  • 18.
    Use Cases ● Internetof Things applications ● Virtual assistants and chatbots ● Auto-scaling Websites and APIs ● Event streaming(pub/sub,logs) ● Image and Video Manipulation ● Processing Events and SaaS ● Multi-language Applications ● CI/CD Ref: https://serverless.com/learn/use-cases/
  • 19.
    What is ServiceMesh? Is a dedicated infrastructure layer for handling service-to-service communication in order to make it visible, manageable, and controlled. Generally every service mesh is implemented as a series (or a “mesh”) of interconnected network proxies designed to better manage service traffic. Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
  • 20.
  • 21.
  • 22.
    Service Mesh has2 components: ● data plane ● control plane Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
  • 23.
    Data plane The dataplane is the layer responsible for moving your data (e.g., service requests) through your service topology in real time. Because this layer is implemented as a series of interconnected proxies and commonly deployed as one per communication endpoint. Just how “transparent” the communication is depends on the specific endpoint type you choose. Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
  • 24.
    Control plane A controlplane exposes new primitives you can use to alter how your services communicate. You use the new primitives to compose some form of policy: routing decisions, authorization, rate limits, and so on. When that policy is ready for use, the data plane can reference that new policy and alter its behavior accordingly. Ref: Miranda G. (2018). The Service Mesh. O’Reilly Media.
  • 26.
    Linkerd is anultralight service mesh for Kubernetes. It gives you observability, reliability, and security without requiring any code changes. Ref: https://linkerd.io/
  • 27.
  • 28.
    What does Linkerddo? ● Observability: Service-level golden metrics: success rates, latencies, throughput. Service topologies. ● Reliability: Retries, timeouts, load balancing, circuit breaking ● Security: Transparent mTLS, cert management and rotation, policy In an ultralight package focused on operational simplicity first and foremost. Ref: https://linkerd.io/
  • 29.
    Why should Icare? Linkerd gives ... ... platform owners (SREs, architects) ... the observability, reliability, and security primitives ... that are critical for cloud native architectures ... with no developer involvement! Linkerd doesn't just solve technical problems, it solves socio-technical problems: by decoupling them developers, it gives platform owners control over their destiny. 👈 Who? 👈 What? 👈 Why? 👈 The magic Ref: https://linkerd.io/
  • 31.
    OpenFaaS OpenFaaS is anopen source serverless platform to provide an easy for developers to deploy event-driven functions and microservices to Kubernetes without repetitive, boiler-plate coding. Package your code or an existing binary in a Docker image to get a highly scalable endpoint with auto-scaling and metrics. Ref: https://www.openfaas.com/
  • 32.
    Features ● Ease UIportal and one-click install functions ● Package functions in any language for Linux/Windows using Docker/OCI image ● Portable, runs on existing hardware, public/private cloud, Kubernetes and Docker Swarm native ● CLI, YAML format for templating/defining functions ● Auto-scales as demand increases Ref: https://www.openfaas.com/
  • 33.
  • 34.
  • 35.
  • 36.
    Telecom needs Build atool to create assisted chatbots that automate sales, support, monitoring, etc., using IM APIs from Slack, Telegram, Whatsapp, Facebook, etc.
  • 37.
    Telecom Application requirements ●Prevent vendor lock-in ● Fast integration with technologies ● Short development time ● Implement DevOps & CI/CD ● Spend less money on cloud infrastructure ● Performance ● Resilience system ● Observability
  • 38.
    Solution ● OpenFaaS(Serverless Platform) ●Linkerd(Canary Deployments, Observability) ● Kubernetes(Scaling & Orchestration)
  • 39.
    Chatbot interactions Instant Messengers Platform Ref:https://www.doc.ic.ac.uk/project/examples/2005/163/g0516334/index.html
  • 40.
    Serverless Chatbot Architecture Ref:https://github.com/openfaas-incubator/openfaas-linkerd2
  • 41.
    Benefits for thissolution ● Zero vendor lock-in ● Fast integration with technologies ● Short development time ● CI/CD ready platform ● Spend less money in a smart way ● Autoscalable application ● Resilience system ● Observability without modifications
  • 42.
    Demo This demo shows: ●Claudia Slack Chatbot ● OpenFaaS functions templates ● Linkerd integrations ● Canary deployments ● Observability
  • 43.
  • 44.
  • 45.
    References ● George Miranda,The Service Mesh, O’Reilly Media ● Liran Tal. Serverless Security. O’Reilly Media ● Linkerd, https://linkerd.io ● OpenFaas, https://www.openfaas.com ● Container Journal, https://bit.ly/38qR3I9 ● Imperial College, Agents. https://bit.ly/2UmXFRV ● Serverless Use Cases, https://bit.ly/33uDO7F
  • 46.
  • 47.
  • 48.