Pesquisar

Este conteúdo não está disponível no idioma selecionado.

Chapter 2. Using Argo Rollouts for progressive deployment delivery

download PDF

To use Argo Rollouts and manage progressive delivery, after you install the Red Hat OpenShift GitOps Operator on the cluster, you can create and configure a RolloutManager custom resource (CR) instance in the namespace of your choice. You can scope the RolloutManager CR for single or multiple namespaces.

2.1. Prerequisites

  • You have access to the cluster with cluster-admin privileges.
  • You have access to the OpenShift Container Platform web console.
  • Red Hat OpenShift GitOps 1.9.0 or a newer version is installed on your cluster.

2.2. Creating a RolloutManager custom resource

To manage progressive delivery of deployments by using Argo Rollouts in Red Hat OpenShift GitOps, you must create and configure a RolloutManager custom resource (CR) in the namespace of your choice. By default, any new argo-rollouts instance has permission to manage resources only in the namespace where it is deployed, but you can use Argo Rollouts in multiple namespaces as required.

Prerequisites

  • Red Hat OpenShift GitOps 1.9.0 or a newer version is installed on your cluster.

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 custom resource (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 use the default YAML or edit it according to your requirements:

    Example: RolloutManager CR

    apiVersion: argoproj.io/v1alpha1
    kind: RolloutManager
    metadata:
      name: argo-rollout
      labels:
        example: basic
    spec: {}

  7. Click Create.
  8. In the RolloutManager tab, under the RolloutManagers section, verify that the Status field of the RolloutManager instance shows as Phase: Available.
  9. In the left navigation pane, verify the creation of the namespace-scoped supporting resources:

    • Click Workloads Deployments to verify that the argo-rollouts deployment is available with the Status showing as 1 of 1 pods running.
    • Click Workloads Secrets to verify that the argo-rollouts-notification-secret secret is available.
    • Click Networking Services to verify that the argo-rollouts-metrics service is available.
    • Click User Management Roles to verify that the argo-rollouts role and argo-rollouts-aggregate-to-admin, argo-rollouts-aggregate-to-edit, and argo-rollouts-aggregate-to-view cluster roles are available.
    • Click User Management RoleBindings to verify that the argo-rollouts role binding is available.

2.3. Deleting a RolloutManager custom resource

Uninstalling the Red Hat OpenShift GitOps Operator does not remove the resources that were created during installation. You must manually delete the RolloutManager custom resource (CR) before you uninstall the Red Hat OpenShift GitOps Operator.

Prerequisites

  • Red Hat OpenShift GitOps 1.9.0 or a newer version is installed on your cluster.
  • A RolloutManager CR exists in your namespace.

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. Click the Project drop-down menu and select the project that contains the RolloutManager CR.
  4. Select Red Hat OpenShift GitOps from the installed operators.
  5. Click the RolloutManager tab to find RolloutManager instances under the RolloutManagers section.
  6. Click the instance.
  7. Click Actions Delete RolloutManager from the drop-down menu, and click Delete to confirm in the dialog box.
  8. In the RolloutManager tab, under the RolloutManagers section, verify that the RolloutManager instance is not available anymore.
  9. In the left navigation pane, verify the deletion of the namespace-scoped supporting resources:

    • Click Workloads Deployments to verify that the argo-rollouts deployment is deleted.
    • Click Workloads Secrets to verify that the argo-rollouts-notification-secret secret is deleted.
    • Click Networking Services to verify that the argo-rollouts-metrics service is deleted.
    • Click User Management Roles to verify that the argo-rollouts role and argo-rollouts-aggregate-to-admin, argo-rollouts-aggregate-to-edit, and argo-rollouts-aggregate-to-view cluster roles are deleted.
    • Click User Management RoleBindings to verify that the argo-rollouts role binding is deleted.

2.4. Installing Argo Rollouts CLI on Linux

You can install the Argo Rollouts CLI on Linux.

Prerequisites

  • You have installed the OpenShift Container Platform CLI (oc).

Procedure

  1. Download the latest version of the Argo Rollouts CLI binary, kubectl-argo-rollouts, by running the following command:

    $ curl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-linux-amd64
  2. Ensure that the kubectl-argo-rollouts binary is executable by running the following command:

    $ chmod +x ./kubectl-argo-rollouts-linux-amd64
  3. Move the kubectl-argo-rollouts binary to the system path by running the following command:

    # mv ./kubectl-argo-rollouts-linux-amd64 /usr/local/bin/kubectl-argo-rollouts
    Important

    Ensure that you have superuser privileges to run this command.

  4. Verify that the plugin is installed correctly by running the following command and receiving the similar output:

    $ oc argo rollouts version

    Example output

    kubectl-argo-rollouts: v1.6.6+737ca89
      BuildDate: 2024-02-13T15:39:31Z 1
      GitCommit: 737ca89b42e4791e96e05b438c2b8540737a2a1a
      GitTreeState: clean
      GoVersion: go1.20.14 2
      Compiler: gc
      Platform: linux/amd64 3

    1
    The build date information of the Argo Rollouts binary.
    2
    The version of the Go language used for building the Argo Rollouts binary.
    3
    The platform used for building the Argo Rollouts binary.

2.5. Installing Argo Rollouts CLI on Mac OS

If you are a macOS user, you can install the Argo Rollouts CLI by using the Homebrew package manager.

Prerequisites

  • You have installed the Homebrew (brew) package manager.

Procedure

  • Run the following command to install the Argo Rollouts CLI:

    $ brew install argoproj/tap/kubectl-argo-rollouts

2.6. Additional resources

Red Hat logoGithubRedditYoutubeTwitter

Aprender

Experimente, compre e venda

Comunidades

Sobre a documentação da Red Hat

Ajudamos os usuários da Red Hat a inovar e atingir seus objetivos com nossos produtos e serviços com conteúdo em que podem confiar.

Tornando o open source mais inclusivo

A Red Hat está comprometida em substituir a linguagem problemática em nosso código, documentação e propriedades da web. Para mais detalhes veja oBlog da Red Hat.

Sobre a Red Hat

Fornecemos soluções robustas que facilitam o trabalho das empresas em plataformas e ambientes, desde o data center principal até a borda da rede.

© 2024 Red Hat, Inc.