Argo CD Bootstrap for K3s Cluster

Argo CD Bootstrap for K3s Cluster

This repository bootstraps a GitOps-based deployment for a K3s cluster using Argo CD. It includes:

  • Ansible playbook to install and configure Argo CD.
  • GitOps folder structure to manage cluster applications declaratively.
  • Initial setup of core infrastructure apps like NGINX Ingress Controller and Sealed Secrets.

πŸ“ Repository Structure

.
β”œβ”€β”€ ansible
β”‚   β”œβ”€β”€ ansible.cfg                  # Local Ansible config
β”‚   β”œβ”€β”€ playbooks
β”‚   β”‚   └── setup-argocd.yml         # Entry point to install Argo CD
β”‚   └── roles
β”‚       └── argocd
β”‚           └── tasks
β”‚               └── main.yml         # Tasks to install Argo CD via kubectl
β”œβ”€β”€ bootstrap
β”‚   └── root-application.yaml        # Argo CD root Application to manage everything
└── clusters
    └── k3s                          # Folder for the 'k3s' cluster
        └── infra
            β”œβ”€β”€ argocd
            β”‚   β”œβ”€β”€ application.yaml
            β”‚   └── values.yaml      # Self managed ArgoCD
            └── sealed-secrets
                β”œβ”€β”€ application.yaml
                └── values.yaml      # Sealed Secrets controller via Helm


πŸš€ Getting Started

  1. Provision your cluster (separate Terraform repo)
    • Set up an OCI VM and install K3s (already handled separately).
  2. Install Argo CD
    • Run the Ansible playbook:
    ansible-playbook -i <inventory> ansible/playbooks/setup-argocd.yml
    
  3. Bootstrap GitOps
    • Once Argo CD is running, it will automatically sync bootstrap/root-application.yaml.
    • This sets up core infrastructure via Helm-based Argo CD Applications.

πŸ“ TODO

  • Add ExternalDNS + DuckDNS for dynamic subdomain mapping.
  • Add Dex for SSO login to Argo CD.
  • Configure Argo CD Ingress with HTTPS via Let’s Encrypt.
  • Add app layer (e.g., whoami, jobwinner).
  • Enable RBAC policies if needed for multi-user environments.

🧠 Notes

  • This repo assumes a single cluster named k3s.
  • All cluster resources (infra/apps) are defined declaratively under clusters/k3s.
  • Secrets should be encrypted using Sealed Secrets.

πŸ”— References