This directory contains the Ansible playbooks and roles required to bootstrap the DevConnect EKS cluster and configure ArgoCD for GitOps.
The architecture is built on the GitOps methodology.
- GitHub Actions (CI): Builds application code changes, creates Docker images, pushes them to Docker Hub, and updates the manifests repository with the new image tag.
- ArgoCD (CD): Continuously monitors the Kubernetes manifests repo. Once it detects a change made by the CI pipeline, it automatically pulls and deploys those changes to the EKS Cluster.
These Ansible playbooks set up the control node environment and bootstrap the cluster for ArgoCD.
- An active AWS EKS Cluster (configured previously via Terraform).
- Proper IAM credentials on the control machine to manage the EKS cluster.
- Ansible installed on the control machine (
sudo apt install ansible -y). - Make sure
kubernetespython module is installed:pip3 install kubernetes.
Open inventory/hosts.ini and update the variables under the [eks_admin:vars] section with your actual details:
aws_region: AWS Region of your EKS cluster.cluster_name: Name of your EKS cluster.argocd_repo_url: URL of the GitHub repo containing your Kubernetes manifests.app_namespace: Custom namespace for your DevConnect app.
Make sure you run these from the ansible-devconnect directory.
This will install aws-cli, kubectl, helm, and eksctl locally on the control machine.
ansible-playbook playbooks/install-tools.yml --ask-become-passThis fetches the kubeconfig to allow local kubectl to talk to EKS, and sets up required namespaces (devconnect and argocd).
ansible-playbook playbooks/setup-kubectl.ymlThis installs ArgoCD via Helm, sets the service type to LoadBalancer, retrieves the admin password dynamically, and finally registers your GitOps Repository Application.
ansible-playbook playbooks/install-argocd.yml(Check the output of this playbook. It will display the ArgoCD LoadBalancer URL and initial admin password.)
ArgoCD will automatically start syncing exactly 3 minutes after the Application is registered. You can run this playbook to attempt a manual sync if you have the argocd CLI installed, though it's not strictly necessary.
ansible-playbook playbooks/deploy-app.yml