diff --git a/keydb/Chart.yaml b/keydb/Chart.yaml index 9e552cd..b5940d1 100644 --- a/keydb/Chart.yaml +++ b/keydb/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: keydb description: A Helm chart for KeyDB multimaster setup type: application -version: 0.28.4 +version: 0.29.0 keywords: - keydb - redis diff --git a/keydb/README.md b/keydb/README.md index 396f68d..cdcb1d4 100644 --- a/keydb/README.md +++ b/keydb/README.md @@ -13,6 +13,41 @@ helm install keydb enapter/keydb This chart bootstraps a [KeyDB](https://keydb.dev) highly available multi-master statefulset in a [Kubernetes](http://kubernetes.io) cluster using the Helm package manager. +## 0.29.0 Upgrade notice + +As the chart is not yet production ready (0.x) backward incompatible changes can be introduced in minor releases. +Since 0.29.0 `configExtraArgs` and `exporter.extraArgs` are now arrays of dicts in order to allow repeating arguments with the same key. +If dict value is an array it is interpreted as multiple arguments for the key. + +### Config Example: + +``` +configExtraArgs: + - client-output-buffer-limit: ["normal", "0", "0", "0"] + - client-output-buffer-limit: ["replica", "268435456", "67108864", "60"] + - client-output-buffer-limit: ["pubsub", "33554432", "8388608", "60"] + - save: ~ + - tcp-backlog "1024" +``` + +### Resulting File: + +``` +... + +exec keydb-server /etc/keydb/redis.conf \ + + ... + + --client-output-buffer-limit "normal" "0" "0" "0" \ + --client-output-buffer-limit "replica" "268435456" "67108864" "60" \ + --client-output-buffer-limit "pubsub" "33554432" "8388608" "60" \ + --save \ + --tcp-backlog "1024" \ + + ... +``` + ## Prerequisites - PV provisioner support in the underlying infrastructure if you want to enable persistence @@ -43,7 +78,7 @@ The following table lists the configurable parameters of the KeyDB chart and the | `activeReplicas` | KeyDB active replication setup | `yes` | | `protectedMode` | KeyDB protection mode | `no` | | `appendonly` | KeyDB appendonly setting | `no` | -| `configExtraArgs` | Additional configuration arguments for KeyDB | `{}` | +| `configExtraArgs` | Additional configuration arguments for KeyDB | `[]` | | `annotations` | KeyDB StatefulSet annotations | `{}` | | `podAnnotations` | KeyDB pods annotations | `{}` | | `tolerations` | KeyDB tolerations setting | `{}` | @@ -57,6 +92,7 @@ The following table lists the configurable parameters of the KeyDB chart and the | `startupProbe.custom` | Custom StartupProbe for KeyDB pods | `{}` | | `persistentVolume.enabled` | Should PVC be created via volumeClaimTemplates | `true` | | `persistentVolume.accessModes` | Volume access modes | `[ReadWriteOnce]` | +| `persistentVolume.selector` | PVC selector. (In order to match existing PVs) | `{}` | | `persistentVolume.size` | Size of the volume | `1Gi` | | `persistentVolume.storageClass` | StorageClassName for volume | `` | | `resources` | Resources for KeyDB containers | `{}` | @@ -80,7 +116,7 @@ The following table lists the configurable parameters of the KeyDB chart and the | `exporter.readinessProbe` | ReadinessProbe for sidecar Prometheus exporter | Look values.yaml | | `exporter.startupProbe` | StartupProbe for sidecar Prometheus exporter | Look values.yaml | | `exporter.resources` | Resources for sidecar Prometheus container | `{}` | -| `exporter.extraArgs` | Additional arguments for exporter | `{}` | +| `exporter.extraArgs` | Additional arguments for exporter | `[]` | ## Using existingSecret diff --git a/keydb/templates/secret-utils.yaml b/keydb/templates/secret-utils.yaml index 9d78c7d..6b987f3 100644 --- a/keydb/templates/secret-utils.yaml +++ b/keydb/templates/secret-utils.yaml @@ -26,18 +26,22 @@ stringData: --port "${port}" \ --protected-mode {{ .Values.protectedMode | quote }} \ --server-threads {{ .Values.threads | quote }} \ -{{- if .Values.existingSecret }} + {{- if .Values.existingSecret }} --masterauth "${REDIS_PASSWORD}" \ --requirepass "${REDIS_PASSWORD}" \ -{{- else if .Values.password }} + {{- else if .Values.password }} --masterauth {{ .Values.password | quote }} \ --requirepass {{ .Values.password | quote }} \ -{{- end }} - {{- range $key, $value := .Values.configExtraArgs }} - {{- if not (kindIs "invalid" $value) }} - --{{ $key }} {{ $value | quote }} \ - {{- else }} + {{- end }} + {{- range $item := .Values.configExtraArgs }} + {{- range $key, $value := $item }} + {{- if kindIs "invalid" $value }} --{{ $key }} \ + {{- else if kindIs "slice" $value }} + --{{ $key }}{{ range $value }} {{ . | quote }}{{ end }} \ + {{- else }} + --{{ $key }} {{ $value | quote }} \ + {{- end }} + {{- end }} {{- end }} - {{- end }} "${replicas[@]}" diff --git a/keydb/templates/sts.yaml b/keydb/templates/sts.yaml index ac00e57..eb1884c 100644 --- a/keydb/templates/sts.yaml +++ b/keydb/templates/sts.yaml @@ -146,8 +146,16 @@ spec: image: {{ .Values.exporter.image }} imagePullPolicy: {{ .Values.exporter.pullPolicy }} args: - {{- range $key, $value := .Values.exporter.extraArgs }} - - --{{ $key }}={{ $value }} + {{- range $item := .Values.exporter.extraArgs }} + {{- range $key, $value := $item }} + {{- if kindIs "invalid" $value }} + --{{ $key }} \ + {{- else if kindIs "slice" $value }} + --{{ $key }}{{ range $value }} {{ . | quote }}{{ end }} \ + {{- else }} + --{{ $key }} {{ $value | quote }} \ + {{- end }} + {{- end }} {{- end }} env: - name: REDIS_ADDR @@ -263,4 +271,8 @@ spec: storageClassName: {{ .Values.persistentVolume.storageClass }} {{- end }} {{- end }} + {{- if .Values.persistentVolume.selector }} + selector: + {{- toYaml .Values.persistentVolume.selector | nindent 8 }} + {{- end }} {{- end }} diff --git a/keydb/values.yaml b/keydb/values.yaml index a37b957..f070b5e 100644 --- a/keydb/values.yaml +++ b/keydb/values.yaml @@ -20,7 +20,11 @@ appendonly: "no" annotations: {} -configExtraArgs: {} +configExtraArgs: [] + # - somesimple: "argument" + # - client-output-buffer-limit: ["normal", "0", "0", "0"] + # - client-output-buffer-limit: ["replica", "268435456", "67108864", "60"] + # - client-output-buffer-limit: ["pubsub", "33554432", "8388608", "60"] podAnnotations: {} @@ -107,6 +111,11 @@ persistentVolume: enabled: true accessModes: - ReadWriteOnce + selector: {} + # matchLabels: + # release: "stable" + # matchExpressions: + # - {key: environment, operator: In, values: [dev]} size: 1Gi ## If defined, storageClassName: @@ -187,7 +196,11 @@ exporter: resources: {} # Additional args for redis exporter - extraArgs: {} + extraArgs: [] + # - somesimple: "argument" + # - client-output-buffer-limit: ["normal", "0", "0", "0"] + # - client-output-buffer-limit: ["replica", "268435456", "67108864", "60"] + # - client-output-buffer-limit: ["pubsub", "33554432", "8388608", "60"] scripts: enabled: false