Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019

23 views

Published on

When you build a serverless app, you either tie yourself to a cloud provider, or you end up building your own serverless stack. Knative provides a better choice. Knative extends Kubernetes to provide a set of middleware components (build, serving, events) for modern, source-centric, and container-based apps that can run anywhere. In this talk, we’ll see how we can use Knative primitives to build a serverless app that utilizes the Machine Learning magic of the cloud.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Mete Atamel - Serverless with Knative - Codemotion Amsterdam 2019

  1. 1. Serverless with Knative Mete Atamel Developer Advocate at Google @meteatamel github.com/meteatamel/knative-tutorial
  2. 2. Confidential & Proprietary bit.ly/knative-survey
  3. 3. Introduction to Knative
  4. 4. Confidential & Proprietary What is Knative? Kubernetes based open source building blocks for serverless
  5. 5. Confidential & Proprietary Ideal Serverless No servers Idiomatic Event-driven Portable
  6. 6. Confidential & Proprietary Kubernetes Service Pods Each pod containers one or more containers Nodes Role: frontend Role: frontend Role: frontend Role: frontend Replication controller Replicas: 3 Env: prod microservice labels Service communication channel Blueprint “pod template” Env: prod Env: prod Env: prod registry containers
  7. 7. Confidential & Proprietary Developers want serverless ... just want to run their code. ... want to use their favorite languages and dependencies. ... don't want to manage the infrastructure. Operators want Kubernetes Kubernetes is great orchestrating microservices They love using GKE and not having to do operations for Kubernetes. Kubernetes is not the right abstraction for their developers.
  8. 8. Confidential & Proprietary Knative Project - github.com/knative Set of components (serving, eventing, build) Ingredients for Serverless Solves for modern development patterns Implements learnings from Google, partners
  9. 9. Knative stack Build Serving KubernetesPlatform Products Primitives Events ... Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Pivotal riff OpenFaaS T-mobile Jazz IstioService Mesh
  10. 10. Confidential & Proprietary Knative Stack Build Serving KubernetesPlatform Products Primitives Events ... Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Pivotal riff OpenFaaS T-mobile Jazz IstioService Mesh # Get a Kubernetes Cluster $ gcloud container clusters create hello-knative --cluster-version=latest --num-nodes=3 --zone europe-west1-b --scopes=service-control,service-management,compute-rw,storage-ro,cloud-platform,l ogging-write,monitoring-write,pubsub,datastore Creating cluster hello-knative...done. NAME LOCATION MASTER_VERSION MASTER_IP MACHINE_TYPE NODE_VERSION NUM_NODES STATUS Hello-knative europe-west1-b 1.10.7-gke.6 35.190.192.251 n1-standard-1 1.10.7-gke.6 4 RUNNING # Create Cluster Role Binding $ kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud config get-value core/account) clusterrolebinding "cluster-admin-binding" created
  11. 11. Confidential & Proprietary Knative Stack Build Serving KubernetesPlatform Products Primitives Events ... Serverless Containers on GCF GKE Serverless Add-on SAP Kyma Pivotal Function Service IBM Cloud Functions Red Hat Cloud Functions Pivotal riff OpenFaaS T-mobile Jazz IstioService Mesh # Install Istio $ kubectl apply -f https://github.com/knative/serving/releases/download/v0.3.0/istio-crds.yaml && kubectl apply -f https://github.com/knative/serving/releases/download/v0.3.0/istio.yaml # Install Knative Serving, Build, Eventing $ kubectl apply -f https://github.com/knative/serving/releases/download/v0.3.0/serving.yaml -f https://github.com/knative/build/releases/download/v0.3.0/release.yaml -f https://github.com/knative/eventing/releases/download/v0.3.0/release.yaml -f https://github.com/knative/eventing-sources/releases/download/v0.3.0/release.yaml -f https://github.com/knative/serving/releases/download/v0.3.0/monitoring.yaml
  12. 12. Knative Serving
  13. 13. Confidential & Proprietary Knative Serving What is it? Rapid deployment and autoscaling of serverless containers. Seamlessly scale up and down Built-in traffic splitting between revisions Integrates networking and service mesh automatically Pluggable Connect to your own logging and monitoring platform, or use the built-in system Auto-scaler can be tuned or swapped out for custom code
  14. 14. Confidential & Proprietary Knative Serving Primitives Knative Service High level abstraction for the application Configuration Current/desired state of an application Code & configuration separated (a la 12-factor) Revision Point in time snapshots for your code and configuration Route Maps traffic to revisions
  15. 15. Knative Eventing
  16. 16. Confidential & Proprietary Knative Eventing What is it? For loosely coupled, event-driven services Declaratively bind between event producers and Knative services Scales from just few events to live streams Custom event pipelines to connect with your own existing systems Event type Flow Event source Event type Event type Event consumer(s) KubernetesEventSource GitHubSource GcpPubSubSource AwsSqsSource ContainerSource CronJobSource
  17. 17. Confidential & Proprietary Knative Eventing
  18. 18. Confidential & Proprietary Integrate Cloud Storage to Vision API Cloud Storage Bucket Cloud Storage -> Cloud PubSub -> Knative Eventing -> Knative Servicing -> Vision API Cloud PubSub Topic Knative Eventing Channel Knative Serving GKE Cloud Vision API Labels
  19. 19. Knative Build
  20. 20. Confidential & Proprietary Knative Build What is it? Go from source code to container images on repositories Build pipelines can have multiple steps and can push to different registries Builds run in containers in the cluster. No need for Docker locally Primitives Build: Represents an in-cluster build job with 1 or more steps BuildTemplate: A set of ordered and parameterized build steps. Builder: A container in a Build step that performs an action (eg. build) ServiceAccount: For authentication with DockerHub etc.
  21. 21. Confidential & Proprietary Thank you! @meteatamel github.com/meteatamel/knative-tutorial github.com/knative cloud.google.com/knative

×