DEV Community

John  Ajera
John Ajera

Posted on

Grafana on EKS – Install and Test

Grafana on EKS – Install and Test

Deploy Grafana via Argo CD on EKS and access it locally with port-forward. The Application manifest includes persistence, Prometheus datasource, and health probes.


1. Overview

What this guide does:

  • Deploys Grafana using the official Helm chart via an Argo CD Application
  • Creates an AppProject and Application for the grafana namespace
  • Configures Prometheus as the default datasource (pre-configured for dashboards)
  • Persists data with EBS-backed PVC
  • Uses port-forward for local access (no ingress required)

Prerequisites:

  • EKS cluster running with kubectl context set
  • Argo CD installed
  • Prometheus installed

2. Prerequisites

Before starting, ensure you have:

  • kubectl configured with context set to your EKS cluster
  • Argo CD installed and syncing Applications
  • Prometheus running (e.g. kube-prometheus-stack-prometheus.kube-prometheus-stack.svc.cluster.local:9090—adjust the datasource URL if yours differs)

3. Install Grafana

Save the manifest below as grafana-application.yaml and apply:

kubectl apply -f grafana-application.yaml
Enter fullscreen mode Exit fullscreen mode

Argo CD will create the Application and sync Grafana (Helm chart). Wait until the Application shows Synced in the Argo CD UI or CLI.

Manifest:

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: platform
  namespace: argocd
spec:
  clusterResourceWhitelist:
    - group: "*"
      kind: "*"
  destinations:
    - namespace: "*"
      server: "*"
  namespaceResourceWhitelist:
    - group: "*"
      kind: "*"
  sourceRepos:
    - "*"
---
apiVersion: v1
kind: Namespace
metadata:
  name: grafana
  labels:
    name: grafana
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: grafana
  namespace: argocd
spec:
  project: platform
  source:
    repoURL: https://grafana.github.io/helm-charts
    chart: grafana
    targetRevision: 7.0.0
    helm:
      values: |
        deploymentStrategy:
          type: Recreate
        persistence:
          enabled: true
          type: pvc
          storageClassName: ebs-sc
          size: 10Gi
        service:
          type: ClusterIP
        adminUser: admin
        datasources:
          datasources.yaml:
            apiVersion: 1
            datasources:
              - name: Prometheus
                type: prometheus
                access: proxy
                url: http://kube-prometheus-stack-prometheus.kube-prometheus-stack.svc.cluster.local:9090
                isDefault: true
                editable: true
        resources:
          limits:
            cpu: 500m
            memory: 512Mi
          requests:
            cpu: 250m
            memory: 256Mi
        startupProbe:
          httpGet:
            path: /api/health
            port: 3000
          periodSeconds: 5
          failureThreshold: 18
        readinessProbe:
          httpGet:
            path: /api/health
            port: 3000
          periodSeconds: 10
          failureThreshold: 3
        livenessProbe:
          httpGet:
            path: /api/health
            port: 3000
          initialDelaySeconds: 30
          periodSeconds: 10
          failureThreshold: 10
  destination:
    server: https://kubernetes.default.svc
    namespace: grafana
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
Enter fullscreen mode Exit fullscreen mode

Note: Adjust storageClassName if your EKS cluster uses a different EBS storage class. Ensure Prometheus URL matches your install (e.g. kube-prometheus-stack-prometheus.kube-prometheus-stack.svc.cluster.local:9090).


4. Test Access

Port-forward

kubectl port-forward svc/grafana -n grafana 3000:80
Enter fullscreen mode Exit fullscreen mode

Get admin password

kubectl get secret grafana -n grafana -o jsonpath="{.data.admin-password}" | base64 -d
echo
Enter fullscreen mode Exit fullscreen mode

Login

Open http://localhost:3000 and sign in with admin and the password from above.

Verify datasource

Go to ConnectionsData sources. Prometheus should be configured and ready. Create a dashboard and run a query to confirm.


5. Summary: Copy-Paste

# 1. Apply manifest
kubectl apply -f grafana-application.yaml

# 2. Wait for sync (check Argo CD UI or: argocd app get grafana)

# 3. Port-forward and get password
kubectl port-forward svc/grafana -n grafana 3000:80 &
kubectl get secret grafana -n grafana -o jsonpath="{.data.admin-password}" | base64 -d && echo
Enter fullscreen mode Exit fullscreen mode

Then open http://localhost:3000 and log in with admin / the password.


6. Troubleshooting

Issue: Application stuck in Syncing or OutOfSync

Solution: Check Argo CD logs and the Application status. Ensure the Grafana Helm repo is reachable and storageClassName: ebs-sc exists in your cluster. If using a different storage class, update the manifest.

Issue: Prometheus datasource connection failed

Solution: Verify Prometheus is running: kubectl get svc -n kube-prometheus-stack (or your Prometheus namespace). Update the url in the manifest to match your Prometheus service.

Issue: Argo CD ingress stuck or inaccessible

Solution: See Argo CD Ingress Stuck – Find & Fix for troubleshooting steps.


7. References

Top comments (0)