This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.4.2. Installing Knative Serving
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.
4.2.1. 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
Procedure
In the OpenShift Container Platform web console, navigate to Administration
Namespaces. Enter
knative-serving
as the Name for the project. The other fields are optional.- Click Create.
Procedure
Create the
knative-serving
namespace by entering:oc create namespace knative-serving
$ oc create namespace knative-serving
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.2. Prerequisites 复制链接链接已复制到粘贴板!
- An OpenShift Container Platform account with cluster administrator access.
- Installed OpenShift Serverless Operator.
-
Created the
knative-serving
namespace.
4.2.3. Installing Knative Serving using the web console 复制链接链接已复制到粘贴板!
Procedure
-
In the Administrator perspective of the OpenShift Container Platform web console, navigate to Operators
Installed Operators. - Check that the Project dropdown at the top of the page is set to Project: knative-serving.
Click Knative Serving in the list of Provided APIs for the OpenShift Serverless Operator to go to the Knative Serving tab.
Click the Create Knative Serving button.
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.
-
Using the form is recommended for simpler configurations that do not require full control of
After you have installed Knative Serving, the
KnativeServing
object is created, and you will be automically directed to the Knative Serving tab.You will see
knative-serving
in the list of resources.
Verification
-
Click on
knative-serving
in the Knative Serving tab. You will be automatically directed to the Knative Serving Overview page.
- Scroll down to look at the list of Conditions.
You should see a list of conditions with a status of True, as shown in the example image.
注意It may take a few seconds for the Knative Serving resources to be created. You can check their status in the Resources tab.
- 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.
4.2.4. Installing Knative Serving using YAML 复制链接链接已复制到粘贴板!
Procedure
-
Create a file named
serving.yaml
. Copy the following sample YAML into
serving.yaml
:apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving
apiVersion: operator.knative.dev/v1alpha1 kind: KnativeServing metadata: name: knative-serving namespace: knative-serving
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the
serving.yaml
file:oc apply -f serving.yaml
$ oc apply -f serving.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Verification
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}}'
$ oc get knativeserving.operator.knative.dev/knative-serving -n knative-serving --template='{{range .status.conditions}}{{printf "%s=%s\n" .type .status}}{{end}}'
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output should be similar to:
DependenciesInstalled=True DeploymentsAvailable=True InstallSucceeded=True Ready=True
DependenciesInstalled=True DeploymentsAvailable=True InstallSucceeded=True Ready=True
Copy to Clipboard Copied! Toggle word wrap Toggle overflow 注意It may take a few seconds for the Knative Serving resources to be created.
-
If the conditions have a status of
Unknown
orFalse
, wait a few moments and then check again after you have confirmed that the resources have been created. Check that the Knative Serving resources have been created by entering:
oc get pods -n knative-serving
$ oc get pods -n knative-serving
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The output should look similar to:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.5. 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
).