|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * /serverless/install/install-serverless-operator.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="serverless-install-cli_{context}"] |
| 7 | += Installing the {ServerlessOperatorName} from the CLI |
| 8 | + |
| 9 | +You can install the {ServerlessOperatorName} from the OperatorHub by using the CLI. Installing this Operator enables you to install and use Knative components. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +ifdef::openshift-enterprise[] |
| 14 | +* You have access to an {product-title} account with cluster administrator access. |
| 15 | +* Your cluster has the Marketplace capability enabled or the Red Hat Operator catalog source configured manually. |
| 16 | +endif::[] |
| 17 | + |
| 18 | +ifdef::openshift-dedicated,openshift-rosa[] |
| 19 | +* You have access to an {product-title} account with cluster or dedicated administrator access. |
| 20 | +endif::[] |
| 21 | + |
| 22 | +* You have logged in to the {product-title} cluster. |
| 23 | +
|
| 24 | +.Procedure |
| 25 | +. Create a YAML file containing `Namespace`, `OperatorGroup`, and `Subscription` objects to subscribe a namespace to the {ServerlessOperatorName}. For example, create the file `serverless-subscription.yaml` with the following content: |
| 26 | ++ |
| 27 | +.Example subscription |
| 28 | +[source,yaml] |
| 29 | +---- |
| 30 | +--- |
| 31 | +apiVersion: v1 |
| 32 | +kind: Namespace |
| 33 | +metadata: |
| 34 | + name: openshift-serverless |
| 35 | +--- |
| 36 | +apiVersion: operators.coreos.com/v1 |
| 37 | +kind: OperatorGroup |
| 38 | +metadata: |
| 39 | + name: serverless-operators |
| 40 | + namespace: openshift-serverless |
| 41 | +spec: {} |
| 42 | +--- |
| 43 | +apiVersion: operators.coreos.com/v1alpha1 |
| 44 | +kind: Subscription |
| 45 | +metadata: |
| 46 | + name: serverless-operator |
| 47 | + namespace: openshift-serverless |
| 48 | +spec: |
| 49 | + channel: stable <1> |
| 50 | + name: serverless-operator <2> |
| 51 | + source: redhat-operators <3> |
| 52 | + sourceNamespace: openshift-marketplace <4> |
| 53 | +---- |
| 54 | +<1> The channel name of the Operator. The `stable` channel enables installation of the most recent stable version of the {ServerlessOperatorName}. |
| 55 | +<2> The name of the Operator to subscribe to. For the {ServerlessOperatorName}, this is always `serverless-operator`. |
| 56 | +<3> The name of the CatalogSource that provides the Operator. Use `redhat-operators` for the default OperatorHub catalog sources. |
| 57 | +<4> The namespace of the CatalogSource. Use `openshift-marketplace` for the default OperatorHub catalog sources. |
| 58 | +
|
| 59 | +. Create the `Subscription` object: |
| 60 | ++ |
| 61 | +---- |
| 62 | +$ oc apply -f serverless-subscription.yaml |
| 63 | +---- |
| 64 | +
|
| 65 | +.Verification |
| 66 | +Check that the cluster service version (CSV) has reached the `Succeeded` phase: |
| 67 | +
|
| 68 | +.Example command |
| 69 | +[source,yaml] |
| 70 | +---- |
| 71 | +$ oc get csv |
| 72 | +---- |
| 73 | +
|
| 74 | +.Example output |
| 75 | +[source,yaml] |
| 76 | +---- |
| 77 | +NAME DISPLAY VERSION REPLACES PHASE |
| 78 | +serverless-operator.v1.25.0 Red Hat OpenShift Serverless 1.25.0 serverless-operator.v1.24.0 Succeeded |
| 79 | +---- |
0 commit comments