A machine-readable index of this documentation for AI agents is available at https://kubevela.io/llms.txt. Markdown versions of documentation pages are available by appending .md to their URLs.
Skip to main content

Guide

Prometheus Redis metrics exporter.

Supports Redis 2.x, 3.x, 4.x, 5.x, 6.x, and 7.x

Installation​

vela addon enable redis-exporter

Usage​

Install relevant addons​

If you have already installed the prometheus-server and grafana , please skip these steps to get started.

  1. Install the prometheus-server addon
vela addon enable prometheus-server
  1. Install the grafana addon
vela addon enable grafana
  1. Access your grafana through port-forward
kubectl port-forward svc/grafana -n o11y-system 8080:3000

Now you can access your grafana by access http://localhost:8080 in your browser. The default username and password are admin and kubevela respectively.

You can change it by adding adminUser=super-user adminPassword=PASSWORD to step 3.

Work as a component​

1. Create Redis Instance​

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: redis
namespace: default
spec:
components:
- name: redis
type: helm
properties:
repoType: "helm"
url: "https://charts.bitnami.com/bitnami"
chart: "redis"
version: "17.7.3"
values:
global:
redis:
password: <password>
master:
persistence:
size: 16Gi
replica:
persistence:
size: 16Gi

2. Create Redis Secret​

apiVersion: v1
kind: Secret
metadata:
name: <redis-secret-name>
data:
username: <username-bash64> # default: ""
password: <password-bash64> # default: password in base64

3. Create Redis Exporter Server​

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: redis
namespace: default
spec:
components:
- type: redis-exporter-server
name: redis-exporter
properties:
address: <host>:<port>
secretName: <redis-secret-name>
disableAnnotation: false
name: redis-server-exporter
traits:
- type: prometheus-scrape
properties:
port: <port>
path: /metrics
workflow:
steps:
- type: deploy
name: deploy-redis-exporter
properties:
policies: []
- type: import-grafana-dashboard
name: import-redis-exporter-dashboard
properties:
uid: redis-exporter-dashboard
title: Redis Exporter Dashboard
url: https://cdn.cncfstack.com/raw.githubusercontent.com/oliver006/redis_exporter/master/contrib/grafana_prometheus_redis_dashboard.json

Work as a trait.​

1. Create Redis Secret​

apiVersion: v1
kind: Secret
metadata:
name: <redis-secret-name>
data:
username: <username-bash64> # default: ""
password: <password-bash64> # default: password in base64

2. Create Redis Instance​

apiVersion: core.oam.dev/v1beta1
kind: Application
metadata:
name: redis
namespace: default
spec:
components:
- type: helm
name: redis
properties:
repoType: "helm"
url: "https://charts.bitnami.com/bitnami"
chart: "redis"
version: "17.7.3"
values:
global:
redis:
password: <password>
master:
persistence:
size: 16Gi
replica:
persistence:
size: 16Gi
traits:
- type: redis-exporter
properties:
address: <host>:<port>
secretName: <redis-secret-name>
disableAnnotation: false
name: redis-server-exporter
- type: prometheus-scrape
properties:
port: <port>
path: /metrics
workflow:
steps:
- type: deploy
name: deploy-redis-exporter
properties:
policies: []
- type: import-grafana-dashboard
name: import-redis-exporter-dashboard
properties:
uid: redis-exporter-dashboard
title: Redis Exporter Dashboard
url: https://cdn.cncfstack.com/raw.githubusercontent.com/oliver006/redis_exporter/master/contrib/grafana_prometheus_redis_dashboard.json

Grafana Dashboard​

You can choose to install Grafana in the Kubernetes cluster manually, or use Grafana in a simple way by installing the Grafana addon of KubeVela. And then you can use dashboard to visualize the metrics.

Example Grafana screenshots:

Grafana dashboard is available on grafana.com and/or github.com.