This tutorial shows how to use different parts of Knative.
There's a presentation that accompanies the tutorial.
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
Knative Serving
- Hello World Serving
- Configure domain
- Change configuration
- Traffic splitting
- Configure autoscaling
- Integrate with Twilio
- Deploy to Cloud Run
- Serverless gRPC with Knative
Knative Eventing
Build
- Tekton Pipelines
- Knative Build (Deprecated)
This is not an official Google product.