Argo Rollouts Setup on Kubernetes

Argo Rollouts Setup on Kubernetes

- 5 mins

Setting Up and Using Argo Rollouts on Kubernetes

Introduction

Argo Rollouts is an open-source tool for Kubernetes designed to enable advanced deployment strategies like blue-green and canary deployments. While Kubernetes offers native rolling update mechanisms, they have limitations such as restricted control over rollout speed and traffic distribution. Argo Rollouts overcomes these constraints, giving you greater flexibility and control over deployments.

In this article, we’ll cover the setup of Argo Rollouts and demonstrate how to use it for deploying applications.


Workflow of Argo Rollouts

Argo Rollouts integrates with tools like Ingress Controllers, Argo CD for visualization, and Prometheus for monitoring. Below is an explanation of its workflow:

  1. An application is already running in the cluster.
  2. To initiate a rollout, update the image or configuration in the manifest file.
  3. Argo Rollouts deploys the updated version alongside the existing version.
  4. Traffic is gradually shifted from the old to the new version based on the strategy defined in the manifest.
  5. The Ingress Controller manages traffic routing, while Prometheus collects metrics during the rollout process.

Installing Argo Rollouts

Prerequisites

Installation Steps

To keep Argo Rollouts isolated, create a dedicated namespace:

kubectl create namespace argo-rollouts

Step 2: Install Argo Rollouts

argo

Step 3: Install the Argo Rollouts Plugin (Linux-amd64) for kubectl

argo


Deploying Applications with Argo Rollouts

Step 1: Deploy the Initial Application

  1. Create the Manifest File
  2. Create a file named nginx-rollouts.yaml with the following content:
apiVersion: argoproj.io/v1alpha1
kind: Rollout
metadata:
  name: nginx-rollout
  namespace: default
spec:
  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx-container
        image: nginx:1.24-alpine
        ports:
        - containerPort: 80
  strategy:
    canary:
      steps:
      - setWeight: 20
      - pause: {duration: 10}
      - setWeight: 50
      - pause: {duration: 10}
      - setWeight: 70
      - pause: {duration: 10}
      - setWeight: 100
  1. Apply the Manifest File
    kubectl apply -f nginx-rollouts.yaml
    
  2. Monitor the Rollout
    kubectl argo rollouts get rollout nginx-rollout --watch
    

argo

Step 2: Roll Out a New Version

  1. Update the Manifest File, Edit the nginx-rollouts.yaml file to update the nginx container image to the latest version:
    image: nginx:latest
    
  2. Apply the Updated Manifest File
    kubectl apply -f nginx-rollouts.yaml
    
  3. Monitor the Rollout
    kubectl argo rollouts get rollout nginx-rollout --watch
    

argo


Using the Argo Rollouts Dashboard

argo

argo

argo


Conclusion

By following these steps, you can install Argo Rollouts, set up the kubectl plugin, and deploy applications using advanced strategies like Canary. With features like traffic control and monitoring, Argo Rollouts ensures reliable and flexible application deployments.



Thanks for reading…





:+1: :+1: :+1: :+1: :+1: :+1: :+1: :+1:


Guneycan Sanli.


Guneycan Sanli

Guneycan Sanli

A person who like learning, music, travelling and sports.

comments powered by Disqus