{"id":721,"date":"2020-07-22T16:51:42","date_gmt":"2020-07-22T14:51:42","guid":{"rendered":"https:\/\/aymen-segni.com\/?p=721"},"modified":"2020-07-23T17:25:30","modified_gmt":"2020-07-23T15:25:30","slug":"deploying-your-serverless-services-on-kubernetes-using-knative","status":"publish","type":"post","link":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/","title":{"rendered":"Deploying Serverless Services on Kubernetes using Knative"},"content":{"rendered":"\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Welcome<\/h2>\n\n\n\n<p>Thanks for visiting this written\u00a0workshop on deploying serverless services on Kubernetes using Knative.<br>This\u00a0lab is designed to give you an idea of what <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/knative.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">Knative<\/a> does, how you use Knative API to deploy applications and how it relates to <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/kubernetes.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kubernetes<\/a>.<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Assumptions and Prerequisites<\/h2>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>Basic hands-on experience with Kubernetes.<\/li><li>Up and Running Kubernetes Cluster (e.g GKE, AKS, EKS,..) v1.15 or newer<\/li><li>You have <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/kubernetes.io\/docs\/reference\/kubectl\/overview\/\" target=\"_blank\" rel=\"noreferrer noopener\">kubectl<\/a> \u00a0installed in your local machine.<\/li><li>You have <a href=\"https:\/\/golang.org\/doc\/install\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\">Go<\/a> installed in your local machine<\/li><\/ul>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Objectives: what you will learn ?<\/h2>\n\n\n\n<ol class=\"ul-black wp-block-list\"><li>\u2705 How to install Knative on a Kubernetes cluster<\/li><li>\u2705 Deploy a web application from source to Knative<\/li><li>\u2705 Autoscale applications from 0-to-1, 1-to-N, and back to 0<\/li><li>\u2705 Knative Serving API types and the relationship between them<\/li><li>\u2705 Roll out new versions (blue\/green deployments) with Knative Serving API<\/li><\/ol>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">Before starting<\/h2>\n\n\n\n<p>Knative is installed as a set of custom APIs and controllers on Kubernetes. You can easily create managed Kubernetes cluster with&nbsp;<a href=\"https:\/\/cloud.google.com\/kubernetes-engine\/\" target=\"_blank\" rel=\"noreferrer noopener\">Google Kubernetes Engine (GKE)<\/a> also with <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/aws.amazon.com\/eks\/\" target=\"_blank\" rel=\"noreferrer noopener\">Amazon Elastic Kubernetes Service<\/a>&nbsp;and have operate the cluster and autoscaling for you.<br>In this lab, in order of deploying serverless Services on Kubernetes using Knative, we&#8217;ll be using <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/azure.microsoft.com\/de-de\/services\/kubernetes-service\/\" target=\"_blank\" rel=\"noreferrer noopener\">Azure AKS<\/a> -Azure&#8217;s Managed Kubernetes Service- as our K8S backend cluster.<\/p>\n\n\n\n<p>To create an Azure AKS cluster, preferably you use an Infrastructure as Code tool like Terraform. Although cluster creation isn\u2019t covered by this lab, however you can follow my <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/aymen-segni.com\/index.php\/2019\/12\/24\/create-a-kubernetes-cluster-with-azure-aks-using-terraform\/\" target=\"_blank\" rel=\"noreferrer noopener\">IaC lab to deploy AKS with Terraform <\/a> <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"475\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12-1024x475.png\" alt=\"build your Serverless Services on Kubernetes using Knative, we'll be using Azure AKS\" class=\"wp-image-727\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 2048w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 1280w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-12.47.12.png 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Azure AKS K8S Cluster<\/figcaption><\/figure>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\" id=\"connect-to-cluster-using-kubectl\">Connect to cluster using kubectl<\/h4>\n\n\n\n<p>To configure&nbsp;<code>kubectl<\/code>&nbsp;to connect to your Kubernetes cluster, use the&nbsp;<a href=\"https:\/\/docs.microsoft.com\/en-us\/cli\/azure\/aks#az-aks-get-credentials\">az aks get-credentials<\/a>&nbsp;command. Following example gets credentials for the AKS cluster named&nbsp;<em>myAKSCluster<\/em>&nbsp;in the&nbsp;<em>myResourceGroup<\/em>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\n<pre class=\"terminal\"><code>\naz aks get-credentials --resource-group myResourceGroup --name myAKSCluster<\/code><\/pre>\n<\/code><\/pre>\n\n\n\n<p>To verify the connection to your cluster, run the&nbsp;<a href=\"https:\/\/kubernetes.io\/docs\/reference\/generated\/kubectl\/kubectl-commands#get\">kubectl get nodes<\/a>&nbsp;command to return a list of the cluster nodes. <\/p>\n\n\n\n<p>Now you have a fully-provisioned Kubernetes cluster running in Azure, and you&#8217;re ready to install Knative on it!<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">1- Introduction to Knative<\/h2>\n\n\n\n<p>Knative (pronounced kay-nay-tiv) extends&nbsp;<a href=\"https:\/\/kubernetes.io\/docs\/concepts\/overview\/what-is-kubernetes\/\">Kubernetes<\/a>&nbsp;to provide a set of middleware components that are essential to build modern, source-centric, and container-based applications that can run anywhere: on premises, in the cloud, or even in a third-party data center.<\/p>\n\n\n\n<p>Knative makes it possible to:<\/p>\n\n\n\n<ol type=\"1\" class=\"ul-black wp-block-list\"><li>Deploy and<strong>&nbsp;serve<\/strong>&nbsp;applications with a higher-level and easier to understand API. These applications automatically scale from zero-to-N, and back to zero, based on requests.<\/li><li><strong>Build<\/strong>&nbsp;and package your application code inside the cluster.<\/li><li>Deliver&nbsp;<strong>events<\/strong>&nbsp;to your application. You can define custom event sources and declare subscriptions between event buses and your applications.<\/li><\/ol>\n\n\n\n<p>Developers on Knative can use familiar idioms, languages, and frameworks to deploy functions, applications, or containers workloads. <br><br>This is why, Knative provides developer experiences similar to&nbsp;<strong>serverless&nbsp;<\/strong>platforms<strong>.<\/strong> You can read the documentation at&nbsp;<a href=\"https:\/\/github.com\/knative\/docs\" target=\"_blank\" rel=\"noreferrer noopener\"><\/a><a href=\"https:\/\/knative.dev\/docs\/\">https:\/\/knative.dev\/docs\/<\/a>.<\/p>\n\n\n\n<h4 class=\"has-vivid-green-cyan-color has-text-color wp-block-heading\">Knative is still Kubernetes!<\/h4>\n\n\n\n<p>If you deployed applications with Kubernetes before, Knative will feel familiar to you. You will still write YAML manifest files and deploy container images on a Kubernetes cluster.<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\" id=\"title\">2- Who is Knative for?<\/h2>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Knative APIs<\/h4>\n\n\n\n<p>Kubernetes offers a feature called Custom Resource Definitions (CRDs). With CRDs, third party Kubernetes controllers like Istio or Knative can install more APIs into Kubernetes.<\/p>\n\n\n\n<p>Knative installs of three families of custom resource APIs:<\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li><strong>Knative Serving:&nbsp;<\/strong>Set of APIs that help you host applications that serve traffic. Provides features like custom routing and autoscaling.<\/li><li><strong>Knative Eventing:&nbsp;<\/strong>Set of APIs that let you declare event sources and event delivery to your applications.&nbsp;<em>(Not covered in this codelab due to time constraints.)<\/em><\/li><\/ul>\n\n\n\n<p>Together, Knative Serving and Eventing APIs provide a common set of middleware for Kubernetes applications. We will use these APIs to run build and run applications.<\/p>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Is Knative for me?<\/h4>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"537\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05-1024x537.png\" alt=\"Deploying Serverless Services on Kubernetes using Knative: Knative audiences \" class=\"wp-image-734\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 1744w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-13.41.05.png 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Knative Audiences (Knative Doc)<\/figcaption><\/figure>\n\n\n\n<p>Knative serves two main audiences:<\/p>\n\n\n\n<p><strong>1. I want to deploy on Kubernetes easier:<\/strong><\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>Knative makes it easy to declare an application that auto-scales, without worrying about container parameters like CPU, memory, or concerns like activation\/deactivation.<\/li><li>You can go from a code in a repo to app running on Knative very easily.<\/li><\/ul>\n\n\n\n<p><strong>2. I want to build my own PaaS\/FaaS on Kubernetes:<\/strong><\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>You can use these Knative components and APIs to build a custom deployment platform that looks like Heroku or AWS Lambda at your company.<\/li><li>Knative Serving has many valuable &#8220;plumbing&#8221; components like the autoscaler, request based activation, telemetry.<\/li><li>Knative Build lets you declare transformations on the source code, like converting functions to apps, and apps to containers.<\/li><li>You don&#8217;t have to reinvent the wheel, can reuse plumbing components offered by Knative.<\/li><\/ul>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Knative principles<\/h4>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>Knative is native to Kubernetes (APIs are hosted on Kubernetes, deployment unit is container images)<\/li><li>You can install\/use parts of Knative independently (e.g. only Knative Build, to do in-cluster builds)<\/li><li>Knative components are pluggable (e.g. don&#8217;t like the autoscaler? write your own)<\/li><\/ul>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">3- Installing Knative<\/h2>\n\n\n\n<p>This guide walks you through the installation of the latest version of Knative. Knative has two components, which can be installed and used independently or together. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/knative.dev\/docs\/install\/any-kubernetes-cluster\/#installing-the-serving-component\"><strong>Serving<\/strong><\/a>&nbsp;<code>stable @ v0.9<\/code>&nbsp;<\/li><li><a href=\"https:\/\/knative.dev\/docs\/install\/any-kubernetes-cluster\/#installing-the-eventing-component\"><strong>Eventing<\/strong><\/a>&nbsp;<code>stable @ v0.16<\/code>&nbsp;<\/li><\/ul>\n\n\n\n<p>Knative also has an&nbsp;<a href=\"https:\/\/knative.dev\/docs\/install\/any-kubernetes-cluster\/#installing-the-observability-plugin\"><strong>Observability plugin<\/strong><\/a>&nbsp;<code>deprecated @ v0.14<\/code>&nbsp;which provides standard tooling that can be used to get visibility into the health of the software running on Knative.<\/p>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Installing the Serving component<\/h4>\n\n\n\n<p class=\"has-text-color has-very-dark-gray-color\">\n<pre class=\"terminal\"><code><br># install the&nbsp; CRDs<br>kubectl apply &#8211;filename \\ https:\/\/github.com\/knative\/serving\/releases\/download\/v0.16.0\/serving-crds.yaml<br># install the core components of Serving<br>kubectl apply &#8211;filename \\ https:\/\/github.com\/knative\/serving\/releases\/download\/v0.16.0\/serving-core.yaml<br><\/code><\/pre>\n<\/p>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Pick a networking layer: <a aria-label=\"undefined (opens in a new tab)\" href=\"https:\/\/istio.io\/\" target=\"_blank\" rel=\"noreferrer noopener\">Istio<\/a><\/h4>\n\n\n\n<p class=\"has-text-color has-vivid-green-cyan-color\"><strong>1- Installing Istioctl<\/strong><\/p>\n\n\n\n<p class=\"has-text-color has-very-dark-gray-color\">\n<pre class=\"terminal\"><code><br>curl -sL https:\/\/istio.io\/downloadIstioctl | sh &#8211;<br>export PATH=$PATH:$HOME\/.istioctl\/bin<br><\/code><\/pre>\n<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-green-cyan-color\"><strong>2-  Choosing an Istio installation<\/strong><\/p>\n\n\n\n<p>When you install Istio, there are a few options depending on your goals. For a basic Istio installation suitable for most Knative use cases, follow the&nbsp;<a href=\"https:\/\/knative.dev\/docs\/install\/installing-istio\/#installing-istio-without-sidecar-injection\">Installing Istio without sidecar injection<\/a>&nbsp;instructions. If you&#8217;re familiar with Istio and know what kind of installation you want, read through the options and choose the installation that suits your needs here: <a href=\"https:\/\/knative.dev\/docs\/install\/installing-istio\/\">https:\/\/knative.dev\/docs\/install\/installing-istio\/<\/a><\/p>\n\n\n\n<p>In the context of this lab, we want to get up and running with Knative quickly, we\u2019ll installing Istio without automatic sidecar injection. This install is also recommended for users who don&#8217;t need the Istio service mesh, or who want to enable the service mesh by&nbsp;<a href=\"https:\/\/istio.io\/docs\/setup\/kubernetes\/additional-setup\/sidecar-injection\/#manual-sidecar-injection\">manually injecting the Istio sidecars<\/a>.<\/p>\n\n\n\n<p class=\"has-text-color has-vivid-green-cyan-color\"><strong>3- Installing Istio <\/strong><\/p>\n\n\n\n<p>Enter the following command to install Istio:<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">cat &lt;&lt; EOF > .\/istio-minimal-operator.yaml\napiVersion: install.istio.io\/v1alpha1\nkind: IstioOperator\nspec:\n  values:\n    global:\n      proxy:\n        autoInject: disabled\n      useMCP: false\n      # The third-party-jwt is not enabled on all k8s.\n      # See: https:\/\/istio.io\/docs\/ops\/best-practices\/security\/#configure-third-party-service-account-tokens\n      jwtPolicy: first-party-jwt\n\n  addonComponents:\n    pilot:\n      enabled: true\n    prometheus:\n      enabled: false\n\n  components:\n    ingressGateways:\n      - name: istio-ingressgateway\n        enabled: true\n      - name: cluster-local-gateway\n        enabled: true\n        label:\n          istio: cluster-local-gateway\n          app: cluster-local-gateway\n        k8s:\n          service:\n            type: ClusterIP\n            ports:\n            - port: 15020\n              name: status-port\n            - port: 80\n              name: http2\n            - port: 443\n              name: https\nEOF\n\nistioctl manifest apply -f istio-minimal-operator.yaml<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png\" alt=\"Deploying Serverless Services on Kubernetes using Knative: istio installation \" class=\"wp-image-757\" width=\"1275\" height=\"245\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 2286w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 2048w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 1280w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-15.42.24.png 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Istio installation<\/figcaption><\/figure>\n\n\n\n<p class=\"has-text-color has-vivid-green-cyan-color\"><strong>4- Install the Knative Istio controller:<\/strong><\/p>\n\n\n\n\n<pre class=\"terminal\"><code><br>kubectl apply &#8211;filename https:\/\/github.com\/knative\/net-istio\/releases\/download\/v0.16.0\/release.yaml<br><\/code><\/pre>\n\n\n\n\n<p>Fetch the External IP or CNAME:<\/p>\n\n\n\n<p>\n<pre class=\"terminal\"><code><br>kubectl &#8211;namespace istio-system get service istio-ingressgateway<br><\/code><\/pre>\n<br><\/p>\n\n\n\n<pre title=\" External IP output example \" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">\nNAME                   TYPE           CLUSTER-IP    EXTERNAL-IP     PORT(S)                                                      AGE\nistio-ingressgateway   LoadBalancer   10.0.76.127   51.105.98.187   15021:30344\/TCP,80:30876\/TCP,443:30002\/TCP,15443:32265\/TCP   15h\n|~\/run-it-on-cloud\/knative  \n<\/code><\/pre>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Configure DNS<\/h4>\n\n\n\n<p>To configure DNS for Knative, take the External IP or CNAME from setting up networking, and configure it with your DNS provider as follows:<\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>If the networking layer produced an External IP address, then configure a wildcard&nbsp;<code>A<\/code>&nbsp;record for the domain:<code># Here knative.runitoncloud.com is the domain suffix for your cluster *.knative.runitoncloud.com == A 51.105.98.187<\/code><\/li><li>If the networking layer produced a CNAME, then configure a CNAME record for the domain:<code># Here knative.example.com is the domain suffix for your cluster *.knative.example.com == CNAME a317a278525d111e89f272a164fd35fb-1510370581.eu-central-1.elb.amazonaws.com<\/code><\/li><\/ul>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-00.16.01-746x1024.png\" alt=\"\" class=\"wp-image-768\" width=\"267\" height=\"366\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-00.16.01.png 746w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-00.16.01.png 219w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-00.16.01.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-00.16.01.png 1094w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><figcaption>Create knative record set on Azure<\/figcaption><\/figure>\n\n\n\n<p>Once your DNS provider has been configured, direct Knative to use that domain:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"># Replace knative.runitoncloud.com with your domain suffix\nkubectl patch configmap\/config-domain \\\n  --namespace knative-serving \\\n  --type merge \\\n  --patch '{\"data\":{\"knative.runitoncloud.com\":\"\"}}'<\/code><\/pre>\n\n\n\n\n\n<p>Monitor the Knative components until all of the components show a&nbsp;<code>STATUS<\/code>&nbsp;of&nbsp;<code>Running<\/code>&nbsp;or&nbsp;<code>Completed<\/code>:<\/p>\n\n\n\n<pre title=\"Monitor the Knative components\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  kubectl get pods --namespace knative-serving                                                                                                         \nNAME                               READY   STATUS    RESTARTS   AGE\nactivator-76984478f7-2trhj         1\/1     Running   0          16h\nautoscaler-598d974c99-p42h7        1\/1     Running   0          16h\ncontroller-9b998cd47-mbn2l         1\/1     Running   0          16h\nistio-webhook-69cd874949-nqh7f     1\/1     Running   0          15h\nnetworking-istio-df55795c6-n6tsb   1\/1     Running   0          15h\nwebhook-658874f97-x8zd4            1\/1     Running   0          16h\n|~\/run-it-on-cloud\/knative \ud83d\udcbb \n<\/code><\/pre>\n\n\n\n<p>Bingo \ud83c\udfb6 Knative is now installed on your cluster!<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">4- Your first Knative application<\/h2>\n\n\n\n<p>To run an application with Knative on a Kubernetes cluster and expose it to the public internet, you need:<\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>an application packaged as container image<\/li><li>a Knative&nbsp;<code>Service<\/code>&nbsp;manifest file<\/li><\/ul>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Service definition<\/h4>\n\n\n\n<p>To expose an application on Knative, you need to define a&nbsp;<code>Service<\/code>&nbsp;object. (This is different than the&nbsp;<a href=\"https:\/\/kubernetes.io\/docs\/concepts\/services-networking\/service\/\" target=\"_blank\" rel=\"noreferrer noopener\">Kubernetes Service<\/a>&nbsp;type which helps you set up load balancing for Pods.)<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\"> cat &lt;&lt; EOF > .\/helloworld.yaml\napiVersion: serving.knative.dev\/v1alpha1\nkind: Service\nmetadata:\n  name: \"helloworld\"\nspec:\n  runLatest:\n    configuration:\n      revisionTemplate:\n        spec:\n          container:\n            image: \"gcr.io\/knative-samples\/helloworld-go\"\n            env:\n              - name: \"TARGET\"\n                value: \"world\"\nEOF\nkubectl apply -f helloworld.yaml<\/code><\/pre>\n\n\n\n<p>This Knative Service example uses the container image&nbsp;<code>gcr.io\/knative-samples\/helloworld-go<\/code>, which is a Go web application listening on port&nbsp;<code>8080<\/code>&nbsp;(currently required port number by Knative).<\/p>\n\n\n\n<p>Verify it&#8217;s deployed by querying &#8220;ksvc&#8221; (Knative Service) objects:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  kubectl get ksvc                                                                                                                                     \nNAME           URL                                                    LATESTCREATED        LATESTREADY          READY   REASON\nhelloworld     http:\/\/helloworld.default.knative.runitoncloud.com     helloworld-2vcx5     helloworld-2vcx5     True    \n<\/code><\/pre>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Make a request<\/h4>\n\n\n\n<p>External requests to Knative applications in a cluster go through a single public load balancer called&nbsp;<code>istio-ingressgateway<\/code>&nbsp;which has a public IP address.<\/p>\n\n\n\n<p>Find the external IP:  <code>kubectl --namespace istio-system get service istio-ingressgateway<\/code><\/p>\n\n\n\n<p> The hostname of the application should be&nbsp;<code>helloworld.default.knative.&lt;your dns zone&gt;. <\/code><\/p>\n\n\n\n<p>Now, use&nbsp;<code>curl<\/code>&nbsp;to make the first request to this function (replace the&nbsp;<code>IP_ADDRESS<\/code>&nbsp;below with the gateway&#8217;s external IP address you found earlier):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|~\/run-it-on-cloud\/knative \ud83d\udcbb\n|--\u2af8  curl -H \"Host: helloworld.default.runitoncloud.com\" http:\/\/51.105.98.187<\/code><\/pre>\n\n\n\n<p>After you made a request to the&nbsp;<code>helloworld<\/code>&nbsp;Service, you will see that a Pod is created on the Kubernetes cluster to serve the request. Query the list of Pods deployed:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  kubectl get pods                                                                                                                                     \nNAME                                           READY   STATUS    RESTARTS   AGE\nhelloworld-2vcx5-deployment-6b865d74f7-vs8pp   2\/2     Running   0          29s<\/code><\/pre>\n\n\n\n<p>Congratulations! \ud83d\udc4f You&#8217;ve just deployed a simple working application to Kubernetes with Knative! The next section explains what happened under the covers\ud83d\ude04<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">5- Introduction to Knative Serving API<\/h2>\n\n\n\n<p>When you deploy the&nbsp;<code>helloworld<\/code>&nbsp;Service to Knative, it creates three kinds of objects:&nbsp;<code>Configuration<\/code>,&nbsp;<code>Route<\/code>, and&nbsp;<code>Revision<\/code>:<\/p>\n\n\n\n<pre title=\"Knative configuration,revision,route\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  kubectl get configuration,revision,route                                                                                                             \nNAME                                           LATESTCREATED      LATESTREADY        READY   REASON\nconfiguration.serving.knative.dev\/helloworld   helloworld-2vcx5   helloworld-2vcx5   True\n\nNAME                                            CONFIG NAME   K8S SERVICE NAME   GENERATION   READY   REASON\nrevision.serving.knative.dev\/helloworld-2vcx5   helloworld    helloworld-2vcx5   1            True\n\nNAME                                   URL                                                  READY   REASON\nroute.serving.knative.dev\/helloworld   http:\/\/helloworld.default.knative.runitoncloud.com   True<\/code><\/pre>\n\n\n\n<p>Here&#8217;s what each of these Serving APIs do:<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-stripes\"><table class=\"has-subtle-pale-green-background-color has-fixed-layout has-background\"><tbody><tr><td><strong><code>Service<\/code><\/strong><\/td><td>Describes an application on Knative.<\/td><\/tr><tr><td><code><strong>Revision<\/strong><\/code><\/td><td>Read-only snapshot of an application&#8217;s image and other settings (created by&nbsp;<code>Configuration<\/code>).<\/td><\/tr><tr><td><strong><code>Configuration<\/code><\/strong><\/td><td>Created by Service (from its&nbsp;<code>spec.configuration<\/code>&nbsp;field). It creates a new&nbsp;<code>Revision<\/code>&nbsp;when the&nbsp;<code>revisionTemplate<\/code>&nbsp;field changes.<\/td><\/tr><tr><td><strong><code>Route<\/code><\/strong><\/td><td>Configures how the traffic coming to the Service should be split between&nbsp;<code>Revision<\/code>s.<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"339\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b-1024x339.png\" alt=\"\" class=\"wp-image-783\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 1600w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/879cbeae5e35bc6b.png 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Knative Service&#8217;s objects workflow: Google CodeLab<\/figcaption><\/figure>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">6- Serving multiple versions simultaneously<\/h2>\n\n\n\n<p>The&nbsp;<code>helloworld<\/code>&nbsp;Service had a&nbsp;<code>spec.runLatest<\/code>&nbsp;field which serves all the traffic to the latest revision created form the service&#8217;s&nbsp;<code>revisionTemplate<\/code>&nbsp;field. To test out the effects of a new version of your application, you will need to run multiple versions of your applications and route a portion of your traffic to the new &#8220;canary&#8221; version you are testing. This practice is called&nbsp;<strong>&#8220;blue-green deployment&#8221;.<\/strong><br>Knative Serving offers the&nbsp;<code>Revision<\/code>&nbsp;API, which tracks the changes to application configuration, and the&nbsp;<code>Route<\/code>&nbsp;API, which lets you split the traffic to multiple revisions.<\/p>\n\n\n\n<p>In this exercise you will:<\/p>\n\n\n\n<ol type=\"1\" class=\"ul-black wp-block-list\"><li>Deploy a &#8220;blue&#8221; Service version in&nbsp;<code>runLatest<\/code>&nbsp;mode.<\/li><li>Update Service with &#8220;green&#8221; configuration and change mode to&nbsp;<code>release<\/code>&nbsp;to split traffic between two revisions.<\/li><\/ol>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Deploying the v1<\/h4>\n\n\n\n<p>To try out the a blue-green deployment, first you will need to deploy a &#8220;blue&#8221; version.<br>Services in&nbsp;<code>runLatest<\/code>&nbsp;mode will send all the traffic to the Revision specified in the Service manifest. In the earlier&nbsp;<code>helloworld<\/code>&nbsp;example, you&#8217;ve used a service in&nbsp;<code>runLatest<\/code>&nbsp;mode.<br>First, deploy the v1 (blue) version of the Service with&nbsp;<code>runLatest<\/code>&nbsp;mode by saving manifest to a file named&nbsp;<code>v1.yaml<\/code>, and apply it to the cluster:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">cat &lt;&lt; EOF > .\/v1.yaml                                                                                                                               \napiVersion: serving.knative.dev\/v1alpha1\nkind: Service\nmetadata:\n  name: canary\nspec:\n  runLatest:\n    configuration:\n      revisionTemplate:\n        spec:\n          container:\n            image: gcr.io\/knative-samples\/knative-route-demo:blue\n            env:\n            - name: T_VERSION\n              value: \"blue\"\nEOF\nkubectl apply -f v1.yaml<\/code><\/pre>\n\n\n\n<p>Query the deployed revision name (should be&nbsp;<code>canary-00001<\/code>):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">kubectl get revisions\n\nNAME               CREATED AT\ncanary-00001       39s<\/code><\/pre>\n\n\n\n<p>Make a request and observe the blue version by replacing the&nbsp;<code>IP_ADDRESS<\/code>&nbsp;below with the gateway&#8217;s IP address (the first request may take some time to complete as it starts the Pod):<\/p>\n\n\n\n\n<pre class=\"terminal\"><code><br>curl -H &#8220;Host: canary.default.knative.example.com&#8221; http:\/\/IP_ADDRESS<br><\/code><\/pre>\n\n\n\n\n<pre title=\"Query the V1 output\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  curl -H \"Host: canary.default.knative.runitoncloud.com\" http:\/\/51.105.98.187                                                                         \n...\n\n            &lt;div class=\"blue\">App v1&lt;\/div>\n...                                                                                                                                         <\/code><\/pre>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Deploying the v2<\/h4>\n\n\n\n<p>The Knative&nbsp;<code>Service<\/code>&nbsp;API has a&nbsp;<code>release<\/code>&nbsp;mode that lets you roll out changes to new revisions with traffic splitting.<\/p>\n\n\n\n<p>Make a copy of&nbsp;<code>v1.yaml<\/code>&nbsp;named&nbsp;<code>v2.yaml<\/code><\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li><code>cp v1.yaml v2.yaml<\/code><\/li><\/ul>\n\n\n\n<p>Make the following changes to&nbsp;<code>v2.yaml<\/code>.<\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>change&nbsp;<code>runLatest<\/code>&nbsp;mode to&nbsp;<code>release<\/code><\/li><li>change&nbsp;<code>blue<\/code>&nbsp;to&nbsp;<code>green<\/code>&nbsp;in &#8220;image&#8221; and &#8220;env&#8221; fields<\/li><li>add a&nbsp;<code>revisions<\/code>&nbsp;field with the [current, current+1] revision names<\/li><li>specify a&nbsp;<code>rolloutPercent<\/code>&nbsp;field, routing 20% of traffic to the candidate (&#8220;green&#8221;) revision<\/li><\/ul>\n\n\n\n<p>The resulting&nbsp;<code>v2.yaml<\/code>&nbsp;should look like the following snippet. Save and apply this to the cluster:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">apiVersion: serving.knative.dev\/v1alpha1\nkind: Service\nmetadata:\n  name: canary\nspec:\n  release:\n    revisions: [\"canary-00001\", \"canary-00002\"] # [current, candidate]\n    rolloutPercent: 20                          # 20% to green revision\n    configuration:\n      revisionTemplate:\n        spec:\n          container:\n            image: gcr.io\/knative-samples\/knative-route-demo:green\n            env:\n            - name: T_VERSION\n              value: \"green\"<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">kubectl apply -f v2.yaml<\/code><\/pre>\n\n\n\n<p>You should now see the new revision created, while the old one is still around:<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">kubectl get revisions\n\nNAME               CREATED AT\ncanary-00001       6m\ncanary-00002       3m<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>If you see different revision numbers than the output above, change the&nbsp;<code>revisions<\/code>&nbsp;field with their names in&nbsp;<code>v2.yaml<\/code>&nbsp;and re-apply the manifest file.<\/p><\/blockquote>\n\n\n\n<p>Now, make a few requests and observe the response is served from the new &#8220;green&#8221; version roughly 20% of the time (replace&nbsp;<strong><code>IP_ADDRESS<\/code><\/strong>&nbsp;below):<\/p>\n\n\n\n<pre title=\"Bleu Green Serving\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">|--\u2af8  while true; do                                                                                                                                       \n  curl -s -H \"Host: canary.default.knative.runitoncloud.com\" http:\/\/51.105.98.187 | grep -E 'blue|green';\ndone\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"green\">App v2&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"green\">App v2&lt;\/div>\n            &lt;div class=\"green\">App v2&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"green\">App v2&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div>\n            &lt;div class=\"blue\">App v1&lt;\/div><\/code><\/pre>\n\n\n\n<p>The&nbsp;<code>rolloutPercent<\/code>&nbsp;determines what portion of the traffic the candidate revision gets. If you set this field to&nbsp;<code>0<\/code>, the candidate revision will not get any traffic. If you want to play with the percentages, you can edit the&nbsp;<code>v2.yaml<\/code>&nbsp;and re-apply it to the cluster.<\/p>\n\n\n\n<p>With the&nbsp;<code>Service<\/code>&nbsp;configured in&nbsp;<code>release<\/code>&nbsp;mode, you can also connect to specific revisions through their dedicated addresses:<\/p>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li><code>current.canary.default.knative.example.com<\/code><\/li><li><code>candidate.canary.default.knative<\/code>.<code>example.com<\/code><\/li><li><code>latest.canary.default.knative<\/code>.<code>example.com<\/code>&nbsp;(most recently deployed Revision, even if it&#8217;s not specified on the&nbsp;<code>revisions<\/code>&nbsp;field.)<\/li><\/ul>\n\n\n\n<p>After the&nbsp;<code>Service<\/code>&nbsp;is configured with the&nbsp;<code>release<\/code>&nbsp;mode, you should see the&nbsp;<code>Route<\/code>&nbsp;object configured with the traffic splitting (20% to &#8220;candidate&#8221;, 80% to &#8220;current&#8221;):<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"apacheconf\" class=\"language-apacheconf\">kubectl describe route canary        \n...\nTraffic:\n    Latest Revision:  false\n    Percent:          80\n    Revision Name:    canary-xnvvq\n    Tag:              current\n    URL:              http:\/\/current-canary.default.knative.runitoncloud.com\n    Latest Revision:  false\n    Percent:          20\n    Revision Name:    canary-dwf4g\n    Tag:              candidate\n    URL:              http:\/\/candidate-canary.default.knative.runitoncloud.com\n    Latest Revision:  true\n    Revision Name:    canary-dwf4g\n    Tag:              latest\n    URL:              http:\/\/latest-canary.default.knative.runitoncloud.com\n...<\/code><\/pre>\n\n\n\n<p>As you roll out changes to the&nbsp;<code>Service<\/code>, you need to repeat finding the&nbsp;<code>Revision<\/code>&nbsp;name and specify it in the&nbsp;<code>revisions<\/code>&nbsp;field as the candidate.<br>Great j\ud83d\ude0eb! \ud83e\udd73  You just used the Knative Serving API to create a blue-green deployment.<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">6- Autoscaling applications with Knative<\/h2>\n\n\n\n<p>In this example, we will deploy an application, send some artificial request load to it, observe Knative scales up the number of Pods serving the traffic and look at the monitoring dashboard about why the autoscaling has happened.<\/p>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Deploy the application<\/h4>\n\n\n\n<p>The following manifest describes an application on Knative, where we can configure how long each request takes. Save it to&nbsp;<code>autoscale-go.yaml<\/code>, and apply to the cluster:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"yaml\" class=\"language-yaml\">cat &lt;&lt; EOF > .\/autoscale-go.yaml                                                                                                                     \napiVersion: serving.knative.dev\/v1alpha1\nkind: Service\nmetadata:\n  name: autoscale-go\nspec:\n  runLatest:\n    configuration:\n      revisionTemplate:\n        spec:\n          container:\n            image: \"gcr.io\/knative-samples\/autoscale-go:0.1\"\nEOF\nkubectl apply -f autoscale-go.yaml<\/code><\/pre>\n\n\n\n<p>Now, find the public IP address of Istio gateway and save it to IP_ADDRESS variable on your shell:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"> IP_ADDRESS=\"$(kubectl get service --namespace=istio-system istio-ingressgateway --output jsonpath=\"{.status.loadBalancer.ingress[*].ip}\")\"<\/code><\/pre>\n\n\n\n<p>Make a request to this application to verify you can connect (note that the response indicates the request took 1 second):<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">curl --header \"Host: autoscale-go.default.knative.example.com\" \\\n  \"http:\/\/${IP_ADDRESS?}?sleep=1000\"<\/code><\/pre>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Launch monitoring dashboard<\/h4>\n\n\n\n<p>Knative comes with set of observability features to enable logging, metrics, and request tracing in your Serving and Eventing components.<br>In this context we will  use  Prometheus and Grafana to collect metrics about requests, applications and autoscaling, and exports these metrics to Grafana dashboards for viewing.<\/p>\n\n\n\n<pre title=\"Install Knative's Prometheus and Grafana\" class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\">kubectl apply --filename https:\/\/github.com\/knative\/serving\/releases\/download\/v0.16.0\/monitoring-core.yaml\nkubectl apply --filename https:\/\/github.com\/knative\/serving\/releases\/download\/v0.16.0\/monitoring-metrics-prometheus.yaml<\/code><\/pre>\n\n\n\n<p>To connect to the Grafana dashboard on your cluster, open a new separate terminal and&nbsp;<strong>keep the following command running<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"bash\" class=\"language-bash\"> kubectl port-forward --namespace knative-monitoring $(kubectl get pods --namespace knative-monitoring  --selector=app=grafana --output=jsonpath=\"{.items..metadata.name}\")  8080:3000 <\/code><\/pre>\n\n\n\n<p>This command exposes the Grafana server on localhost:8080 on&nbsp;your browser.<\/p>\n\n\n\n<p>To view the autoscaling dashboard, follow the steps:<\/p>\n\n\n\n<ol type=\"1\" class=\"ul-black wp-block-list\"><li>Click &#8220;Home&#8221; on top right to view dashboards.<\/li><li>Choose &#8220;Knative Serving &#8211; Scaling Debugging&#8221; dashboard.<\/li><li>Click the time settings on the top right, choose &#8220;last 5 minutes&#8221;, then choose &#8220;refresh every 10 seconds&#8221;, then click Apply.<\/li><li>In the main panel, choose &#8220;Configuration&#8221; as &#8220;autoscale-go&#8221;.<\/li><li>Expand the autoscaler metrics.<\/li><li>You should be seeing graphs for &#8220;Pod Counts&#8221; and &#8220;Observed Concurrency&#8221;.<\/li><\/ol>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04-1024x592.png\" alt=\"Deploying Serverless Services on Kubernetes using Knative: Grafana\" class=\"wp-image-791\" width=\"750\" height=\"433\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 2048w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 1280w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.18.04.png 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Knative Grafana Dashboard<\/figcaption><\/figure>\n\n\n\n<p>Keep this dashboard window and&nbsp;<code>kubectl port-forward<\/code>&nbsp;command running, now you will send some request load to the application.<\/p>\n\n\n\n<h4 class=\"has-vivid-purple-color has-text-color wp-block-heading\">Triggering autoscaling<\/h4>\n\n\n\n<p>In this step, we will send some artificial load through a load generator. Download the load generator named&nbsp;<code>hey<\/code>&nbsp;using&nbsp;<code>go<\/code>&nbsp;tool.<\/p>\n\n\n\n\n<pre class=\"terminal\"><code><br>go get github.com\/rakyll\/hey<br><\/code><\/pre>\n\n\n\n\n<p>Use&nbsp;<code>hey<\/code>&nbsp;to send 150,000 requests (with 500 requests in parallel), each taking 1 second (leave this command running, as it will take a while to complete).<\/p>\n\n\n\n\n<pre class=\"terminal\"><code><br>hey -host autoscale-go.default.example.com -c 500 -n 150000 \\<br>&#8220;http:\/\/${IP_ADDRESS?}?sleep=1000&#8221;<br><\/code><\/pre>\n\n\n\n\n<p>Meanwhile, open a new terminal window and keep an eye on the number of pods.<\/p>\n\n\n\n\n<pre class=\"terminal\"><code><br>watch kubectl get pods<br><\/code><\/pre>\n\n\n\n\n<p>Knative Serving, by default, has a concurrent requests target of 100. Sending 500 concurrent requests causes autoscaling to note that it needs to run 5 Pods to satisfy this level.<br>Go back to the Grafana dashboard and observe that the number of Pods has increased from 1 to 4:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37-1024x449.png\" alt=\"\" class=\"wp-image-793\" width=\"762\" height=\"334\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 1536w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 2048w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 1280w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/Screenshot-2020-07-21-at-01.21.37.png 1920w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Number of Pods has increased from 1 to 4<\/figcaption><\/figure>\n\n\n\n<p>Similarly, on Grafana dashboard, you can see that the observed concurrency level briefly peaks, and as Knative created more Pods, it comes back down to below 100 (the default concurrency target):<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"503\" src=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence-1024x503.png\" alt=\"\" class=\"wp-image-794\" srcset=\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence.png 1024w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence.png 300w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence.png 768w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence.png 1422w, https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/concurence.png 1280w\" sizes=\"auto, (max-width: 640px) 100vw, 640px\" \/><figcaption>Concurrency  peak<\/figcaption><\/figure>\n\n\n\n<p>Now, you can close the Grafana window, and stop the&nbsp;<code>hey<\/code>&nbsp;and&nbsp;<code>kubectl proxy<\/code>&nbsp;commands after observing the autoscaling. <\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\">What\u2019s Next!<\/h2>\n\n\n\n<p>Knative is a fairly new project, released in July 2018. Most parts of the project such as the API and the documentation are changing very frequently. To stay up to date, join one of the community forums below and visit the documentation for the most recent instructions.<\/p>\n\n\n\n<p>We have not covered the&nbsp;<a href=\"https:\/\/github.com\/knative\/eventing\" target=\"_blank\" rel=\"noreferrer noopener\"><strong>Knative Eventing<\/strong><\/a>&nbsp;APIs during this codelab. If you are interested in getting events from external sources and having them delivered to your applications, read about it and play with it if you have time.<\/p>\n\n\n\n<h2 class=\"has-vivid-cyan-blue-color has-text-color wp-block-heading\" id=\"that-s-all-folks-\">That\u2019s all folks!<\/h2>\n\n\n\n<p>That\u2019s all for this lab, thanks for reading&nbsp;\ud83d\ude4f<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Take action!<\/h4>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li>Tweet\/Comment about your experience at this lab.<\/li><li>Read the&nbsp;<a href=\"https:\/\/github.com\/knative\/docs\" target=\"_blank\" rel=\"noreferrer noopener\">Knative documentation<\/a><\/li><li>Join the&nbsp;<a href=\"https:\/\/slack.knative.dev\/\" target=\"_blank\" rel=\"noreferrer noopener\">slack.knative.dev<\/a>&nbsp;Slack channel<\/li><li>Follow&nbsp;<a href=\"https:\/\/twitter.com\/knativeproject\" target=\"_blank\" rel=\"noreferrer noopener\">@KnativeProject<\/a>&nbsp;on twitter<\/li><li>Participate in the&nbsp;<a href=\"https:\/\/github.com\/knative\/docs\/tree\/master\/community\" target=\"_blank\" rel=\"noreferrer noopener\">Knative community<\/a>&nbsp;process and&nbsp;<a href=\"https:\/\/github.com\/knative\/docs\/blob\/master\/community\/WORKING-GROUPS.md\" target=\"_blank\" rel=\"noreferrer noopener\">working groups<\/a><\/li><\/ul>\n\n\n\n<h4 class=\"has-very-dark-gray-color has-text-color wp-block-heading\">References<\/h4>\n\n\n\n<ul class=\"ul-black wp-block-list\"><li><a href=\"https:\/\/knative.dev\/docs\/install\/any-kubernetes-cluster\/\">https:\/\/knative.dev\/docs\/install\/any-kubernetes-cluster\/<\/a><\/li><li><a href=\"https:\/\/istio.io\/latest\/docs\/setup\/install\/istioctl\/\">https:\/\/istio.io\/latest\/docs\/setup\/install\/istioctl\/<\/a><\/li><li><a href=\"https:\/\/codelabs.developers.google.com\/codelabs\/knative-intro\">https:\/\/codelabs.developers.google.com\/codelabs\/knative-intro<\/a><\/li><li>Photo credit:<a href=\"The Newbie in the Kubernetes World\" target=\"_blank\" aria-label=\"undefined (opens in a new tab)\" rel=\"noreferrer noopener\"> Knative: The Newbie in the Kubernetes World<\/a><br><\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Deploying your serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions<\/p>\n","protected":false},"author":1,"featured_media":722,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[14,17,28,2,29],"class_list":["post-721","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-non-classe","tag-aks","tag-cloud","tag-knative","tag-kubernetes","tag-serverless"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Deploying Serverless Services on Kubernetes using Knative<\/title>\n<meta name=\"description\" content=\"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Deploying Serverless Services on Kubernetes using Knative\" \/>\n<meta property=\"og:description\" content=\"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions\" \/>\n<meta property=\"og:url\" content=\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\" \/>\n<meta property=\"og:site_name\" content=\"Run It On Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-22T14:51:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2020-07-23T15:25:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/knative-image.png?fit=1146%2C661&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"1146\" \/>\n\t<meta property=\"og:image:height\" content=\"661\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"aymen-segni\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/x.com\/axsegni\" \/>\n<meta name=\"twitter:site\" content=\"@axsegni\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"aymen-segni\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"18 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\"},\"author\":{\"name\":\"aymen-segni\",\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d\"},\"headline\":\"Deploying Serverless Services on Kubernetes using Knative\",\"datePublished\":\"2020-07-22T14:51:42+00:00\",\"dateModified\":\"2020-07-23T15:25:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\"},\"wordCount\":2780,\"commentCount\":4,\"publisher\":{\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d\"},\"keywords\":[\"aks\",\"cloud\",\"Knative\",\"kubernetes\",\"Serverless\"],\"articleSection\":[\"Non class\u00e9\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\",\"url\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\",\"name\":\"Deploying Serverless Services on Kubernetes using Knative\",\"isPartOf\":{\"@id\":\"https:\/\/aymen-segni.com\/#website\"},\"datePublished\":\"2020-07-22T14:51:42+00:00\",\"dateModified\":\"2020-07-23T15:25:30+00:00\",\"description\":\"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions\",\"breadcrumb\":{\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/aymen-segni.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Deploying Serverless Services on Kubernetes using Knative\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/aymen-segni.com\/#website\",\"url\":\"https:\/\/aymen-segni.com\/\",\"name\":\"Run It On Cloud\",\"description\":\"Accelerate your Cloud &amp; MLOps Journey\",\"publisher\":{\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/aymen-segni.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d\",\"name\":\"aymen-segni\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2025\/02\/72799.jpg\",\"contentUrl\":\"https:\/\/aymen-segni.com\/wp-content\/uploads\/2025\/02\/72799.jpg\",\"width\":896,\"height\":1152,\"caption\":\"aymen-segni\"},\"logo\":{\"@id\":\"https:\/\/aymen-segni.com\/#\/schema\/person\/image\/\"},\"description\":\"Staff Engineer with over a decade of experience in building, scaling, and leading MLOPS, Cloud Native, SRE, and DevOps platforms across high-growth and enterprise environments. I specialize in architecting production-grade systems with a strong emphasis on resilience, security, and developer experience; bringing together deep expertise in distributed systems, Kubernetes, and modern platform engineering to empower engineering teams and accelerate business value. My work spans Cloud (AWS, GCP, Azure, OpenStack), Kubernetes, SRE (SLOs, observability, incident response), AI infrastructure and AgentOps (vLLM, Nvidia, RayServe, etc), and Platform Engineering (Backstage, Keptn, GitOps, self-service). I\u2019ve led teams through Cloud Native transformations, established scalable SRE practices, and built internal platforms that streamline operations and reduce cognitive load. With a strong programming background, and Infrastructure as Code (Terraform, Helm, Ansible), I drive automation-first approaches to eliminate toil, ensure reliability, and enable secure, compliant deployment pipelines. My focus today is on building Cloud Native AI platforms, where DevOps meets AI Infrastructure Stacks to support scalable, production-ready LLMs and AI Platforms. As a dedicated mentor, both within my teams and through platforms like MentorCruise, I am passionate about helping engineers perform at their best and assisting organizations in scaling with confidence. Driven by systems thinking, platform-as-a-product mindset, and engineering excellence, I help teams ship faster, operate smarter, and scale with confidence.\",\"sameAs\":[\"https:\/\/aymen-segni.com\",\"https:\/\/www.linkedin.com\/in\/aymen-segni\",\"https:\/\/twitter.com\/https:\/\/x.com\/axsegni\"],\"url\":\"https:\/\/aymen-segni.com\/index.php\/author\/admin8647\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Deploying Serverless Services on Kubernetes using Knative","description":"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/","og_locale":"en_US","og_type":"article","og_title":"Deploying Serverless Services on Kubernetes using Knative","og_description":"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions","og_url":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/","og_site_name":"Run It On Cloud","article_published_time":"2020-07-22T14:51:42+00:00","article_modified_time":"2020-07-23T15:25:30+00:00","og_image":[{"width":1146,"height":661,"url":"https:\/\/i0.wp.com\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/knative-image.png?fit=1146%2C661&ssl=1","type":"image\/png"}],"author":"aymen-segni","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/x.com\/axsegni","twitter_site":"@axsegni","twitter_misc":{"Written by":"aymen-segni","Est. reading time":"18 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#article","isPartOf":{"@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/"},"author":{"name":"aymen-segni","@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d"},"headline":"Deploying Serverless Services on Kubernetes using Knative","datePublished":"2020-07-22T14:51:42+00:00","dateModified":"2020-07-23T15:25:30+00:00","mainEntityOfPage":{"@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/"},"wordCount":2780,"commentCount":4,"publisher":{"@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d"},"keywords":["aks","cloud","Knative","kubernetes","Serverless"],"articleSection":["Non class\u00e9"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/","url":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/","name":"Deploying Serverless Services on Kubernetes using Knative","isPartOf":{"@id":"https:\/\/aymen-segni.com\/#website"},"datePublished":"2020-07-22T14:51:42+00:00","dateModified":"2020-07-23T15:25:30+00:00","description":"Deploying serverless services on Kubernetes using Knative \u2705 Build and monitor your own PaaS \u2705 Autoscale your app with Knative \u2705Serving multiple App versions","breadcrumb":{"@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/aymen-segni.com\/index.php\/2020\/07\/22\/deploying-your-serverless-services-on-kubernetes-using-knative\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/aymen-segni.com\/"},{"@type":"ListItem","position":2,"name":"Deploying Serverless Services on Kubernetes using Knative"}]},{"@type":"WebSite","@id":"https:\/\/aymen-segni.com\/#website","url":"https:\/\/aymen-segni.com\/","name":"Run It On Cloud","description":"Accelerate your Cloud &amp; MLOps Journey","publisher":{"@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/aymen-segni.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/32033966e7bd410bbaf1b79c7e94b59d","name":"aymen-segni","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/image\/","url":"https:\/\/aymen-segni.com\/wp-content\/uploads\/2025\/02\/72799.jpg","contentUrl":"https:\/\/aymen-segni.com\/wp-content\/uploads\/2025\/02\/72799.jpg","width":896,"height":1152,"caption":"aymen-segni"},"logo":{"@id":"https:\/\/aymen-segni.com\/#\/schema\/person\/image\/"},"description":"Staff Engineer with over a decade of experience in building, scaling, and leading MLOPS, Cloud Native, SRE, and DevOps platforms across high-growth and enterprise environments. I specialize in architecting production-grade systems with a strong emphasis on resilience, security, and developer experience; bringing together deep expertise in distributed systems, Kubernetes, and modern platform engineering to empower engineering teams and accelerate business value. My work spans Cloud (AWS, GCP, Azure, OpenStack), Kubernetes, SRE (SLOs, observability, incident response), AI infrastructure and AgentOps (vLLM, Nvidia, RayServe, etc), and Platform Engineering (Backstage, Keptn, GitOps, self-service). I\u2019ve led teams through Cloud Native transformations, established scalable SRE practices, and built internal platforms that streamline operations and reduce cognitive load. With a strong programming background, and Infrastructure as Code (Terraform, Helm, Ansible), I drive automation-first approaches to eliminate toil, ensure reliability, and enable secure, compliant deployment pipelines. My focus today is on building Cloud Native AI platforms, where DevOps meets AI Infrastructure Stacks to support scalable, production-ready LLMs and AI Platforms. As a dedicated mentor, both within my teams and through platforms like MentorCruise, I am passionate about helping engineers perform at their best and assisting organizations in scaling with confidence. Driven by systems thinking, platform-as-a-product mindset, and engineering excellence, I help teams ship faster, operate smarter, and scale with confidence.","sameAs":["https:\/\/aymen-segni.com","https:\/\/www.linkedin.com\/in\/aymen-segni","https:\/\/twitter.com\/https:\/\/x.com\/axsegni"],"url":"https:\/\/aymen-segni.com\/index.php\/author\/admin8647\/"}]}},"jetpack_featured_media_url":"https:\/\/aymen-segni.com\/wp-content\/uploads\/2020\/07\/knative-image.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/posts\/721","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/comments?post=721"}],"version-history":[{"count":71,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/posts\/721\/revisions"}],"predecessor-version":[{"id":811,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/posts\/721\/revisions\/811"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/media\/722"}],"wp:attachment":[{"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/media?parent=721"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/categories?post=721"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/aymen-segni.com\/index.php\/wp-json\/wp\/v2\/tags?post=721"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}