Knative serving is set to use one replica instead of two

If Knative serving is not set to use two replicas, any action that needs to drain the node with the Knative replica pod, such as upgrading Red Hat® OpenShift® Container Platform, fails.

Symptoms

The Knative deployment is configured with a Pod Disruption Budget with a minAvailable of one pod. The node where the pod currently is running cannot drain because only one pod is available and the Pod Disruption Budget requires that at least one pod remains available.

Resolving the problem

To verify that Knative serving is set to use two replicas by using the command line, follow these steps.

  1. Verify that Knative serving is set to use two replicas by typing the following command.
    oc get knativeserving knative-serving -n knative-serving -o jsonpath='{.spec.high-availability.replicas}'
  2. If Knative serving is set to use one replica, increase the replicas to two by typing the following command.
    oc patch knativeserving knative-serving -n knative-serving --type json -p '[{"op": "replace", "path": "/spec/high-availability/replicas", "value": 2}]'
  3. Verify that the change is complete by typing the following command and looking to see whether deployments are 2/2 in the output.
    oc get deploy activator webhook -n knative-serving

To verify that Knative serving is set to use two replicas by using the Red Hat OpenShift web console, follow these steps.

  1. Go to Operators > Installed Operators and ensure that the Project is set to knative-serving.
  2. Click the Knative Serving link in the Provided APIs column.
  3. Click knative-serving.
  4. On the YAML tab, look for high-availability:replicas:. If Knative serving is set to use two replicas, you can proceed to upgrading Red Hat OpenShift Container Platform. If it is set to use one replica, change the 1 to a 2 and click Save.
  5. Go to Workloads > Deployments and verify that the activator and webhook statuses both show 2 of 2 pods.