Install on OpenShift

Knative Install on OpenShift

This guide walks you through the installation of the latest version of
Knative Serving on
OpenShift by using the Knative Serving
Operator. The operator is available on the OpenShift OperatorHub. After you
install Knative Serving, this guide walks you through creating and deploying an
image of a sample “Hello World” app onto the new Knative cluster.

Before you begin

An OpenShift 4 cluster is required for installation. Visit
try.openshift.com for information on setting up a
cluster. You will need cluster administrator privileges to install and use
Knative on an OpenShift cluster.

Installing the Knative Serving Operator

Go to Catalog > OperatorHub in the
OpenShift Web Console. A list of operators for
OpenShift, provided by Red Hat as well as a community of partners and
open-source projects is provided. Click on the Knative Serving Operator
tile.

NOTE: Use the Filter by Keyword box to help you find the Knative
Serving operator in the catalog.

A Show Community Operator dialog box will open. Click Continue to
proceed.

On the Create the Operator Subscription screen, create a new subscription
by clicking on the Subscribe button. This will install the Knative
Serving Operator in the project openshift-operators and Knative Serving in
the knative-serving project.

NOTE: The Operator Lifecycle Manager (OLM) installs the operator, which
will automatically install Knative. This installation will create the
knative-serving, istio-operator, and istio-system namespaces.

Verify the subscription status for the installation operator, by viewing the
Subscription Overview. The UPGRADE STATUS will update from
0 Installing to 1 Installed.

NOTE: The screen will update after a few minutes. Wait for the
knative-serving namespace to appear in the project drop-down menu. Refresh
the page if needed.

Knative Serving is now installed. Navigate to Catalog > Installed
Operators to confirm the operator is installed. Click on
knative-serving to view the install status.

Deploying an app

Now that your cluster has Knative installed, you’re ready to deploy an app.

If you’d like to view the available sample apps and deploy one of your choosing,
head to the sample apps repo.

NOTE: When looking up the IP address to use for accessing your app, you
need to look up the NodePort for the istio-ingressgateway well as the IP
address used for OpenShift. You can use the following command to look up the
value to use for the {IP_ADDRESS} placeholder used in the samples:

# In Knative 0.2.x and prior versions, the `knative-ingressgateway` service was used instead of `istio-ingressgateway`.INGRESSGATEWAY=knative-ingressgateway
# The use of `knative-ingressgateway` is deprecated in Knative v0.3.x.# Use `istio-ingressgateway` instead, since `knative-ingressgateway`# will be removed in Knative v0.4.if kubectl get configmap config-istio -n knative-serving &> /dev/null;thenINGRESSGATEWAY=istio-ingressgateway
fiexportIP_ADDRESS=$(oc get node -o 'jsonpath={.items[0].status.addresses[0].address}'):$(oc get svc $INGRESSGATEWAY -n istio-system -o 'jsonpath={.spec.ports[?(@.port==80)].nodePort}')

Uninstalling the Knative Serving Operator

Go to Catalog > OperatorHub in the OpenShift Web Console.

Click on the Knative Serving Operator tile.

NOTE: The operator tile will indicate it is installed.

The Show Community Operator` dialog box will appear. Click Continue
to proceed.