Install by using the Knative Operator CLI Plugin

Knative provides a CLI Plugin to install, configure and manage Knative via the command lines. This CLI plugin facilitates you with a parameter-driven way to configure the Knative cluster, without interacting with the complexities of the custom resources.

Prerequisites

Before installing Knative, you must meet the following prerequisites:

  • For prototyping purposes, Knative works on most local deployments of Kubernetes. For example, you can use a local, one-node cluster that has 3 CPUs and 4 GB of memory.

    Tip

    You can install a local distribution of Knative for development purposes using the Knative Quickstart plugin

  • For production purposes, it is recommended that:

    • If you have only one node in your cluster, you need at least 6 CPUs, 6 GB of memory, and 30 GB of disk storage.
    • If you have multiple nodes in your cluster, for each node you need at least 2 CPUs, 4 GB of memory, and 20 GB of disk storage.
    • You have a cluster that uses Kubernetes v1.28 or newer.
    • You have installed the kubectl CLI.
    • Your Kubernetes cluster must have access to the internet, because Kubernetes needs to be able to fetch images. To pull from a private registry, see Deploying images from a private container registry.

Caution

The system requirements provided are recommendations only. The requirements for your installation might vary, depending on whether you use optional components, such as a networking layer.

Verifying CLI binaries

Knative kn CLI releases from 1.9 onwards are signed with cosign. You can use the following steps to verify the CLI binaries:

  1. Download the files you want, and the checksums.txt, checksum.txt.pem, and checksums.txt.sig files from the releases page, by running the commands:

    1. wget https://github.com/knative/client/releases/download/<kn-version>/checksums.txt
    2. wget https://github.com/knative/client/releases/download/<kn-version>/kn-darwin-amd64
    3. wget https://github.com/knative/client/releases/download/<kn-version>/checksums.txt.sig
    4. wget https://github.com/knative/client/releases/download/<kn-version>/checksums.txt.pem

    Where <kn-version> is the version of the CLI that you want to verify. For example, knative-v1.8.0.

  2. Verify the signature by running the command:

    1. cosign verify-blob \
    2. --cert checksums.txt.pem \
    3. --signature checksums.txt.sig \
    4. --certificate-identity=signer@knative-releases.iam.gserviceaccount.com \
    5. --certificate-oidc-issuer=https://accounts.google.com \
    6. checksums.txt
  3. If the signature is valid, you can then verify the SHA256 sums match the downloaded binary, by running the command:

    1. sha256sum --ignore-missing -c checksums.txt

Note

Knative images are signed in KEYLESS mode. To learn more about keyless signing, please refer to Keyless Signatures. The signing identity for Knative releases is signer@knative-releases.iam.gserviceaccount.com, and the issuer is https://accounts.google.com.

Install the Knative Operator CLI Plugin

Before you install the Knative Operator CLI Plugin, first install the Knative CLI.

MacOSLinux

  1. Download the binary kn-operator-darwin-amd64 for your system from the release page.

  2. Rename the binary to kn-operator:

    1. mv kn-operator-darwin-amd64 kn-operator
  3. Download the binary kn-operator-linux-amd64 for your system from the release page.

  4. Rename the binary to kn-operator:

    1. mv kn-operator-linux-amd64 kn-operator

Make the plugin executable by running the command:

  1. chmod +x kn-operator

Create the directory for the kn plugin:

  1. mkdir -p ~/.config/kn/plugins

Move the file to a plugin directory for kn:

  1. cp kn-operator ~/.config/kn/plugins

Verify the installation of the Knative Operator CLI Plugin

You can run the following command to verify the installation:

  1. kn operator -h

You should see more information about how to use this CLI plugin.

Install the Knative Operator

You can install Knative Operator of any specific version under any specific namespace. By default, the namespace is default, and the version is the latest.

To install the latest version of Knative Operator, run:

  1. kn operator install

To install Knative Operator under a certain namespace, e.g. knative-operator, run:

  1. kn operator install -n knative-operator

To install Knative Operator of a specific version, e.g. 1.7.1, run:

  1. kn operator install -v 1.7.1

Installing the Knative Serving component

You can install Knative Serving of any specific version under any specific namespace. By default, the namespace is knative-serving, and the version is the latest.

To install the latest version of Knative Serving, run:

  1. kn operator install --component serving

To install Knative Serving under a certain namespace, e.g. knative-serving, run:

  1. kn operator install --component serving -n knative-serving

To install Knative Operator of a specific version, e.g. 1.7, run:

  1. kn operator install --component serving -n knative-serving -v "1.7"

To install the ingress plugin, e.g Kourier, together with the install command, run:

  1. kn operator install --component serving -n knative-serving -v "1.7" --kourier

If you do not specify the ingress plugin, istio is used as the default. However, you need to make sure you install Istio first.

Install the networking layer

You can configure the network layer option via the Operator CLI Plugin. Click on each of the following tabs to see how you can configure Knative Serving with different ingresses:

Kourier (Choose this if you are not sure)Istio (default)Contour

The following steps install Kourier and enable its Knative integration:

  1. To configure Knative Serving to use Kourier, run the command as follows:

    1. kn operator enable ingress --kourier -n knative-serving

The following steps install Istio to enable its Knative integration:

  1. Install Istio.

  2. To configure Knative Serving to use Istio, run the command as follows:

    1. kn operator enable ingress --istio -n knative-serving

The following steps install Contour and enable its Knative integration:

  1. Install a properly configured Contour:

    1. kubectl apply --filename https://github.com/knative/net-contour/releases/download/knative-v1.16.0/contour.yaml
  2. To configure Knative Serving to use Contour, run the command as follows:

    1. kn operator enable ingress --contour -n knative-serving

Installing the Knative Eventing component

You can install Knative Eventing of any specific version under any specific namespace. By default, the namespace is knative-eventing, and the version is the latest.

To install the latest version of Knative Eventing, run:

  1. kn operator install --component eventing

To install Knative Eventing under a certain namespace, e.g. knative-eventing, run:

  1. kn operator install --component eventing -n knative-eventing

To install Knative Operator of a specific version, e.g. 1.7, run:

  1. kn operator install --component eventing -n knative-eventing -v "1.7"

Installing Knative Eventing with event sources

Knative Operator can configure the Knative Eventing component with different event sources. Click on each of the following tabs to see how you can configure Knative Eventing with different event sources:

CephGitHubGitLabApache KafkaRabbitMQRedis

  1. To install the eventing source Ceph, run the following command:

    1. kn operator enable eventing-source --ceph --namespace knative-eventing
  2. To install the eventing source Github, run the following command:

    1. kn operator enable eventing-source --github --namespace knative-eventing
  3. To install the eventing source Gitlab, run the following command:

    1. kn operator enable eventing-source --gitlab --namespace knative-eventing
  4. To install the eventing source Kafka, run the following command:

    1. kn operator enable eventing-source --kafka --namespace knative-eventing
  5. To install the eventing source RabbitMQ, run the following command:

    1. kn operator enable eventing-source --rabbitmq --namespace knative-eventing
  6. To install the eventing source Redis, run the following command:

    1. kn operator enable eventing-source --redis --namespace knative-eventing

What’s next