This is a cache of https://docs.openshift.com/container-platform/4.5/serverless/installing_serverless/installing-knative-serving.html. It is a snapshot of the page at 2024-11-26T01:13:57.932+0000.
Installing Knative Serving - Installing OpenShift Serverless | Serverless | OpenShift Container Platform 4.5
×

After you install the OpenShift Serverless Operator, you can install Knative Serving by following the procedures described in this guide.

This guide provides information about installing Knative Serving using the default settings. However, you can configure more advanced settings in the KnativeServing custom resource definition.

For more information about configuration options for the KnativeServing custom resource definition, see Advanced installation configuration options.

Creating the knative-serving namespace

When you create the knative-serving namespace, a knative-serving project will also be created.

You must complete this procedure before installing Knative Serving.

If the KnativeServing object created during Knative Serving’s installation is not created in the knative-serving namespace, it will be ignored.

Prerequisites
  • An OpenShift Container Platform account with cluster administrator access

  • Installed OpenShift Serverless Operator

Creating the knative-serving namespace using the web console

Procedure
  1. In the OpenShift Container Platform web console, navigate to AdministrationNamespaces.

    Namespaces page
  2. Enter knative-serving as the Name for the project. The other fields are optional.

    Creating the `knative-eventing` namespace
  3. click Create.

Creating the knative-serving namespace using the cli

Procedure
  1. Create the knative-serving namespace by entering:

    $ oc create namespace knative-serving

Prerequisites

  • An OpenShift Container Platform account with cluster administrator access.

  • Installed OpenShift Serverless Operator.

  • Created the knative-serving namespace.

Installing Knative Serving using the web console

Procedure
  1. In the Administrator perspective of the OpenShift Container Platform web console, navigate to OperatorsInstalled Operators.

  2. Check that the Project dropdown at the top of the page is set to Project: knative-serving.

  3. click Knative Serving in the list of Provided APIs for the OpenShift Serverless Operator to go to the Knative Serving tab.

    Installed Operators page
  4. click the Create Knative Serving button.

    Knative Serving tab
  5. In the Create Knative Serving page, you can install Knative Serving using the default settings by clicking Create.

    You can also modify settings for the Knative Serving installation by editing the KnativeServing object using either the form provided, or by editing the YAML.

    • Using the form is recommended for simpler configurations that do not require full control of KnativeServing object creation.

    • Editing the YAML is recommended for more complex configurations that require full control of KnativeServing object creation. You can access the YAML by clicking the edit YAML link in the top right of the Create Knative Serving page.

      After you complete the form, or have finished modifying the YAML, click Create.

      For more information about configuration options for the KnativeServing custom resource definition, see the documentation on Advanced installation configuration options.

      Create Knative Serving in Form View
      Create Knative Serving in YAML view
  6. After you have installed Knative Serving, the KnativeServing object is created, and you will be automically directed to the Knative Serving tab.

    Installed Operators page

    You will see knative-serving in the list of resources.

Verification
  1. click on knative-serving in the Knative Serving tab.

  2. You will be automatically directed to the Knative Serving Overview page.

    Installed Operators page
  3. Scroll down to look at the list of Conditions.

  4. You should see a list of conditions with a status of True, as shown in the example image.

    Conditions

    It may take a few seconds for the Knative Serving resources to be created. You can check their status in the Resources tab.

  5. If the conditions have a status of Unknown or False, wait a few moments and then check again after you have confirmed that the resources have been created.

Installing Knative Serving using YAML

Procedure
  1. Create a file named serving.yaml.

  2. Copy the following sample YAML into serving.yaml:

    apiVersion: operator.knative.dev/v1alpha1
    kind: KnativeServing
    metadata:
        name: knative-serving
        namespace: knative-serving
  3. Apply the serving.yaml file:

    $ oc apply -f serving.yaml
Verification
  1. To verify the installation is complete, enter the following command:

    $ oc get knativeserving.operator.knative.dev/knative-serving -n knative-serving --template='{{range .status.conditions}}{{printf "%s=%s\n" .type .status}}{{end}}'

    The output should be similar to:

    DependenciesInstalled=True
    DeploymentsAvailable=True
    InstallSucceeded=True
    Ready=True

    It may take a few seconds for the Knative Serving resources to be created.

  2. If the conditions have a status of Unknown or False, wait a few moments and then check again after you have confirmed that the resources have been created.

  3. Check that the Knative Serving resources have been created by entering:

    $ oc get pods -n knative-serving

    The output should look similar to:

    NAME                               READY   STATUS    RESTARTS   AGE
    activator-5c596cf8d6-5l86c         1/1     Running   0          9m37s
    activator-5c596cf8d6-gkn5k         1/1     Running   0          9m22s
    autoscaler-5854f586f6-gj597        1/1     Running   0          9m36s
    autoscaler-hpa-78665569b8-qmlmn    1/1     Running   0          9m26s
    autoscaler-hpa-78665569b8-tqwvw    1/1     Running   0          9m26s
    controller-7fd5655f49-9gxz5        1/1     Running   0          9m32s
    controller-7fd5655f49-pncv5        1/1     Running   0          9m14s
    kn-cli-downloads-8c65d4cbf-mt4t7   1/1     Running   0          9m42s
    webhook-5c7d878c7c-n267j           1/1     Running   0          9m35s

Next steps

  • For cloud events functionality on OpenShift Serverless, you can install the Knative Eventing component. See the documentation on Installing Knative Eventing.

  • Install the Knative cli to use kn commands with Knative Serving. For example, kn service commands. See the documentation on Installing the Knative cli (kn).