DEV Community

Cover image for Deploying ArgoCD on an Azure Kubernetes Cluster for GitOps
Lester Diaz Perez
Lester Diaz Perez

Posted on

Deploying ArgoCD on an Azure Kubernetes Cluster for GitOps

Azure Kubernetes Service (AKS) Cluster Setup ☸️

This document outlines the steps to create an Azure Kubernetes Service (AKS) cluster.

1. Prerequisites: Equipping Your Toolkit 🛠️

Before you begin, ensure you have:

Time to create your AKS cluster.

  1. Sign in to Azure Portal: Navigate to portal.azure.com 🔑.
  2. Search for AKS: In the search bar, type "Azure Kubernetes Service" and select it 🔍.

Image description

  1. Initiate Cluster Creation: Click "Create" and then "Create Kubernetes cluster" ✨.
  2. Configure Basic Settings ⚙️:
    • Project details: Select your Azure subscription and resource group 📂.
    • Cluster details:
      • Kubernetes cluster name: Enter a unique name for your cluster 🏷️.
      • Region: Choose the Azure region for your cluster 🌍.
      • Availability zones: Select zones for high availability if needed 🏞️.
      • AKS pricing tier: Standard is recommended for production 💰.
      • Kubernetes version: Choose a recent, stable version ✅.
    • Primary node pool:
      • Node size: Select an appropriate VM size 🖥️. Standard_B2s is a good starting point for dev/test. For production, consider Standard_D2s_v3.
      • Scale method: Choose "Autoscale" for flexibility ⚖️.
      • Node count: Set the initial number of nodes #️⃣.

Image description
.

  1. Review and Create: Carefully review all settings 👀. Once confirmed, click "Create". Cluster deployment may take several minutes ⏳. (Perfect time for a coffee! ☕)

3. Connect to Your AKS Cluster: Establishing Communication 🔮

After the cluster is deployed, connect to it.

  1. Install Azure CLI (if not already done):
    Ensure Azure CLI is installed 💻.
    Verify installation:

    az --version
    
  2. Login to Azure 🔑:

    az login
    

    Follow the prompts to authenticate.

  3. Get Cluster Credentials 📜:
    This command configures kubectl.

    az aks get-credentials --resource-group <your-resource-group> --name <your-cluster-name>
    
  4. Verify Connection ✅:
    Check if your nodes are ready.

    kubectl get nodes
    

    You should see your nodes listed with a Ready status.

    NAME                                STATUS   ROLES   AGE     VERSION
    aks-systempool-12345678-vmss000000   Ready    agent   5m16s   v1.28.5
    aks-systempool-12345678-vmss000001   Ready    agent   5m17s   v1.28.5
    

4. Install ArgoCD using Helm: Your GitOps Companion 🧙‍♂️⛵📦

ArgoCD will manage your deployments based on your Git repository.

  1. Add ArgoCD Helm Repository ➕:

    helm repo add argo https://argoproj.github.io/argo-helm
    
  2. Update Helm Repositories 🔄:

    helm repo update
    
  3. Install ArgoCD 🚀:
    This installs ArgoCD into the argocd namespace.

    helm install argocd argo/argo-cd --namespace argocd --create-namespace
    
  4. Access ArgoCD UI (via Port Forwarding) 🖥️➡️🚪:
    Access the ArgoCD dashboard.

    kubectl get pods -n argocd
    # Wait for argocd-server to be Running
    kubectl port-forward svc/argocd-server -n argocd 8080:https
    

Image description
Open https://localhost:8080 in your browser.

  1. Get Initial Admin Password 🤫🔑:
    "Keep it secret, keep it safe!" (Okay, just one for the road! 😉)

    kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d; echo
    

5. Next Steps: The Journey Continues... ➡️👣

Your AKS and ArgoCD setup is complete!

  • Connect Git repositories to ArgoCD 🔗.
  • Define applications for ArgoCD to manage 📝.

Top comments (0)