Difficulty: Introduction
Estimated Time: 20 minutes

Knative on Kubernetes

(This draft tutorial is under construction in step 3. Contact me for questions: [email protected], December 8, 2018)

Knative is a Kubernetes-based platform to build, deploy, and manage modern serverless workloads. It drives with three primary features:

Serving Scale to zero, request-driven compute model
Build Cloud-native source to container orchestration
Events Universal subscription, delivery and management of events

Knative (pronounced kay-nay-tiv) extends Kubernetes 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.

Each of the components under the Knative project attempt to identify common patterns and codify the best practices that are shared by successful real-world Kubernetes-based frameworks and applications. Knative components focus on solving many mundane but difficult tasks such as:

  • Deploying a container
  • Orchestrating source-to-URL workflows on Kubernetes
  • Routing and managing traffic with blue/green deployment
  • Automatic scaling and sizing workloads based on demand
  • Binding running services to eventing ecosystems]()
  • Developers on Knative can use familiar idioms, languages, and frameworks to deploy any workload: functions, applications, or containers.

These instructions have been adapted from Getting Started with Knative App Deployment.

There are a set of helpful solutions that allow serverless functions to run:

  • Knative (pronounced kay-nay-tiv) extends Kubernetes 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.
  • Istio is a service mesh for Kubernetes
  • Kubernetes is the container management system that targets a variety of cloud and data center resources. An operating system for your data center.

In the following steps you will learn:

  • how to install Knative Kubernetes,
  • how to install and invoke function on Knative.

More about the Knative and Istio architecture is described in the documentation.

Conclusion

Knative is a new open source project started by engineers from Google, Pivotal, and other industry leaders. It’s a collection of components that extend Kubernetes. It includes three major parts: Serving, Build, and Eventing.

Lessons Learned

With these steps you have learned:

  • how to install Knative Kubernetes,
  • how to install and invoke function on Knative.

References


No Fluff Just Stuff

For a deeper understanding of these topics and more join me, Jonathan Johnson, for a transcendent experience on the No Fluff Just Stuff Software Symposium Tour.

Knative

Step 1 of 5

Kubernetes Cluster

For this scenario, Katacoda has just started a fresh Kubernetes cluster for you. Verify it's ready for your use.

kubectl version --short && kubectl cluster-info && kubectl get nodes

The Helm package manager used for installing applications on Kubernetes is also available.

helm version --short

Kubernetes Dashboard

You can control the cluster with the kubectl CLI tool or through the Kubernetes Dashboard. Because the dashboard can be accessed publicly, it is protected and requires the secret access token to sign in. Copy the token from this secret.

export TOKEN=$(kubectl describe secret $(kubectl get secret | awk '/^dashboard-token-/{print $1}') | awk '$1=="token:"{print $2}') && echo -e "\n--- Copy and paste this token for dashboard access --\n$TOKEN\n---"

To access the dashboard, click on the Kubernetes Dashboard tab above the command line or from this link: https://[[HOST_SUBDOMAIN]]-30000-[[KATACODA_HOST]].environments.katacoda.com/. At the sign in prompt select Token and paste in the token, you copied a moment ago.

For Kubernetes clusters exposed to the public, always lock administration access including access to the dashboard.