-
Install Terraform v0.15.0
-
Install Kubectl
Ensure that you have configure your aws credentials
-
Clone the repository
-
cd into the repository
cd go-httpbin/
The default Terraform values are in infra/terraform/variable.tf .
By default the script deploys the infrastructure in us-west-1
you can change this in this file
- Run the command below to deploy the vpc and the kubernetes cluster . Ensure you have configured your AWS credentials
./deploy.sh deploy-infra
- To update your kubeconfig file run
./deploy.sh update-kubeconfig
- Run the command below to deploy ArgoCD server on the kubernetes cluster that was deployed in the step 1
./deploy.sh deploy-argocd
- After ensuring that the ArgoCD pods are runining, run the command below to deploy ArgoCD application.
./deploy.sh deploy-argocd-app
If you clone this repository into your own account update the repoUrl section in the infra/argocd/app.yaml
source:
repoURL: https://github.com/ekpangmichael/go-httpbin.git
targetRevision: argocd
path: deployment/charts
- Run the command below to get the default ArgoCD password
./deploy.sh get-argocd-password
- Expose ArgoCD Service
./deploy.sh expose-argocd
The command will expose ArgoCD service on port 8080, use the password you got from step 2 and username admin
to login to ArgoCD GUI.
When you login, you will noticed that ArgoCD has deployed the application automatically, ArgoCD is constantly watching the deployment directory for new changes in the helm chart and this will trigger a new deployment
Note: If you clone this project into your account you need to add the following github secrets
DOCKER_PASSWORD
DOCKER_USERNAME
GIT_EMAIL
GIT_USER
To delete the infrastructure run
./deploy.sh delete-infra
I'm using Github Actions for the CI/CD pipeline, the workflow files can be found in .github/workflows
directory
The following happens when you merged a PR to main branch
- The workflow run the test, lint and build job
- The workflow builds the docker image and upload to Dockerhub
- Creates a new release and update the helm chart with the new image tag
- ArgoCD detects the changes in the helm chart directory and triggers a deployment
ArgoCD Visit here for details.
Terraform: Visit here for details.
Kubernetes: Visit here for details.
Helm: Visit Helm for details