Create Azure Resources Step 1 Create Resource Group :- az group create \ --name gitops \ --location east us Step 2 Create ACR:- az acr create \ --resource-group gitops \ --name avadhootacr001 \ --sku Basic Step 3 Create AKS:- az aks create \ --resource-group rg-gitops-demo \ --name gitops-aks \ --node-count 2 \ --enable-managed-identity \ --attach-acr gitopsacr001 \ --generate-ssh-keys Please don’t forget to connect AKS with ACR other wise you will get image crash backoff error. To connect an AKS cluster with an Azure Container Registry (ACR) so AKS can pull images without image pull secrets: Command :- az aks update \ --resource-group \ --name \ --attach-acr Step 4 Connect AKS az aks get-credentials \ --resource-group rg-gitops-demo \ --name gitops-aks Verify:- kubectl get nodes Phase 4: Install ArgoCD Create Namespace in AKS:- kubectl create namespace argocd Install:- kubectl apply -n argocd \ -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml Verify:- kubectl get pods -n argocd Expose ArgoCD:- kubectl port-forward svc/argocd-server \ -n argocd 8080:443 Open:- https://localhost:8080 For next step please vist my website BY default, Admin is the user’s name so you need to create password by below using command for login in Argo CD UI Password :- kubectl get secret argocd-initial-admin-secret \ -n argocd \ -o jsonpath="{.data.password}" | base64 -d Phase 5: Install NGINX Ingress:- helm repo add ingress-nginx \ https://kubernetes.github.io/ingress-nginx helm repo update:- helm install nginx-ingress \ ingress-nginx/ingress-nginx \ -n ingress-nginx \ --create-namespace Verify:- kubectl get svc -n ingress-nginx Phase 6: Install Metrics Server Required for HPA:- kubectl apply -f \ https://github.com/kubernetes-sigs/metrics server/releases/latest/download/components.yaml Check:- kubectl top nodes Phase 7: Install Prometheus + Grafana:- copy hole command & paste Add Repo helm repo add prometheus-community \ https://prometheus-community.github.io/helm-charts Install helm install monitoring \ prometheus-community/kube-prometheus-stack \ -n monitoring \ --create-namespace NOTES: kube-prometheus-stack has been installed. Check its status by running: kubectl --namespace monitoring get pods -l "release=monitoring" Get Grafana Password Username: admin Password: to get the password enter the given command kubectl --namespace monitoring get secrets monitoring-grafana -o jsonpath="{.data.admin-password}" | base64 -d Access Grafana local instance by Port forward: You can any of the command for Port Forwarding:- kubectl port-forward svc/monitoring-grafana 3000:80 -n monitoring Open browser:- http://localhost:3000 get the next steps on my website Verify: - kubectl get pods -n monitoring Phase 9: Build Container by CI-CD to build and push the image in ACR Get the given value mention in table to connect your pipeline to ACR and push the image in ACR. These GitHub Secrets are required so GitHub Actions can authenticate with Azure and ACR. Add Secrets to GitHub Open your repository: GitHub Repository ↓ Settings ↓ Secrets and Variables ↓ Actions ↓ New Repository Secret Create these 4 secrets: Secret Name value AZURE_CREDENTIALS | Entire Service Principal JSON ACR_NAME | gitopsacr001 ACR_USERNAME | gitopsacr001 ACR_PASSWORD | ACR password 1. AZURE_CREDENTIALS Create a Service Principal: az ad sp create-for-rbac \ --name github-sp \ --role Contributor \ --scopes /subscriptions/ \ --json-auth Or: az ad sp create-for-rbac \ --name github-sp \ --role Contributor \ --scopes /subscriptions/ AZURE_CREDENTIALS 2. ACR_NAME Check your ACR name: az acr list --output table 3. ACR_USERNAME Get ACR credentials: az acr credential show \ --name gitopsacr0 GitHub Secret: ACR_USERNAME = gitopsacr001 4. ACR_PASSWORD From the same command: az acr credential show \ --name gitopsacr001 *Add Secrets to GitHub* Open your repository: GitHub Repository ↓ Settings ↓ Secrets and Variables ↓ Actions ↓ New Repository Secret GitHub Repo → Settings → Secrets and variables → Actions → AZURE_CREDENTIALS Phase 13: Test Deployment Check Pods:- kubectl get pods Check Service:- kubectl get svc Check Ingress:- kubectl get ingress Port Forward:- kubectl port-forward svc/enterprise-app 8081:80 Test:- http://localhost:8081