{"id":41495,"date":"2023-12-01T05:27:26","date_gmt":"2023-12-01T05:27:26","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=41495"},"modified":"2025-01-13T12:15:19","modified_gmt":"2025-01-13T12:15:19","slug":"knative-tutorials-chapter-10-knative-tutorials-servicing-workflow-between-components","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/knative-tutorials-chapter-10-knative-tutorials-servicing-workflow-between-components\/","title":{"rendered":"Knative Tutorials &#8211; Chapter &#8211; 10 &#8211; Knative Tutorials: servicing workflow between Components"},"content":{"rendered":"\n<ol class=\"wp-block-list\">\n<li><strong>Request Initiation<\/strong>:\n<ul class=\"wp-block-list\">\n<li>A user sends a request to an application hosted on Knative.<\/li>\n\n\n\n<li>This request first hits the&nbsp;<code>Istio Ingress Gateway<\/code>, which is the entry point for external traffic into the Kubernetes cluster.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>VirtualService Routing<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<code>Istio Ingress Gateway<\/code>&nbsp;uses Istio&nbsp;<code>VirtualService<\/code>&nbsp;to determine where to route the request. Knative sets up these VirtualServices when a service is created or updated.<\/li>\n\n\n\n<li>Typically, the&nbsp;<code>VirtualService<\/code>&nbsp;will point to the&nbsp;<code>Knative Activator<\/code>&nbsp;when the application is scaled to zero or during scaling up from zero.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Activator<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<code>Activator<\/code>&nbsp;is responsible for starting up instances of the application (Pods) when there are none running. It plays a crucial role in scale-to-zero functionality.<\/li>\n\n\n\n<li>If an application is scaled to zero (no active pods), the&nbsp;<code>Activator<\/code>&nbsp;receives the incoming request, triggers the Kubernetes deployment to start a new pod, and then buffers incoming requests until the pod is ready to handle them.<\/li>\n\n\n\n<li>Once the pod is running and ready, the&nbsp;<code>Activator<\/code>&nbsp;forwards the buffered requests to the pod.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Autoscaler<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<code>Autoscaler<\/code>&nbsp;component in Knative observes traffic load and scales the application pods up or down based on the configuration (like concurrency-based metrics) and actual traffic.<\/li>\n\n\n\n<li>It receives metrics about ongoing traffic and makes decisions on when to scale. The&nbsp;<code>Activator<\/code>&nbsp;also plays a part in this by sending metrics to the&nbsp;<code>Autoscaler<\/code>&nbsp;when it&#8217;s buffering requests for scaled-to-zero applications.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Knative Service and Revisions<\/strong>:\n<ul class=\"wp-block-list\">\n<li>In Knative, when you create a&nbsp;<code>Service<\/code>&nbsp;(not to be confused with Kubernetes Service), it represents a specific configuration of your application.<\/li>\n\n\n\n<li>Each time you modify the&nbsp;<code>Service<\/code>, Knative creates a new&nbsp;<code>Revision<\/code>. Each&nbsp;<code>Revision<\/code>&nbsp;is a snapshot of the code and configurations for a particular version of the service.<\/li>\n\n\n\n<li>The actual running code is encapsulated in a Kubernetes deployment associated with that&nbsp;<code>Revision<\/code>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Knative Route<\/strong>:\n<ul class=\"wp-block-list\">\n<li>The&nbsp;<code>Route<\/code>&nbsp;is responsible for determining which&nbsp;<code>Revision<\/code>&nbsp;of a&nbsp;<code>Service<\/code>&nbsp;receives traffic. You can set up the&nbsp;<code>Route<\/code>&nbsp;to split traffic between multiple&nbsp;<code>Revisions<\/code>&nbsp;for blue-green deployments, canary releases, etc.<\/li>\n\n\n\n<li>Combined with&nbsp;<code>VirtualService<\/code>, it ensures the right revisions of your application are being routed traffic.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Request Completion<\/strong>:\n<ul class=\"wp-block-list\">\n<li>After the application processes the request, the response travels back through the same path: from the pod to (possibly) the&nbsp;<code>Activator<\/code>, and then out through the&nbsp;<code>Istio Ingress Gateway<\/code>&nbsp;to the user.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[8921],"tags":[],"class_list":["post-41495","post","type-post","status-publish","format-standard","hentry","category-knative"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41495","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=41495"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41495\/revisions"}],"predecessor-version":[{"id":41496,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/41495\/revisions\/41496"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=41495"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=41495"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=41495"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}