Cloud Infrastructure Community's Space

AKS #3: Install ArgoCD on AKS cluster

Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes. With ArgoCD, application definitions, configurations, and environments are declarative and version controlled. Application deployment and lifecycle management should be automated, auditable, and easy to understand.

Prerequisites

How to install ArgoCD on your AKS cluster

1. Install CLIs and tools

ArgoCD CLI
# install argocd CLI on Ubuntu 22.04
curl -sSL -o /usr/local/bin/argocd https://github.com/argoproj/argo-cd/releases/latest/download/argocd-linux-amd64  
chmod +x /usr/local/bin/argocd
argocd version --client --short

2. Deploy ArgoCD on your AKS cluster

Before started, make sure you have valid AKS context and configured working context for kubectl.

# get AKS context and configured helm
az aks get-credentials --name $AKS_NAME --resource-group $AKS_RG
kubectl config use-context $AKS_NAME
 

Download argocd install.yaml file from epiHATR/azurekubernetes/install.yaml Create a k8s namespace where ArgoCD will be deployed on.

# create k8s namespace for argocd

kubectl create namespace argocd
kubectl apply -n argocd -f install.yaml

We will create a Ingress rule to allow access ArgoCD server, this require an Application Gateway Ingress Controller enabled on your AKS cluster. Create argocd-server-ingress.yaml file and paste following content:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: argocd-server-ingress
  namespace: argocd
  annotations:
    kubernetes.io/ingress.class: azure/application-gateway
    appgw.ingress.kubernetes.io/backend-protocol: "http"
    appgw.ingress.kubernetes.io/request-timeout: "300"
spec:
  rules:
  - http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: argocd-server
            port:
              number: 80

Run following kubectl apply to deploy ingress to the K8S cluster

# run kubectl apply template
kubectl apply -f argocd-server-ingress.yaml
#
#
# Then check your deployed ingress

3. Login and verify ArgoCD server

After ArgoCD server was deployed to the AKS cluster, we can login to the ArgoCD server. We’ve created a public IP address pointing to your cluster and have an ArgoCD ingress deployed. Let’s use public IP address DNS name and default ArgoCD credentials to login

Get ArgoCD admin password
# grab argocd default password
hostname=$(az network public-ip show -n $PIP_NAME -g $AKS_RG --query ipAddress -o tsv)
password=$(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d)
Login with web browser

Open your browser and type hostname value grabbed from above command. You may asked to provide admin username and password

http://{your public ip address}

Login using ArgoCD Cli
# grab argocd default password
hostname=$(az network public-ip show -n $PIP_NAME -g $AKS_RG --query ipAddress -o tsv)
argocd login "${hostname}" --username admin --password $password

Source code

Source code for this article is now available at epiHATR/azurekubernetes/install_argocd.sh

Leave a Reply

Your email address will not be published. Required fields are marked *

Press ESC to close