Installing Knative

Let’s install Knative on your Kubernetes cluster. We’ll install the Knative Serving component and configure networking.

Step 1: Install Knative Serving

First, install the Knative Serving component:

Terminal window
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.0/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.0/serving-core.yaml

Step 2: Install a Networking Layer

Knative requires a networking layer. We’ll use Kourier:

Terminal window
kubectl apply -f https://github.com/knative/net-kourier/releases/download/knative-v1.12.0/kourier.yaml

Configure Knative to use Kourier:

Terminal window
kubectl patch configmap/config-network \
--namespace knative-serving \
--type merge \
--patch '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'

Step 3: Configure DNS

For local development, configure Magic DNS:

Terminal window
kubectl apply -f https://github.com/knative/serving/releases/download/knative-v1.12.0/serving-default-domain.yaml

Verify Installation

Check that all Knative components are running:

Terminal window
kubectl get pods -n knative-serving

You should see all pods in Running status.

Next Steps

Now that Knative is installed, let’s deploy your first service!