This post is part of “Progressive Delivery” series.
- Introduction to Progressive Delivery
- Practical Progressive Delivery with Argo Rollouts - Setup (this post)
- Practical Progressive Delivery with Argo Rollouts - BlueGreen
- Practical Progressive Delivery with Argo Rollouts - Canary
- Practical Progressive Delivery with Argo Rollouts - Auto rollback with metrics
Table of Contents:
- Background
- What is Argo Rollouts
- Prerequisite
- Install Argo Rollouts
- Install Argo Rollouts Kubectl plugin
- Install NGINX ingress
- Deploy a basic Argo Rollouts demo
- Conclusion
Background
I talked about Progressive Delivery in detail in my previous post. To complete the picture, we will need to get our hands on. This post will guide you to setup Argo Rollouts, one of a Progressive Delivery software.
What is Argo Rollouts
Argo Rollouts is a cloud native software that can control software deployment on Kubernetes cluster. It extends the concept of a core Kubernetes resource “Deployment” that only support a “rolling update deployment”. Argo Rollouts supports more deployment approaches such as BlueGreen and Canary deployments (Learn more about these deployment here).
Next, we will learn how to setup Argo Rollouts.
Prerequisite
- We need a Kubernetes cluster. This post assume that you followed this post to setup a K3s-based Kubernetes cluster.
- Helm installed
- kubectl installed
Install Argo Rollouts
Run these commands to install Argo Rollouts helm chart.
kubectl create namespace argo-rollouts
kubectl apply -n argo-rollouts \
-f https://raw.githubusercontent.com/argoproj/argo-rollouts/stable/manifests/install.yaml
Note.
- we will install Argo Rollouts controllers in the namespace “argo-rollouts”
Install Argo Rollouts Kubectl plugin
Argo Rollouts Kubectl plugin enables us to run rollouts specific command using kubectl cli such as open the dashboard UI. This will make our life easier interacting with Rollouts.
Run.
curl -LO https://github.com/argoproj/argo-rollouts/releases/latest/download/kubectl-argo-rollouts-darwin-amd64
chmod +x ./kubectl-argo-rollouts-darwin-amd64
sudo mv ./kubectl-argo-rollouts-darwin-amd64 /usr/local/bin/kubectl-argo-rollouts
# verify
kubectl argo rollouts version
Note.
This plugin will be used later to open Argo Rollouts Dashboard.
Argo Rollouts dashboard can visualize current state of the deployment and enable use to take rollouts actions directly from the UI.
Install NGINX ingress
To access Argo Rollouts demo application in the cluster, we need an ingress. This post will use NGINX ingress controller which is a popular ingress for Kubernetes.
helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm repo update
kubectl create namespace ingress-nginx
helm upgrade -i -n ingress-nginx ingress-nginx ingress-nginx/ingress-nginx \
--set controller.metrics.enabled=true \
--set controller.metrics.serviceMonitor.enabled=true
Note.
- “controller.metrics.enabled=true” and “controller.metrics.serviceMonitor.enabled=true” are used to enable Prometheus metrics scraping endpoint (we need it for automatic rollback and can be skipped for now)
- we will install nginx-ingress in namespace “ingress-nginx”
Deploy a basic Argo Rollouts demo
Clone this repository to your computer.
git clone https://github.com/pongsatt/k3s-argo-rollouts.git
cd k3s-argo-rollouts
Install a demo rollout.
kubectl apply -f ./basic-rollouts-demo
Note.
This command will install.
- rollout.yaml. A rollout resource named “basic-rollouts-demo” which will install image “argoproj/rollouts-demo:blue” to the cluster.
- service.yaml. A kubernetes service named “basic-rollouts-demo” that enables the access to “basic-rollouts-demo” application.
- ingress.yaml. A NGINX ingress that enables access to “basic-rollouts-demo” service from the browser outside the cluster (using http://basic-rollouts-demo.192.168.1.61.nip.io).
Run this command to start Argo Rollouts dashboard.
kubectl argo rollouts dashboard
Open http://localhost:3100 to see the dashboard.
Dashboard UI shows 5 instances of basic-rollouts-demo application started successfully
Open url http://basic-rollouts-demo.192.168.1.61.nip.io to open “basic-rollouts-demo” application and you should see.
Argo Rollouts Demo Application showing “blue” version
Note.
“192.168.1.61” in the url is the Kubernetes master node IP address (if you create the cluster following this post). Any node IP address will work.
Conclusion
In this post, you learned about Argo Rollouts, how to setup it, and creating a basic rollout application to a Kubernetes cluster. Argo Rollouts has many more features such as Traffic Management and Analysis which I will show you in later posts. Next, BlueGreen deployment.