×

High availability (HA) is a standard feature of Kubernetes APIs that helps to ensure that APIs stay operational if a disruption occurs. In an HA deployment, if an active controller crashes or is deleted, another controller is available to take over processing of the APIs that were being serviced by the controller that is now unavailable.

HA in OpenShift Serverless is available through leader election, which is enabled by default after the Knative Serving or Eventing control plane is installed.

When using a leader election HA pattern, instances of controllers are already scheduled and running inside the cluster before they are required. These controller instances compete to use a shared resource, known as the leader election lock. The instance of the controller that has access to the leader election lock resource at any given time is referred to as the leader.

Configuring high availability replicas on OpenShift Serverless

High availability (HA) functionality is available by default on OpenShift Serverless for Knative Serving, Knative Eventing, and Knative Kafka. These are the components scaled for each of them:

  • Knative Serving: activator, autoscaler, autoscaler-hpa, controller, webhook, kourier-control, kourier-gateway.

  • Knative Eventing: eventing-controller, eventing-webhook, imc-controller, imc-dispatcher, mt-broker-controller, sugar-controller.

  • Knative Kafka: kafka-ch-controller, kafka-controller-manager, kafka-webhook.

These components are configured with two replicas by default.

For Knative Eventing, the mt-broker-filter and mt-broker-ingress deployments are not scaled by HA. If multiple deployments are needed, scale these components manually.

You modify the number of replicas that are created per component by changing the configuration of spec.high-availability.replicas in the KnativeServing custom resource (CR), the KnativeEventing CR, or the KnativeKafka CR.

Configuring high availability replicas for Knative Serving

You can scale Knative Serving components by modifying the spec.high-availability.replicas value in the KnativeServing custom resource (CR).

Prerequisites
  • You have access to an OpenShift Dedicated account with cluster administrator or dedicated administrator access.

  • The OpenShift Serverless Operator and Knative Serving are installed on your cluster.

Procedure
  1. In the OpenShift Dedicated web console Administrator perspective, navigate to OperatorHubInstalled Operators.

  2. Select the knative-serving namespace.

  3. Click Knative Serving in the list of Provided APIs for the OpenShift Serverless Operator to go to the Knative Serving tab.

  4. Click knative-serving, then go to the YAML tab in the knative-serving page.

    Knative Serving YAML
  5. Modify the number of replicas in the KnativeServing CR:

    Example YAML
    apiVersion: operator.knative.dev/v1alpha1
    kind: KnativeServing
    metadata:
      name: knative-serving
      namespace: knative-serving
    spec:
      high-availability:
        replicas: 3 (1)
    1 Sets the number of replicas to 3.
    • The replicas value sets the replica count for all HA controllers.

    • The default replicas value is 2.

    • You can increase the number of replicas by changing the value to 3 or more.

Configuring high availability replicas for Knative Eventing

You can scale Knative Eventing components by modifying the spec.high-availability.replicas value in the KnativeEventing custom resource (CR).

Prerequisites
  • You have access to an OpenShift Dedicated account with cluster administrator or dedicated administrator access.

  • The OpenShift Serverless Operator and Knative Eventing are installed on your cluster.

Procedure
  1. In the OpenShift Dedicated web console Administrator perspective, navigate to OperatorHubInstalled Operators.

  2. Select the knative-eventing namespace.

  3. Click Knative Eventing in the list of Provided APIs for the OpenShift Serverless Operator to go to the Knative Eventing tab.

  4. Click knative-eventing, then go to the YAML tab in the knative-eventing page.

    Knative Eventing YAML
  5. Modify the number of replicas in the KnativeEventing CR:

    Example YAML
    apiVersion: operator.knative.dev/v1alpha1
    kind: KnativeEventing
    metadata:
      name: knative-eventing
      namespace: knative-eventing
    spec:
      high-availability:
        replicas: 3 (1)
    1 Sets the number of replicas to 3.
    • The replicas value sets the replica count for all HA controllers.

    • The default replicas value is 2.

    • You can increase the number of replicas by changing the value to 3 or more.

Configuring high availability replicas for Knative Kafka

You can scale Knative Kafka components by modifying the spec.high-availability.replicas value in the KnativeKafka custom resource (CR).

Prerequisites
  • You have access to an OpenShift Dedicated account with cluster administrator or dedicated administrator access.

  • The OpenShift Serverless Operator and Knative Kafka are installed on your cluster.

Procedure
  1. In the OpenShift Dedicated web console Administrator perspective, navigate to OperatorHubInstalled Operators.

  2. Select the knative-eventing namespace.

  3. Click Knative Kafka in the list of Provided APIs for the OpenShift Serverless Operator to go to the Knative Kafka tab.

  4. Click knative-kafka, then go to the YAML tab in the knative-kafka page.

    Knative Kafka YAML
  5. Modify the number of replicas in the KnativeKafka CR:

    Example YAML
    apiVersion: operator.serverless.openshift.io/v1alpha1
    kind: KnativeKafka
    metadata:
      name: knative-kafka
      namespace: knative-eventing
    spec:
      high-availability:
        replicas: 3 (1)
    1 Sets the number of replicas to 3.
    • The replicas value sets the replica count for all HA controllers.

    • The default replicas value is 2.

    • You can increase the number of replicas by changing the value to 3 or more.