Access K8ssandra Monitoring with Traefik

Expose access to your Prometheus and Grafana monitoring interfaces for Apache Cassandra® using Traefik ingress

Follow these steps to configure and install Traefik Ingress custom resources for accessing your K8ssandra cluster’s monitoring interface (provided by Grafana and Prometheus).

Tools

  • Helm

Prerequisites

  1. Kubernetes cluster with the following elements deployed:

    See Configuring Kind for an example of how to set up a local installation.

  2. DNS name for the Grafana service

  3. DNS name for the Prometheus service

Helm Parameters

The k8ssandra Helm chart contains templates for the Traefik IngressRoute custom resource. These may be enabled at any time either through a values.yaml file or command-line flags.

For the latest, see the sample values.yaml.

Note the host parameters in the values.yaml is where the DNS names must be provided.

Enabling Traefik Ingress

Traefik ingress may be enabled on the command-line or via a values.yaml file. The K8ssandra team recommends storing this information in a values.yaml as that may be version controlled and managed in a DevOps friendly manner. Examples of both approaches are provided below as reference.

values.yaml

New install:

helm install cluster-name k8ssandra/k8ssandra -f traefik.values.yaml

Existing cluster:

helm upgrade cluster-name k8ssandra/k8ssandra -f traefik.values.yaml

Command-line

New install:

# New Install
helm install k8ssandra k8ssandra/k8ssandra --set prometheus.ingress.enabled=true,prometheus.ingress.host=localhost
helm install k8ssandra k8ssandra/k8ssandra --set grafana.ingress.enabled=true,grafana.ingress.host=localhost

Existing cluster:

helm upgrade k8ssandra k8ssandra/k8ssandra --set prometheus.ingress.enabled=true,prometheus.ingress.host=localhost
helm upgrade k8ssandra k8ssandra/k8ssandra --set grafana.ingress.enabled=true,grafana.ingress.host=localhost

Validate Traefik Configuration

With the ingress routes configured and deployed to Kubernetes, we can access the Traefik dashboard to validate the configuration has been picked up and is detecting the appropriate services.

  1. Open your web browser and point it at the Traefik dashboard. This may require kubectl port-forward or the steps in our Configuring Kind guide.

    Traefik Dashboard

  2. Navigate to the HTTP Routers page

    Traefik HTTP Routers

    There should be entries representing the hostname based rules created as part of the Helm command. Note the Kubernetes logo to the right of the table indicating it was provisioned via a Kubernetes custom resource.

  3. Navigate to the HTTP Services page

    Traefik HTTP Services

    On this page, you’ll find entries representing the Prometheus and Grafana services. Note the Kubernetes logo to the right of the table indicating that it was provisioned via a Kubernetes custom resource.

Next steps

Feel free to explore the other Traefik ingress topics.

Also, learn how the steps to use the monitoring features in Grafana, which is preconfigured to visualize the Cassandra and related metrics.



Last modified July 22, 2021: Fix links format (#999) (aac72ff)