Este contenido no está disponible en el idioma seleccionado.

Chapter 8. Enabling high availability support for Argo Rollouts


Argo Rollouts support enabling high availability (HA) in the RolloutManager Custom Resource (CR). When you configure high availability in Argo Rollouts, the Red Hat OpenShift GitOps Operator automatically sets the number of pods to 2 for the Argo Rollouts controller using the .spec.ha field in the RolloutManager CR. It also activates leader election, allowing the pods to run in an active-passive process. A single pod actively manages rollouts, while the other pod remains in a passive state, ensuring the additional replica provides redundancy and availability if a node fails.

This feature benefits the Rollouts controller by ensuring it runs without downtime or manual intervention. It also operates during planned maintenance, as the second replica ensures the controller runs smoothly. Enabling high availability in Argo Rollouts ensures the controller remains reliable and resilient, even during node failures or heavy workloads.

The Red Hat OpenShift GitOps Operator also ensures that anti-affinity rules apply by default. Although these rules are not user-defined, they ensure the controller pods distribute across different nodes to avoid a single point of failure, providing resilience against node failure.

Prerequisites

  • You are logged in to the OpenShift Container Platform cluster as an administrator.
  • You installed Red Hat OpenShift GitOps on your OpenShift Container Platform cluster.
  • You installed Argo Rollouts on your OpenShift Container Platform cluster.

8.1. Configuring high availability for Argo Rollouts

To enable high availability, configure the ha specification in the RolloutManager custom resource (CR) by completing the following steps:

Procedure

  1. Log in to the OpenShift Container Platform web console as a cluster administrator.
  2. In the Administrator perspective, click Operators Installed Operators.
  3. Create or select the project where you want to create and configure a RolloutManager CR from the Project drop-down menu.
  4. Select Red Hat OpenShift GitOps from the installed Operators.
  5. In the Details tab, under the Provided APIs section, click Create instance in the RolloutManager pane.
  6. On the Create RolloutManager page, select the YAML view and edit the YAML.

    Example enabling the ha field in the RolloutManager CR

    apiVersion: argoproj.io/v1alpha1
    kind: RolloutManager
    metadata:
      name: argo-rollouts
      namespace: openshift-gitops
    spec:
      ha:
        enabled: true 1

    1
    Specifies whether high availability is enabled or not. If the value is set to true, high availability is enabled.
  7. Click Create.
  8. In the RolloutManager tab, under the RolloutManagers section, verify that the Status field of the RolloutManager instance shows Phase: Available.
  9. Verify the status of the Rollouts deployment by completing the following steps:

    1. In the Administrator perspective, click Workloads Deployments.
    2. Click the argo-rollouts deployment.
    3. Click the Details tab and confirm that the number of replicas in the Rollouts deployment is now set to 2.
    4. Click the YAML tab and confirm that the following configuration is displayed:

      Example Argo Rollouts deployment configuration file

      kind: Deployment
      metadata:
        name: argo-rollouts
        namespace: openshift-gitops
      spec:
        replicas: 2 1
        selector:
          matchLabels:
            app.kubernetes.io/name: argo-rollouts
        template:
          metadata:
            creationTimestamp: null
            labels:
              app.kubernetes.io/name: argo-rollouts
          spec:
            containers:
                args:
                  - '--leader-elect'
                  - 'true' 2

      1
      Specifies the number of pods.
      2
      Specifies that the --leader-elect=true flag is passed to the Rollouts deployment. Although this flag is set to true by default, explicitly setting it ensures that leader election remains consistently enforced.
Red Hat logoGithubRedditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

© 2024 Red Hat, Inc.