Chapter 7. Configuring traffic management and metric plugins in Argo Rollouts Argo Rollouts supports configuring traffic management and metric plugins directly through the RolloutManager Custom Resource (CR). The native support for these plugins in Argo Rollouts eliminates the need to modify the config map manually, ensuring a consistent configuration across the system. As a result, Argo Rollouts no longer preserves user-defined plugins in the config map. Instead, it only applies to the plugins specified within the RolloutManager CR. By managing plugins directly within the RolloutManager CR, you can do the following: Centralize plugin configuration control. Avoid conflicts between the RolloutManager CR and config map. Simplify plugin management by allowing easy addition, removal, or modification of plugins without editing the config map directly. The traffic management plugin controls how traffic routes between different versions of your application during a rollout, while the metric plugin collects and evaluates metrics to determine the success or failure of a rollout. 7.1. Prerequisites You have logged in to the OpenShift Container Platform cluster as an administrator. You have access to the OpenShift Container Platform web console. You have installed Red Hat OpenShift GitOps on your OpenShift Container Platform cluster. You have installed Argo Rollouts on your OpenShift Container Platform cluster. 7.2. Enabling traffic management and metric plugins in Argo Rollouts To enable traffic management and metric plugins in Argo Rollouts, complete the following steps. Procedure Log in to the OpenShift Container Platform web console as a cluster administrator. In the Administrator perspective, click Operators Installed Operators . Create or select the project where you want to create and configure a RolloutManager custom resource (CR) from the Project drop-down menu. Select Red Hat OpenShift GitOps from the Installed Operators . In the Details tab, under the Provided APIs section, click Create instance in the RolloutManager pane. On the Create RolloutManager page, select the YAML view and edit the YAML. Example adding the traffic management and metric plugins configuration in the RolloutManager CR apiVersion: argoproj.io/v1alpha1 kind: RolloutManager metadata: name: argo-rollouts spec: plugins: trafficManagement: - name: argoproj-labs/gatewayAPI 1 location: https://github.com/sample-metric-plugin 2 metric: - name: argoproj-labs/sample-prometheus 3 location: https://github.com/sample-trafficrouter-plugin 4 sha256: dac10cbf57633c9832a17f8c27d2ca34aa97dd3d 5 1 Specifies the name of the trafficManagement plugin. 2 Specifies the location of the trafficManagement plugin. 3 Specifies the name of the metric plugin. 4 Specifies the location of the metric plugin. 5 Optional: Specifies the SHA256 signature of the plugin binary, which is downloaded and installed by the Rollouts controller. Click Create . In the RolloutManager tab, under the RolloutManagers section, verify that the Status field of the RolloutManager instance shows as Phase: Available . Verify that the traffic management and metric plugins are installed correctly by completing the following steps: In the Administrator perspective, click Workloads ConfigMaps . Click the argo-rollouts-config config map. As a result, the plugins defined in the RolloutManager CR are updated in the argo-rollouts-config config map. Example updated traffic management and metric plugins in the argo-rollouts-config ConfigMap kind: ConfigMap apiVersion: v1 metadata: name: argo-rollouts-config namespace: argo-rollouts labels: app.kubernetes.io/component: argo-rollouts app.kubernetes.io/name: argo-rollouts app.kubernetes.io/part-of: argo-rollouts data: metricPlugins: | - name: "argoproj-labs/sample-prometheus" 1 location: https://github.com/sample-metric-plugin 2 sha256: dac10cbf57633c9832a17f8c27d2ca34aa97dd3d 3 trafficRouterPlugins: | - name: argoproj-labs/gatewayAPI 4 location: https://github.com/sample-metric-plugin 5 sha256: "" 6 - name: argoproj-labs/openshift 7 location: file:/plugins/rollouts-trafficrouter-openshift/openshift-route-plugin 8 sha256: "" 9 1 Specifies the name of the metric plugin. 2 Specifies the location of the metric plugin. 3 Specifies the sha256 signature of the metric plugin. 4 Specifies the name of the trafficmanagement plugin. 5 Specifies the location of the trafficmanagement plugin. 6 Specifies the sha256 signature of the trafficmanagement plugin. 7 Specifies the name of the default trafficmanagement plugin. 8 Specifies the location of the default trafficmanagement plugin. 9 Specifies the sha256 signature of the trafficmanagement plugin. By configuring traffic and metric plugins directly through the RolloutManager CR, you streamline the rollout process, reduce the chance of errors, and ensure consistent plugin management across your environment. This enhances control and flexibility while simplifying deployment procedures. 7.3. Additional resources Traffic router plugin Metric plugin

Commands:
apiVersion: argoproj.io/v1alpha1 kind: RolloutManager metadata: name: argo-rollouts spec: plugins: trafficManagement: - name: argoproj-labs/gatewayAPI 1 location: https://github.com/sample-metric-plugin 2 metric: - name: argoproj-labs/sample-prometheus 3 location: https://github.com/sample-trafficrouter-plugin 4 sha256: dac10cbf57633c9832a17f8c27d2ca34aa97dd3d 5
kind: ConfigMap apiVersion: v1 metadata: name: argo-rollouts-config namespace: argo-rollouts labels: app.kubernetes.io/component: argo-rollouts app.kubernetes.io/name: argo-rollouts app.kubernetes.io/part-of: argo-rollouts data: metricPlugins: | - name: "argoproj-labs/sample-prometheus" 1 location: https://github.com/sample-metric-plugin 2 sha256: dac10cbf57633c9832a17f8c27d2ca34aa97dd3d 3 trafficRouterPlugins: | - name: argoproj-labs/gatewayAPI 4 location: https://github.com/sample-metric-plugin 5 sha256: "" 6 - name: argoproj-labs/openshift 7 location: file:/plugins/rollouts-trafficrouter-openshift/openshift-route-plugin 8 sha256: "" 9