Skip to main content
Loading
Version: Operator 1.x.x

Monitoring

Aerospike Monitoring Stack can be used to enable monitoring and alerting for Aerospike clusters deployed by the Aerospike Kubernetes Operator.

Add Aerospike Prometheus Exporter Sidecar

Add the exporter as a sidecar to each Aerospike server pod using the PodSpec configuration. For example,

spec:
.
.
.

podSpec:
sidecars:
- name: aerospike-prometheus-exporter
image: "aerospike/aerospike-prometheus-exporter:v1.9.0"
ports:
- containerPort: 9145
name: exporter

.
.
.

Deploy or Update Aerospike Cluster (Custom Resource)

Create or update your clusters once the Prometheus exporter sidecar is added.

Prometheus Configuration

Configure Prometheus to add exporter endpoints as scrape targets.

If Prometheus is also running on Kubernetes, it can be configured to extract exporter targets from Kubernetes API.

In the following example, Prometheus will be able to discover and add exporter targets in default namespace which has endpoint port name as aerospike-prometheus-exporter.

scrape_configs:
- job_name: 'aerospike'

kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- default
relabel_configs:
- source_labels: [__meta_kubernetes_pod_container_port_name]
separator: ;
regex: exporter
replacement: $1
action: keep

See Aerospike Monitoring Stack for its installation, configuration and setup guide.

Quick Example

This example demonstrates monitoring of Aerospike clusters deployed by Kubernetes Operator using Aerospike Monitoring Stack.

  1. Add Aerospike helm repository

    helm repo add aerospike https://aerospike.github.io/aerospike-kubernetes-enterprise
  2. Deploy Aerospike Kubernetes Operator using helm chart

    helm install operator aerospike/aerospike-kubernetes-operator --set replicas=1
  3. Create a Kubernetes secret to store Aerospike license feature key file

    kubectl create secret generic aerospike-license --from-file=<path-to-features.conf-file>
  4. Deploy Aerospike cluster with Aerospike Prometheus Exporter sidecar

    cat << EOF | helm install aerospike aerospike/aerospike-cluster \
    --set devMode=true \
    --set aerospikeSecretName=aerospike-license \
    -f -
    podSpec:
    sidecars:
    - name: aerospike-prometheus-exporter
    image: "aerospike/aerospike-prometheus-exporter:v1.9.0"
    ports:
    - containerPort: 9145
    name: exporter
    EOF
  5. Deploy Prometheus-Grafana Stack using aerospike-monitoring-stack.yaml

    kubectl apply -f ./aerospike-monitoring-stack.yaml
  6. Connect to Grafana dashboard,

    kubectl port-forward service/aerospike-monitoring-stack-grafana 3000:80

    Open localhost:3000 in browser, and login to Grafana as admin/admin.

  7. Import dashboards from Aerospike Monitoring GitHub Repo and visualise metrics.