Listen to this Post
In the world of Kubernetes, adopting a GitOps approach is essential for managing production environments efficiently. ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, is a popular choice for this purpose. This article will guide you through setting up ArgoCD with Prometheus and Grafana on Amazon Elastic Kubernetes Service (EKS).
URL:
You Should Know:
1. Prerequisites
Before diving into the setup, ensure you have the following:
– An AWS account with EKS cluster provisioned.
– `kubectl` and `helm` installed on your local machine.
– AWS CLI configured with the necessary permissions.
2. Install ArgoCD using Helm
ArgoCD can be easily installed using Helm. Run the following commands:
<h1>Add the ArgoCD Helm repository</h1> helm repo add argo https://argoproj.github.io/argo-helm <h1>Update the Helm repository</h1> helm repo update <h1>Install ArgoCD in the `argocd` namespace</h1> helm install argocd argo/argo-cd --namespace argocd --create-namespace
3. Access ArgoCD Dashboard
To access the ArgoCD dashboard, port-forward the ArgoCD server service:
kubectl port-forward svc/argocd-server -n argocd 8080:443
Now, open your browser and navigate to https://localhost:8080`. The default username isadmin`, and the password can be retrieved using:
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
4. Set Up Prometheus and Grafana
Monitoring your EKS cluster is crucial. Install Prometheus and Grafana using Helm:
<h1>Add the Prometheus community Helm repository</h1> helm repo add prometheus-community https://prometheus-community.github.io/helm-charts <h1>Install Prometheus</h1> helm install prometheus prometheus-community/prometheus --namespace monitoring --create-namespace <h1>Add the Grafana Helm repository</h1> helm repo add grafana https://grafana.github.io/helm-charts <h1>Install Grafana</h1> helm install grafana grafana/grafana --namespace monitoring
5. Configure ArgoCD to Monitor Applications
ArgoCD can be configured to monitor applications deployed in your cluster. Create an `Application` CRD to sync your application manifests from a Git repository:
apiVersion: argoproj.io/v1alpha1 kind: Application metadata: name: my-app namespace: argocd spec: project: default source: repoURL: https://github.com/myorg/myrepo.git targetRevision: HEAD path: kubernetes/manifests destination: server: https://kubernetes.default.svc namespace: default syncPolicy: automated: prune: true selfHeal: true
Apply the manifest using:
kubectl apply -f application.yaml
What Undercode Say:
Setting up ArgoCD with Prometheus and Grafana on Amazon EKS is a powerful way to manage and monitor your Kubernetes workloads. By following the steps above, you can achieve a robust GitOps workflow that ensures your applications are always in sync with their desired state. Additionally, integrating monitoring tools like Prometheus and Grafana provides visibility into your cluster’s performance and health.
Here are some additional Linux and Kubernetes commands to enhance your setup:
- Check Pod Logs:
kubectl logs <pod-name> -n <namespace>
-
Describe a Pod:
kubectl describe pod <pod-name> -n <namespace>
-
List All Resources in a Namespace:
kubectl get all -n <namespace>
-
Check Node Resource Usage:
kubectl top nodes
-
Restart a Deployment:
kubectl rollout restart deployment/<deployment-name> -n <namespace>
-
Linux Command to Check Disk Space:
df -h
-
Linux Command to Check Memory Usage:
free -m
-
Windows Command to Check Network Connections:
netstat -an
Expected Output:
By the end of this setup, you should have:
1. ArgoCD installed and running in your EKS cluster.
2. Prometheus and Grafana set up for monitoring.
3. Applications synced and managed via GitOps.
- A fully functional Kubernetes environment with continuous delivery and monitoring capabilities.
References:
Reported By: Darryl Ruggles – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅



