KOP Recipes - Kube Prometheus Stack - Rafay Product Documentation

Configure

In this part, you will

Step 1: Create Addons

In this step, you will

Create Namespaces

We will deploy our addons to a namespace called "prometheus" and "ingress-nginx"

Create Kube Prometheus Stack Addon

## We only care about values from k8s v1.15 and higher
#
kubeTargetVersionOverride: "1.15.12"

## Retain data for 7 days with max local storage of 10GB backed by a PVC
#
prometheus:
  prometheusSpec:
    retention: 7d
    retentionsize: 10G
  storageSpec:
    volumeClaimTemplate:
      spec:
        storage: 10Gi

## Do not use default dashboards. Specify the ones that are actually useful
## Add the required annotations for Ingress and Cert-Manager
#
grafana:
  defaultDashboardsEnabled: false
  adminPassword: "Password!23!"
  dashboards:
    default:
      kubernetes-cluster:
        gnetId: 12206
        datasource: Prometheus
      kubernetes-nodes:
        gnetId: 12133
        datasource: Prometheus
      kubernetes-pods:
        gnetId: 12128
        datasource: Prometheus
      kubernetes-node-exporter:
        gnetId: 12132
        datasource: Prometheus
      kubernetes-compute-namespace-pods:
        gnetId: 12117
        datasource: Prometheus
      kubernetes-api-server:
        gnetId: 12116
        datasource: Prometheus
      kubernetes-kubelet:
        gnetId: 12123
        datasource: Prometheus
      kubernetes-compute-cluster:
        gnetId: 12114
        datasource: Prometheus
  dashboardProviders:
    dashboardproviders.yaml:
      apiVersion: 1
      providers:
        - name: default
          orgId: 1
          folder:
          type: file
          disableDeletion: true
          editable: false
          options:
            path: /var/lib/grafana/dashboards/default
  ingress:
    enabled: true
    annotations:
      kubernetes.io/ingress.class: nginx
    hosts:
       - grafana.dev.rafay-edge.net
    path: /
    tls:
    - secretName: grafana-dev-tls
      hosts:
       - grafana.dev.rafay-edge.net

Create Nginx Ingress Controller Addon

Step 2: Create Blueprint

In this step, you will

Step 3: Create Kubernetes Secret

kubectl create secret tls grafana-dev-tls --key="cert-key.pem" --cert="cert.pem" -n prometheus
secret/grafana-dev-tls created

Step 4: Apply Blueprint

Now, we are ready to apply the newly created, custom blueprint to our EKS cluster.

In a few minutes, all the k8s resources matching the custom cluster blueprint will become operational on the cluster. Notice that the cluster's blueprint name and version match what you created in the prior step.

Step 5: Verify Setup

Optionally, to verify if Prometheus is able to remote write to the AMP workspace

Next Steps

You are now ready to move on to the next part of the recipe where you will access and visualize the time series data using Grafana.