Table of Contents
The product owners are all about the new buzz word: GitOps! For this project, I will create a new Kubernetes cluster on AWS, deploy a monitoring tool using Helm chart and go everything the GitOps way.
The end goal, provide a demonstration on how you are committing a code in your source control and the changes will be deployed to the infrastructure without manual intervention.
This section should list any major frameworks/libraries used to bootstrap my project.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
This is an example of how to list things you need to use the software and how to install them.
- terraform
brew tap hashicorp/tap brew install hashicorp/tap/terraform
- helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 chmod 700 get_helm.sh ./get_helm.sh
-
Fork the repo
-
Configure "Secrets"
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY KUBE_CONFIG_DATA (cat $HOME/.kube/config | base64)
-
Open terraform cloud account, create TF_API_TOKEN- https://app.terraform.io/app/settings/tokens
Create environment variables of aws:
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
Add Secret "TF_API_TOKEN" in your github repo settings.
-
Make a commit and push it , A github actions pipeline should now apply your Infrastructure
-
Configure kubectl with aws:
aws eks update-kubeconfig --region region-code --name cluster-name
-
After helm deployment test UI of Grafana/Prometheus/ Alertmanager
kubectl port-forward deployment/monitoring-grafana 3000 kubectl port-forward svc/prometheus-k8s 9090 kubectl port-forward svc/alertmanager-main 9093 user: admin password: prom-operator
Every change you wish to make should be in eks/env/variables.tfvars file just change the values as you want.