Voiced by Amazon Polly |
Introduction
Continuous Deployment (CD) is a critical part of modern DevOps practices, enabling organizations to deliver updates quickly, reliably, and with minimal downtime. ArgoCD, a declarative GitOps continuous delivery tool for Kubernetes, provides advanced deployment strategies, including Canary Rollouts, to achieve safer and more controlled updates to your applications. Canary deployment involves gradually rolling out changes to a small subset of users before a full release, allowing for quick rollback in case of issues.
This blog explores ArgoCD’s Rollout Canary feature, its popularity, implementation steps, and FAQs for a smooth adoption process.
Pioneers in Cloud Consulting & Migration Services
- Reduced infrastructural costs
- Accelerated application deployment
Why is ArgoCD Rollout Canary Popular?
ArgoCD Rollout Canary is widely adopted because of its ability to automate deployments, integrate seamlessly with Kubernetes, and adhere to GitOps principles. By keeping Git as the single source of truth, it ensures consistency, auditability, and transparency in deployments. It supports progressive delivery, where incremental updates are rolled out, minimizing risks and exposure to failure. Furthermore, integrating with monitoring tools makes rollouts metrics-driven, enabling teams to make informed decisions about promotion or rollback. Canary Rollouts begin by routing a small portion of traffic to the new version while monitoring its performance. If the application behaves as expected, more traffic is gradually routed to the new version. If issues arise, the rollout is paused or rolled back to the previous stable state, ensuring minimal disruption.
Steps to Implement ArgoCD Rollout Canary
- Download the AWS CLI installer:
1 |
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" |
2. Install the unzip utility (if not already installed):
1 |
apt install unzip |
3. Extract the installer package:
1 |
sudo unzip awscliv2.zip |
4. Run the installation script:
1 |
sudo ./aws/install |
5. Verify the installation by checking the AWS CLI version:
1 |
aws --version |
Steps to Install eksctl
- Download the latest release and extract it in one command:
1 |
curl --silent --location "https://github.com/weaveworks/eksctl/releases/latest/download/eksctl_$(uname -s)_amd64.tar.gz" | tar xz -C /tmp |
2. Move the extracted binary to a directory in your system’s PATH:
1 |
sudo mv /tmp/eksctl /usr/local/bin |
3. Verify the installation by checking the eksctl version:
1 |
eksctl version |
Steps to Install kubectl
- Download the kubectl binary and place it in /usr/local/bin:
1 |
sudo curl --silent --location -o /usr/local/bin/kubectl https://s3.us-west-2.amazonaws.com/amazon-eks/1.22.6/2022-03-09/bin/linux/amd64/kubectl |
2. Make the binary executable:
1 |
sudo chmod +x /usr/local/bin/kubectl |
3. Verify the installation by checking the kubectl version:
1 |
kubectl version --short –client |
4. Check for the updated kubeconfig
1 |
aws eks update-kubeconfig --name demo-eks --region ap-south-1 |
Installing and Configuring ArgoCD
- Add the ArgoCD Helm Repository
1 |
helm repo add argo-cd https://argoproj.github.io/argo-helm |
2. Install ArgoCD Using Helm
1 |
helm install argocd argo-cd/argo-cd |
3. Verify the ArgoCD Deployment and Services
Check the status of the ArgoCD deployment and services:
1 2 |
kubectl get deployment kubectl get svc |
4. Expose the ArgoCD API Server
By default, the ArgoCD API Server is not accessible externally. To expose it using a Load Balancer, run:
1 |
kubectl patch svc argocd-server -p '{"spec": {"type": "LoadBalancer"}}' |
5. Access the ArgoCD Service
Retrieve the EXTERNAL-IP of the argocd-server service:
- Copy the EXTERNAL-IP and open it in a browser.
- If you encounter a security warning, click Advanced and then Proceed to <IP>.
- Log in to ArgoCD
At the login page:
- Username: admin
- Password: Retrieve the initial admin password with this command:
1 |
kubectl get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo |
- Copy the generated password and log in.
- Connect a Repository
Navigate to Settings > Repositories and follow these steps:
- Click the Connect Repo Using HTTPS button.
- Enter your repository credentials and click Connect.
- Create an Application
After connecting the repository, click Create Application to set up your first deployment.
ArgoCD Manifest files:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
rollout.yaml apiVersion: argoproj.io/v1alpha1 kind: Rollout metadata: name: rollouts-demo spec: replicas: 3 selector: matchLabels: app: rollouts-demo strategy: canary: steps: - setWeight: 20 - pause: duration: 2m - setWeight: 40 - pause: duration: 2m - setWeight: 60 - pause: duration: 10s - setWeight: 80 - pause: duration: 10s - setWeight: 100 template: metadata: labels: app: rollouts-demo spec: containers: - name: rollouts-demo image: argoproj/rollouts-demo:green ports: - containerPort: 8080 service.yaml apiVersion: v1 kind: Service metadata: name: rollouts-demo-service spec: selector: app: rollouts-demo ports: - protocol: TCP port: 80 targetPort: 8080 |
Installing Argo CD Rollouts Controller and Kubectl Plugin
Follow these steps to set up the Argo CD Rollouts Controller and install the required kubectl plugin:
- Install the Argo Rollouts Controller
- Create a namespace for Argo Rollouts:
1 |
kubectl create namespace argo-rollouts |
- Apply the installation manifest to deploy the controller:
1 |
kubectl apply -n argo-rollouts -f https://github.com/argoproj/argo-rollouts/releases/latest/download/install.yaml |
- Install the Argo Rollouts Kubectl Plugin
To manage Argo Rollouts, install the kubectl plugin with the following steps:
- Download the plugin binary using curl:
1 |
curl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-darwin-amd64 |
For Linux distributions, replace darwin with linux in the URL.
2. Make the binary executable:
1 |
chmod +x ./kubectl-argo-rollouts-darwin-amd64 |
3. Move the binary to your system’s PATH:
1 |
sudo mv ./kubectl-argo-rollouts-darwin-amd64 /usr/local/bin/kubectl-argo-rollouts |
4. Verify the installation by checking the plugin version:
1 |
kubectl argo rollouts version |
Argo rollout Dashboard
Deploying and Monitoring a Rollout with Argo Rollouts
Once you have configured Argo Rollouts, follow these steps to deploy and monitor your Rollout effectively:
- Apply the Rollout Manifest
Ensure the Rollout configuration in your repository is fixed and up-to-date. Deploy the Rollout by applying the YAML manifest:
1 |
kubectl apply -f rollout.yaml |
- Verify the Rollout Status
To check the progress of your Rollout:
1 |
kubectl get rollout rollouts-demo |
- The status will indicate Progressing or Healthy if the deployment is successful.
- If any issues arise, the status will show as Degraded.
For a detailed status report:
1 |
kubectl describe rollout rollouts-demo |
- Inspect Pods and ReplicaSets
To see the Pods and ReplicaSets being created or updated as part of the Rollout:
1 2 3 |
kubectl get pods kubectl get rs |
- Pods will be updated gradually based on the Canary strategy defined in the Rollout configuration.
- Monitor Canary Deployment Progress
If you have the Argo Rollouts CLI installed, you can get more detailed insights into the deployment progress:
1 2 3 |
kubectl argo rollouts get rollout rollouts-demo kubectl argo rollouts get rollout rollouts-demo --watch |
- This displays weight percentages being applied step by step and shows Pod readiness during the Canary process.
- Test Rollback Mechanism
To test the rollback feature, simulate a failure by introducing a faulty image. Edit the Rollout manifest and update the image tag to a non-existent or invalid value:
image: argoproj/rollouts-demo:invalid
Apply the updated manifest and monitor the Rollout status:
1 |
kubectl argo rollouts get rollout rollouts-demo --watch |
- Observe how the Rollout handles the failure and reverts to a stable version.
Conclusion
By leveraging this approach, teams can enhance their deployment confidence, minimize downtime, and maintain application stability during updates.
Drop a query if you have any questions regarding ArgoCD Rollout Canary and we will get back to you quickly.
Making IT Networks Enterprise-ready – Cloud Management Services
- Accelerated cloud migration
- End-to-end view of the cloud environment
About CloudThat
CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.
CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training Partner, AWS Migration Partner, AWS Data and Analytics Partner, AWS DevOps Competency Partner, AWS GenAI Competency Partner, Amazon QuickSight Service Delivery Partner, Amazon EKS Service Delivery Partner, AWS Microsoft Workload Partners, Amazon EC2 Service Delivery Partner, Amazon ECS Service Delivery Partner, AWS Glue Service Delivery Partner, Amazon Redshift Service Delivery Partner, AWS Control Tower Service Delivery Partner, AWS WAF Service Delivery Partner, Amazon CloudFront and many more.
To get started, go through our Consultancy page and Managed Services Package, CloudThat’s offerings.
FAQs
1. What makes ArgoCD Rollout Canary better than traditional deployments?
ANS: – ArgoCD Rollout Canary ensures a gradual and monitored release process, allowing early detection and rollback of issues, which reduces the risk of deployment failures.
2. Can I integrate custom metrics for canary analysis?
ANS: – Yes, Argo Rollouts supports integration with Prometheus and other monitoring tools for custom metric-based decision-making during rollouts.
WRITTEN BY Deepika N
Deepika N works as a Research Associate - DevOps and holds a Master's in Computer Applications. She is interested in DevOps and technologies. She helps clients to deploy highly available and secured application in AWS. Her hobbies are singing and painting.
Click to Comment