Projects

Production work, personal experiments, and open-source tools — with full setup instructions.

Zero-downtime deployment pipeline

Blue-green deployments on EKS using ArgoCD and GitHub Actions. Average deploy in under 4 minutes with instant rollback.

2024
live
GitHub ActionsEKSArgoCDHelmAWS ECR
Setup Instructions
  1. Prerequisites
    AWS CLI v2, kubectl, Helm 3, and ArgoCD CLI installed. EKS cluster running with at least 2 node groups (blue and green).
  2. Clone the repo and configure secrets
    git clone https://github.com/sujanmagar/eks-blue-green
    cd eks-blue-green
    # Add to GitHub repo secrets:
    AWS_ACCESS_KEY_ID
    AWS_SECRET_ACCESS_KEY
    ECR_REGISTRY
    KUBECONFIG_BASE64
  3. Install ArgoCD on your cluster
    kubectl create namespace argocd
    kubectl apply -n argocd -f \
      https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
    # Get initial admin password
    argocd admin initial-password -n argocd
  4. Apply Helm chart and ArgoCD app manifest
    helm upgrade --install myapp ./chart \
      --namespace production \
      --set image.tag=latest
    
    kubectl apply -f argocd/application.yaml
  5. Push to main to trigger pipeline
    The GitHub Actions workflow builds the Docker image, pushes to ECR, updates the Helm values file, and ArgoCD auto-syncs the deployment to the cluster. Rollback is one click in the ArgoCD UI.

Multi-region IaC module library

Reusable Terraform modules for AWS provisioning across three regions. DR failover under 60 seconds.

2023
live
TerraformAWSRoute53RDSVPC
Setup Instructions
  1. Install Terraform and configure AWS provider
    # terraform >= 1.5.0 required
    brew install terraform
    aws configure  # set default region to ap-south-1
  2. Clone and initialise
    git clone https://github.com/sujanmagar/tf-multiregion
    cd tf-multiregion
    terraform init
  3. Edit variables for your environment
    cp terraform.tfvars.example terraform.tfvars
    # Set your domain, account ID, and region list
    regions      = ["ap-south-1", "us-east-1", "eu-west-1"]
    domain_name  = "sujanmagar.info.np"
  4. Plan and apply
    terraform plan -out=tfplan
    terraform apply tfplan

Centralised observability stack

Prometheus, Grafana, and Loki on Kubernetes. Covers metrics, logs, and alerting for all production services.

2023
wip
PrometheusGrafanaLokiPagerDutyKubernetes
Setup Instructions
  1. Add Helm repos
    helm repo add prometheus-community \
      https://prometheus-community.github.io/helm-charts
    helm repo add grafana https://grafana.github.io/helm-charts
    helm repo update
  2. Install kube-prometheus-stack
    kubectl create namespace monitoring
    helm install prom-stack \
      prometheus-community/kube-prometheus-stack \
      -n monitoring \
      -f values/prometheus-values.yaml
  3. Install Loki + Promtail
    helm install loki grafana/loki-stack \
      -n monitoring \
      --set promtail.enabled=true \
      --set grafana.enabled=false
  4. Configure PagerDuty alerting
    Edit values/alertmanager-values.yaml with your PagerDuty integration key. Alerts are pre-configured for pod crashes, high CPU, and failed deployments.
  5. Access Grafana
    kubectl port-forward svc/prom-stack-grafana 3000:80 -n monitoring
    # Open http://localhost:3000 — default user: admin