OpenShift Serverless is not tested or supported for installation in a restricted network environment.

Cluster size requirements

The cluster must be sized appropriately to ensure that OpenShift Serverless can run correctly. You can use the MachineSet API to manually scale your cluster up to the desired size.

An OpenShift cluster with 10 CPUs and 40 GB memory is the minimum requirement for getting started with your first serverless application. This usually means you must scale up one of the default MachineSets by two additional machines.

For this configuration, the requirements depend on the deployed applications. By default, each pod requests ~400m of CPU and recommendations are based on this value. In the given recommendation, an application can scale up to 10 replicas. Lowering the actual CPU request of the application further pushes the boundary.

The numbers given only relate to the pool of worker machines of the OpenShift cluster. Master nodes are not used for general scheduling and are omitted.

For more advanced use-cases, such as using OpenShift logging, monitoring, metering, and tracing, you must deploy more resources. Recommended requirements for such use-cases are 24 vCPUs and 96GB of memory.

Additional resources

For more information on using the MachineSet API, see Creating MachineSets.

Scaling a MachineSet manually

If you must add or remove an instance of a machine in a MachineSet, you can manually scale the MachineSet.

  • Install an OpenShift Container Platform cluster and the oc command line.

  • Log in to oc as a user with cluster-admin permission.

  1. View the MachineSets that are in the cluster:

    $ oc get machinesets -n openshift-machine-api

    The MachineSets are listed in the form of <clusterid>-worker-<aws-region-az>.

  2. Scale the MachineSet:

    $ oc scale --replicas=2 machineset <machineset> -n openshift-machine-api


    $ oc edit machineset <machineset> -n openshift-machine-api

    You can scale the MachineSet up or down. It takes several minutes for the new machines to be available.

    = The MachineSet delete policy Random, Newest, and Oldest are the three supported options. The default is Random, meaning that random machines are chosen and deleted when scaling MachineSets down. The delete policy can be set according to the use case by modifying the particular MachineSet:

  deletePolicy: <delete policy>
  replicas: <desired replica count>

Specific machines can also be priortized for deletion by adding the annotation to the machine of interest, regardless of the delete policy.

By default, the OpenShift Container Platform router pods are deployed on workers. Because the router is required to access some cluster resources, including the web console, do not scale the worker MachineSet to 0 unless you first relocate the router pods.

Custom MachineSets can be used for use cases requiring that services run on specific nodes and that those services are ignored by the controller when the worker MachineSets are scaling down. This prevents service disruption.

Installing the OpenShift Serverless Operator

The OpenShift Serverless Operator can be installed using the OpenShift Container Platform instructions for installing Operators.

You can install the OpenShift Serverless Operator in the host cluster by following the OpenShift Container Platform instructions on installing an Operator.

The OpenShift Serverless Operator only works for OpenShift Container Platform versions 4.1.13 and later.

For details, see the OpenShift Container Platform documentation on adding Operators to a cluster.

The OpenShift Serverless Operator automatically installs the Service Mesh Operator. If you already have a community version of Maistra installed, this will cause a conflict with the OpenShift Serverless Operator Service Mesh auto-install. In this case, the already existing community version of Maistra will be used instead.

Installing Knative Serving

You must create a KnativeServing object to install Knative Serving using the OpenShift Serverless Operator.

You must create the KnativeServing object in the knative-serving namespace, as shown in the sample YAML, or it is ignored.

Sample serving.yaml
apiVersion: v1
kind: Namespace
 name: knative-serving
kind: KnativeServing
 name: knative-serving
 namespace: knative-serving
  • An account with cluster administrator access.

  • Installed OpenShift Serverless Operator.

  1. Copy the sample YAML file into serving.yaml and apply it using:

    $ oc apply -f serving.yaml
  2. Verify the installation is complete by using the command:

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

    Results should be similar to:


Uninstalling Knative Serving

To uninstall Knative Serving, you must remove its custom resource and delete the knative-serving namespace.

  • Installed Knative Serving

  1. To remove Knative Serving, use the following command:

    $ oc delete knative-serving -n knative-serving
  2. After the command has completed and all pods have been removed from the knative-serving namespace, delete the namespace by using the command:

    $ oc delete namespace knative-serving

Deleting the OpenShift Serverless Operator

You can remove the OpenShift Serverless Operator from the host cluster by following the OpenShift Container Platform instructions on deleting an Operator.

For details, see the OpenShift Container Platform documentation on deleting Operators from a cluster.

Deleting Knative Serving CRDs from the Operator

After uninstalling the OpenShift Serverless Operator, the Operator CRDs and API services remain on the cluster. Use this procedure to completely uninstall the remaining components.

  • You have uninstalled Knative Serving and removed the OpenShift Serverless Operator using the previous procedure.

  1. Run the following command to delete the remaining Knative Serving CRDs:

    $ oc delete crd