{"id":2677,"date":"2019-04-25T08:43:03","date_gmt":"2019-04-25T12:43:03","guid":{"rendered":"http:\/\/www.soul-repairs.com\/blog\/?p=2677"},"modified":"2019-04-21T19:36:07","modified_gmt":"2019-04-21T23:36:07","slug":"knative-what-is-it-and-why-do-i-care","status":"publish","type":"post","link":"https:\/\/soul-repairs.com\/blog\/2019\/04\/25\/knative-what-is-it-and-why-do-i-care\/","title":{"rendered":"Knative: What is it, and why do I care?"},"content":{"rendered":"<h2>Officially&#8230;<\/h2>\n<blockquote><p>Knative is a Kubernetes-based platform to build, deploy, and manage modern serverless workloads.<br \/>\n&#8211; Source: <a href=\"https:\/\/cloud.google.com\/knative\/\">Google<\/a>, who &#8220;owns&#8221; the project<\/p><\/blockquote>\n<p>&#8230;a reasonable follow-up question is <em>okay, but what does &#8220;serverless&#8221; mean?<\/em><\/p>\n<p><!--more--><\/p>\n<blockquote><p>Serverless architectures are application designs that incorporate third-party \u201cBackend as a Service\u201d (BaaS) services, and\/or that include custom code run in managed, ephemeral containers on a \u201cFunctions as a Service\u201d (FaaS) platform.<br \/>\n&#8211; Source: <a href=\"https:\/\/martinfowler.com\/articles\/serverless.html\">MartinFowler.com&#8217;s serverless section<\/a><\/p><\/blockquote>\n<p>Most of the time, and especially for Knative, &#8220;serverless&#8221; refers to that second part of the definition &#8211; code that runs in containers that are brought to life just to execute that code, and are then killed when the code finishes execution.<\/p>\n<p>Knative is native to <a href=\"https:\/\/soul-repairs.com\/blog\/2019\/03\/19\/kubernetes-what-is-it-and-why-do-i-care\/\" target=\"_blank\" rel=\"noopener noreferrer\">Kubernetes<\/a> (&#8230;get it? <strong>Native<\/strong> to <strong>K<\/strong>ubernetes? <em>lolz<\/em>), which means that it exists pretty much to take care of Kubernetes things that you most likely won&#8217;t want to deal with on your own.<\/p>\n<h3>A note on pronunciation&#8230;<\/h3>\n<p>We joked when we were first looking into Knative that we were definitely going to call it <em>kah-native<\/em> &#8211; assuming it was actually pronounced like &#8220;native,&#8221; because silent K&#8217;s. We were going to run with kah-native instead because&#8230;well, probably because we&#8217;ve seen <a href=\"https:\/\/www.youtube.com\/watch?v=-OzIMHowtL8\">Monty Python and the Holy Grail <\/a>one too many times. It turns out we were both right <em>and\u00a0<\/em>wrong &#8211; it&#8217;s pronounced <strong>&#8220;<em>kay<\/em>-native.&#8221;<\/strong><\/p>\n<h2>So&#8230;what does it do?<\/h2>\n<p>There are three main ways that Knative shines with serverless architectures, and also with Kubernetes-run applications as a whole. The three ways are all in the definition we already mentioned &#8211; <em>build<\/em>, <em>deploy<\/em>, and <em>manage<\/em>. It does this via <a href=\"https:\/\/kubernetes.io\/docs\/concepts\/extend-kubernetes\/api-extension\/custom-resources\/#customresourcedefinitions\">custom resource definitions<\/a>, and some associated API&#8217;s (Build, Serving, and Eventing).<\/p>\n<p>The purpose of the API&#8217;s, and of Knative as a whole, is to handle some of the fuzzier areas that fall under the semi-gray umbrella of &#8220;<a href=\"https:\/\/www.redhat.com\/en\/topics\/middleware\/what-is-middleware\">middleware<\/a>&#8221; for applications intended to run on a Kubernetes (or Kubernetes-based, like OpenShift) cluster. Middleware here refers to the generic definition, &#8220;software that runs under the application layer,&#8221; <em>not<\/em> <a href=\"https:\/\/en.wikipedia.org\/wiki\/Runtime_system\">application runtimes<\/a>. <em>Overloaded IT terms are fun, you guys<\/em>.<\/p>\n<p>The Knative API&#8217;s can also be used independently, so if only the Build portion interests you, that&#8217;s all you have to install.<\/p>\n<h3>Build<\/h3>\n<p>Purpose: build and package application code from <em>within<\/em> the Kubernetes cluster.<\/p>\n<p>Associate API bundle: <strong>Build<\/strong> (&#8230;<em>seems legit<\/em>, <a href=\"https:\/\/www.knative.dev\/docs\/build\/\">Documentation<\/a>, <a href=\"https:\/\/github.com\/knative\/build\">GitHub source<\/a>), allows you to&#8230;well, build. It also has functionality for the common things people will probably want to do related to a build &#8211; like building the source code into a container, or pushing the resulting image to a registry.<\/p>\n<h3>Deploy<\/h3>\n<p>Purpose: Deploy and serve applications. Also handles spinning the applications up to run as needed and then spinning them back down, which is one of the fundamental pieces of serverless architecture.<\/p>\n<p>Associated API bundle: <strong>Serving <\/strong>(<a href=\"https:\/\/github.com\/knative\/docs\/tree\/master\/docs\/serving\">Documentation<\/a>, <a href=\"https:\/\/github.com\/knative\/serving\">GitHub source<\/a>) &#8211; among other things, handles custom routing and autoscaling. (note: this uses <a href=\"https:\/\/istio.io\/\">Istio<\/a>!)<\/p>\n<h3>Manage<\/h3>\n<p>Purpose: Event-handling, manages defining event sources and subscriptions.<\/p>\n<p>Associated API Bundle: <strong>Eventing<\/strong> (<a href=\"https:\/\/www.knative.dev\/docs\/eventing\/\">Documentation<\/a>, <a href=\"https:\/\/github.com\/knative\/eventing\">GitHub source<\/a>), handles event sources and event delivery, also\u00a0<strong>Serving<\/strong> applies here too.<\/p>\n<h2>Who should care a <em>lot<\/em>\u00a0about Knative?<\/h2>\n<p>Per Google, there are two main groups of people who are likely to find Knative helpful (most of these words are a summary of what we learned doing the CodeLab on Google, the link is at the bottom of this post).<\/p>\n<h3>1. I want to deploy to a Kubernetes cluster easier.<\/h3>\n<p>Because of the Build API, which&#8230;well, <em>builds<\/em>, Knative can make it easier to handle\u00a0<em>that<\/em> part, starting from a code repository. Routing and autoscaling, part of the Serving API, are also <em>probably <\/em>things applications on a Kubernetes cluster will want &#8211; routing lets the outside world in, and autoscaling (especially spin up and spin down for serverless) is one of the very coolest parts of running on Kubernetes. It also some slick capabilities to make <a href=\"https:\/\/martinfowler.com\/bliki\/BlueGreenDeployment.html\">blue\/green deployments<\/a> easier.<\/p>\n<h3>2. I want to build my own PaaS\/FaaS on Kubernetes.<\/h3>\n<p>If you really wanted to write your own internal Paas\/FaaS (like <a href=\"https:\/\/www.heroku.com\/\">Heroku<\/a> or <a href=\"https:\/\/aws.amazon.com\/lambda\/\">AWS Lambda<\/a>) on a Kubernetes cluster, some of the Knative components would help you do that.<\/p>\n<h2>Why\u00a0we\u00a0like it<\/h2>\n<p>Knative provides middleware functionality in modular pieces to help support serverless applications on Kubernetes-based clusters. Several of these modular pieces also can help with getting\u00a0<em>non<\/em>-serverless applications on a Kubernetes cluster.<\/p>\n<p>The ecosystem around Kubernetes is growing at a giddy pace, and as one of us is an <strong>avid<\/strong> automation nerd (spoiler alert: <em>it&#8217;s Laine<\/em>), Knative is one of the most interesting pieces to pop up recently.<\/p>\n<h2>MORE Resources! <em>Learn all the things!<\/em><\/h2>\n<ul>\n<li><a href=\"https:\/\/codelabs.developers.google.com\/codelabs\/knative-intro\/index.html?index=..%2F..index#0\">Google CodeLab &#8211; Using Knative to deploy serverless appliations to Kubernetes<\/a> (this is really good, it&#8217;s how we best understood what Knative is good at. It&#8217;s free!)<\/li>\n<li><a href=\"https:\/\/github.com\/knative\/\">Knative on GitHub, main page<\/a><\/li>\n<li><a href=\"https:\/\/slack.knative.dev\/\">Knative Slack<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Officially&#8230; Knative is a Kubernetes-based platform to build, deploy, and manage modern serverless workloads. &#8211; Source: Google, who &#8220;owns&#8221; the project &#8230;a reasonable follow-up question is okay, but what does &#8220;serverless&#8221; mean?<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[4],"tags":[91,92,87,44,117,83],"wf_post_folders":[],"coauthors":[26,11],"class_list":["post-2677","post","type-post","status-publish","format-standard","hentry","category-technology","tag-istio","tag-knative","tag-kubernetes","tag-openshift","tag-serverless-architecture","tag-technology-tldr"],"_links":{"self":[{"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/posts\/2677","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/comments?post=2677"}],"version-history":[{"count":11,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/posts\/2677\/revisions"}],"predecessor-version":[{"id":2723,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/posts\/2677\/revisions\/2723"}],"wp:attachment":[{"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/media?parent=2677"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/categories?post=2677"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/tags?post=2677"},{"taxonomy":"wf_post_folders","embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/wf_post_folders?post=2677"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/soul-repairs.com\/blog\/wp-json\/wp\/v2\/coauthors?post=2677"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}