xfgong / knative-tutorial

A step-by-step tutorial showing different parts of Knative

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Knative Tutorial

This tutorial shows how to use different parts of Knative.

Slides

There's a presentation that accompanies the tutorial.

Serverless with Knative

Installation

If you need to install Knative and its dependencies (Istio), see Knative Installation page for your platform. We tested this tutorial on Google Kubernetes Engine (GKE) with Knative version 0.8. For detailed GKE instructions, see Install on Google Kubernetes Engine page. Let's briefly recap the steps of installing Knative on GKE.

Set some environment variables for the cluster name and zone:

export CLUSTER_NAME=knative
export CLUSTER_ZONE=europe-west1-b

Create a Kubernetes cluster with Istio add-on with the preferred name and zone:

gcloud beta container clusters create $CLUSTER_NAME \
  --addons=HorizontalPodAutoscaling,HttpLoadBalancing,Istio \
  --machine-type=n1-standard-4 \
  --cluster-version=latest --zone=$CLUSTER_ZONE \
  --enable-stackdriver-kubernetes --enable-ip-alias \
  --enable-autoscaling --min-nodes=1 --max-nodes=10 \
  --enable-autorepair \
  --scopes cloud-platform

Grant cluster-admin permissions to the current user:

kubectl create clusterrolebinding cluster-admin-binding \
     --clusterrole=cluster-admin \
     --user=$(gcloud config get-value core/account)

Install Knative in 2 steps:

kubectl apply --selector knative.dev/crd-install=true \
   --filename https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
   --filename https://github.com/knative/eventing/releases/download/v0.8.0/release.yaml \
   --filename https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

kubectl apply --filename https://github.com/knative/serving/releases/download/v0.8.0/serving.yaml \
   --filename https://github.com/knative/eventing/releases/download/v0.8.0/eventing.yaml \
   --filename https://github.com/knative/serving/releases/download/v0.8.0/monitoring.yaml

If everything worked, all Knative components should show a STATUS of Running:

kubectl get pods -n knative-serving
kubectl get pods -n knative-eventing
kubectl get pods -n knative-monitoring

Steps

Knative Serving

Knative Eventing

Build


This is not an official Google product.

About

A step-by-step tutorial showing different parts of Knative

License:Apache License 2.0


Languages

Language:C# 58.3%Language:Python 25.1%Language:Dockerfile 16.6%