Skip to content
This repository has been archived by the owner on Jun 6, 2023. It is now read-only.

Commit

Permalink
keydb: 0.11.0
Browse files Browse the repository at this point in the history
* Add Prometheus exporter sidecar container
  • Loading branch information
Antiarchitect committed Jun 29, 2020
1 parent 9258a0f commit 5d41df9
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 43 deletions.
2 changes: 1 addition & 1 deletion keydb/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: keydb
description: A Helm chart for KeyDB multimaster setup
type: application
version: 0.10.1
version: 0.11.0
keywords:
- keydb
- redis
Expand Down
53 changes: 31 additions & 22 deletions keydb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,25 +30,34 @@ helm install keydb enapter/keydb

The following table lists the configurable parameters of the KeyDB chart and their default values.

| Parameter | Description | Default |
|:--------------------------------|:------------------------------------------------|:------------------------------|
| `image` | KeyDB docker image | `eqalpha/keydb:x86_64_v5.3.3` |
| `imagePullPolicy` | K8s imagePullPolicy | `IfNotPresent` |
| `nodes` | Number of KeyDB master pods | `3` |
| `password` | If enabled KeyDB servers are password-protected | `""` |
| `port` | KeyDB service port clients connect to | `6379` |
| `threads` | KeyDB server-threads per node | `2` |
| `appendonly` | KeyDB appendonly setting | `"no"` |
| `persistentVolume.enabled` | Should PVC be created via volumeClaimTemplates | `true` |
| `persistentVolume.accessModes` | Volume access modes | `[ReadWriteOnce]` |
| `persistentVolume.size` | Size of the volume | `1Gi` |
| `persistentVolume.storageClass` | StorageClassName for volume | `` |
| `configExtraArgs` | Additional configuration arguments for KeyDB | `{}` |
| `resources` | K8s Resources for KeyDB containers | `{}` |
| `securityContext` | K8s SecurityContext for KeyDB pods | `{}` |
| `loadBalancer.enabled` | Create LoadBalancer service | `false` |
| `loadBalancer.annotations` | Annotations for LB | `{}` |
| `loadBalancer.extraSpec` | Additional spec for LB | `{}` |
| `additionalAffinities` | Additional affinities for StatefulSet | `{}` |
| `livenessProbe` | LivenessProbe for StatefulSet | Look values.yaml |
| `readinessProbe` | ReadinessProbe for StatefulSet | Look values.yaml |
| Parameter | Description | Default |
|:--------------------------------|:------------------------------------------------|:-----------------------------------------|
| `image` | KeyDB docker image | `eqalpha/keydb:x86_64_v5.3.3` |
| `imagePullPolicy` | K8s imagePullPolicy | `IfNotPresent` |
| `nodes` | Number of KeyDB master pods | `3` |
| `password` | If enabled KeyDB servers are password-protected | `""` |
| `port` | KeyDB service port clients connect to | `6379` |
| `threads` | KeyDB server-threads per node | `2` |
| `appendonly` | KeyDB appendonly setting | `"no"` |
| `persistentVolume.enabled` | Should PVC be created via volumeClaimTemplates | `true` |
| `persistentVolume.accessModes` | Volume access modes | `[ReadWriteOnce]` |
| `persistentVolume.size` | Size of the volume | `1Gi` |
| `persistentVolume.storageClass` | StorageClassName for volume | `` |
| `configExtraArgs` | Additional configuration arguments for KeyDB | `{}` |
| `resources` | Resources for KeyDB containers | `{}` |
| `securityContext` | SecurityContext for KeyDB pods | `{}` |
| `loadBalancer.enabled` | Create LoadBalancer service | `false` |
| `loadBalancer.annotations` | Annotations for LB | `{}` |
| `loadBalancer.extraSpec` | Additional spec for LB | `{}` |
| `additionalAffinities` | Additional affinities for StatefulSet | `{}` |
| `livenessProbe` | LivenessProbe for StatefulSet | Look values.yaml |
| `readinessProbe` | ReadinessProbe for StatefulSet | Look values.yaml |
| `exporter.enabled` | Prometheus Exporter sidecar contaner | `false` |
| `exporter.image` | Exporter Image | `oliver006/redis_exporter:v1.8.0-alpine` |
| `exporter.pullPolicy` | Exporter imagePullPolicy | `IfNotPresent` |
| `exporter.port` | `prometheus.io/port` | `9121` |
| `exporter.scrapePath` | `prometheus.io/path` | `/metrics` |
| `exporter.livenessProbe` | LivenessProbe for sidecar Prometheus exporter | Look values.yaml |
| `exporter.readinessProbe` | ReadinessProbe for sidecar Prometheus exporter | Look values.yaml |
| `exporter.resources` | Resources for sidecar Prometheus container | `{}` |
| `exporter.extraArgs` | Additional arguments for exporter | `{}` |
21 changes: 11 additions & 10 deletions keydb/templates/sts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ spec:
annotations:
checksum/secret-utils: {{ include (print $.Template.BasePath "/secret-utils.yaml") . | sha256sum }}
{{- if .Values.exporter.enabled }}
prometheus.io/port: "{{ .Values.exporter.port }}"
prometheus.io/scrape: "{{ .Values.exporter.scrape }}"
prometheus.io/scrape: "true"
prometheus.io/path: "{{ .Values.exporter.scrapePath }}"
prometheus.io/port: "{{ .Values.exporter.port }}"
{{- end }}
labels:
{{ include "keydb.labels" . | indent 8 }}
Expand Down Expand Up @@ -69,26 +69,27 @@ spec:
readOnly: true
{{- if .Values.exporter.enabled }}
- name: redis-exporter
image: "{{ .Values.exporter.image }}:{{ .Values.exporter.tag }}"
image: {{ .Values.exporter.image }}
imagePullPolicy: {{ .Values.exporter.pullPolicy }}
args:
{{- range $key, $value := .Values.exporter.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
env:
- name: REDIS_ADDR
value: redis://{{ default "localhost" .Values.exporter.address }}:{{ .Values.port }}
value: redis://localhost:6379
{{- if .Values.password }}
- name: REDIS_PASSWORD
value: "{{ .Values.password }}"
{{- end }}
{{- if .Values.exporter.livenessProbe }}
livenessProbe:
httpGet:
path: {{ .Values.exporter.scrapePath }}
port: {{ .Values.exporter.port }}
initialDelaySeconds: 10
timeoutSeconds: 1
periodSeconds: 15
{{ toYaml .Values.exporter.livenessProbe | indent 10 }}
{{- end }}
{{- if .Values.exporter.readinessProbe }}
readinessProbe:
{{ toYaml .Values.exporter.readinessProbe | indent 10 }}
{{- end }}
resources:
{{ toYaml .Values.exporter.resources | indent 10 }}
ports:
Expand Down
29 changes: 19 additions & 10 deletions keydb/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,30 @@ readinessProbe:

# Redis exporter
exporter:
enabled: true
image: oliver006/redis_exporter
tag: v1.8.0-alpine
enabled: false
image: oliver006/redis_exporter:v1.8.0-alpine
pullPolicy: IfNotPresent

# prometheus port & scrape path
scrape: true
# Prometheus port & scrape path
port: 9121
scrapePath: /metrics

# Address/Host for Redis instance.
address: localhost

# cpu/memory resource limits/requests
# Liveness Probe
livenessProbe:
httpGet:
path: /metrics
port: 9121
initialDelaySeconds: 15

# Readiness Probe
readinessProbe:
httpGet:
path: /metrics
port: 9121
initialDelaySeconds: 10

# CPU/Memory resource limits/requests
resources: {}

# Additional args for redis exporter
extraArgs: {}
extraArgs: {}

0 comments on commit 5d41df9

Please sign in to comment.