From fdd270f325d057f55b6aff7d3fdd55bb340ca4c2 Mon Sep 17 00:00:00 2001 From: Florian Boulanger Date: Fri, 21 Mar 2025 09:32:35 +0100 Subject: [PATCH 1/2] feature: add annotation to haproxy deployment Signed-off-by: Florian Boulanger fboulanger51@gmail.com --- charts/redis-ha/Chart.yaml | 2 +- charts/redis-ha/README.md | 19 +++++++++++-------- .../templates/redis-haproxy-deployment.yaml | 6 ++++-- charts/redis-ha/values.yaml | 7 +++++++ 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/charts/redis-ha/Chart.yaml b/charts/redis-ha/Chart.yaml index 0fca5433..724781a3 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.33.4 +version: 4.33.6 appVersion: 7.2.7 description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management icon: https://upload.wikimedia.org/wikipedia/en/thumb/6/6b/Redis_Logo.svg/1200px-Redis_Logo.svg.png diff --git a/charts/redis-ha/README.md b/charts/redis-ha/README.md index 584d76a7..a02392cf 100644 --- a/charts/redis-ha/README.md +++ b/charts/redis-ha/README.md @@ -90,7 +90,7 @@ The following table lists the configurable parameters of the Redis chart and the | `imagePullSecrets` | Reference to one or more secrets to be used when pulling redis images | list | `[]` | | `init.resources` | Extra init resources | object | `{}` | | `labels` | Custom labels for the redis pod | object | `{}` | -| `nameOverride` | Name override for Redis HA resources | string | `""` | +| `nameOverride` | Name override for Redis HA resources | string | `""` | | `networkPolicy.annotations` | Annotations for NetworkPolicy | object | `{}` | | `networkPolicy.egressRules` | user can define egress rules too, uses the same structure as ingressRules | list | `[{"ports":[{"port":53,"protocol":"UDP"},{"port":53,"protocol":"TCP"}],"selectors":[{"namespaceSelector":{}},{"ipBlock":{"cidr":"169.254.0.0/16"}}]}]` | | `networkPolicy.egressRules[0].selectors[0]` | Allow all destinations for DNS traffic | object | `{"namespaceSelector":{}}` | @@ -131,6 +131,7 @@ The following table lists the configurable parameters of the Redis chart and the | `redis.livenessProbe.successThreshold` | Success threshold for liveness probe | int | `1` | | `redis.livenessProbe.timeoutSeconds` | Timeout seconds for liveness probe | int | `15` | | `redis.masterGroupName` | Redis convention for naming the cluster group: must match `^[\\w-\\.]+$` and can be templated | string | `"mymaster"` | +| `redis.podAnnotations` | Annotations to be added to the redis statefulset pods | object | `{}` | | `redis.port` | Port to access the redis service | int | `6379` | | `redis.readinessProbe` | Readiness probe parameters for redis container | object | `{"enabled":true,"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | | `redis.readinessProbe.enabled` | Enable the Readiness Probe | bool | `true` | @@ -140,11 +141,11 @@ The following table lists the configurable parameters of the Redis chart and the | `redis.readinessProbe.successThreshold` | Success threshold for readiness probe | int | `1` | | `redis.readinessProbe.timeoutSeconds` | Timeout seconds for readiness probe | int | `15` | | `redis.resources` | CPU/Memory for master/slave nodes resource requests/limits | object | `{}` | -| `redis.startupProbe` | Startup probe parameters for redis container | object | `{"enabled":true,"failureThreshold":3,"initialDelaySeconds":5,"periodSeconds":10,"successThreshold":1,"timeoutSeconds":15}` | +| `redis.startupProbe` | Startup probe parameters for redis container | object | `{"enabled":true,"failureThreshold":5,"initialDelaySeconds":30,"periodSeconds":15,"successThreshold":1,"timeoutSeconds":15}` | | `redis.startupProbe.enabled` | Enable Startup Probe | bool | `true` | -| `redis.startupProbe.failureThreshold` | Failure threshold for startup probe | int | `3` | -| `redis.startupProbe.initialDelaySeconds` | Initial delay in seconds for startup probe | int | `5` | -| `redis.startupProbe.periodSeconds` | Period in seconds after which startup probe will be repeated | int | `10` | +| `redis.startupProbe.failureThreshold` | Failure threshold for startup probe | int | `5` | +| `redis.startupProbe.initialDelaySeconds` | Initial delay in seconds for startup probe | int | `30` | +| `redis.startupProbe.periodSeconds` | Period in seconds after which startup probe will be repeated | int | `15` | | `redis.startupProbe.successThreshold` | Success threshold for startup probe | int | `1` | | `redis.startupProbe.timeoutSeconds` | Timeout seconds for startup probe | int | `15` | | `redis.terminationGracePeriodSeconds` | Increase terminationGracePeriodSeconds to allow writing large RDB snapshots. (k8s default is 30s) ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination-forced | int | `60` | @@ -154,6 +155,7 @@ The following table lists the configurable parameters of the Redis chart and the | `redisPassword` | A password that configures a `requirepass` and `masterauth` in the conf parameters (Requires `auth: enabled`) | string | `nil` | | `replicas` | Number of redis master/slave | int | `3` | | `restore.existingSecret` | Set existingSecret to true to use secret specified in existingSecret above | bool | `false` | +| `restore.redis.source` | | string | `""` | | `restore.s3.access_key` | Restore init container - AWS AWS_ACCESS_KEY_ID to access restore.s3.source | string | `""` | | `restore.s3.region` | Restore init container - AWS AWS_REGION to access restore.s3.source | string | `""` | | `restore.s3.secret_key` | Restore init container - AWS AWS_SECRET_ACCESS_KEY to access restore.s3.source | string | `""` | @@ -248,7 +250,7 @@ The following table lists the configurable parameters of the Redis chart and the | `haproxy.hardAntiAffinity` | Whether the haproxy pods should be forced to run on separate nodes. | bool | `true` | | `haproxy.image.pullPolicy` | HAProxy Image PullPolicy | string | `"IfNotPresent"` | | `haproxy.image.repository` | HAProxy Image Repository | string | `"public.ecr.aws/docker/library/haproxy"` | -| `haproxy.image.tag` | HAProxy Image Tag | string | `"2.9.4-alpine"` | +| `haproxy.image.tag` | HAProxy Image Tag | string | `"3.0.8-alpine"` | | `haproxy.imagePullSecrets` | Reference to one or more secrets to be used when pulling images ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ | list | `[]` | | `haproxy.init.resources` | Extra init resources | object | `{}` | | `haproxy.labels` | Custom labels for the haproxy pod | object | `{}` | @@ -270,6 +272,7 @@ The following table lists the configurable parameters of the Redis chart and the | `haproxy.networkPolicy.enabled` | whether NetworkPolicy for Haproxy should be created | bool | `false` | | `haproxy.networkPolicy.ingressRules` | user defined ingress rules that Haproxy should permit into. uses the format defined in https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#label-selectors | list | `[]` | | `haproxy.networkPolicy.labels` | Labels for Haproxy NetworkPolicy | object | `{}` | +| `haproxy.podAnnotations` | Annotations to be added to the HAProxy deployment pods | object | `{}` | | `haproxy.podDisruptionBudget` | Pod Disruption Budget ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ | object | `{}` | | `haproxy.priorityClassName` | Kubernetes priorityClass name for the haproxy pod | string | `""` | | `haproxy.readOnly` | Enable read-only redis-slaves | object | `{"enabled":false,"port":6380}` | @@ -309,7 +312,7 @@ The following table lists the configurable parameters of the Redis chart and the | `exporter.address` | Address/Host for Redis instance. Exists to circumvent issues with IPv6 dns resolution that occurs on certain environments | string | `"localhost"` | | `exporter.enabled` | If `true`, the prometheus exporter sidecar is enabled | bool | `false` | | `exporter.extraArgs` | Additional args for redis exporter | object | `{}` | -| `exporter.image` | Exporter image | string | `"oliver006/redis_exporter"` | +| `exporter.image` | Exporter image | string | `"quay.io/oliver006/redis_exporter"` | | `exporter.livenessProbe.httpGet.path` | Exporter liveness probe httpGet path | string | `"/metrics"` | | `exporter.livenessProbe.httpGet.port` | Exporter liveness probe httpGet port | int | `9121` | | `exporter.livenessProbe.initialDelaySeconds` | Initial delay in seconds for liveness probe of exporter | int | `15` | @@ -335,7 +338,7 @@ The following table lists the configurable parameters of the Redis chart and the | `exporter.serviceMonitor.namespace` | Set the namespace the ServiceMonitor should be deployed | string | `.Release.Namespace` | | `exporter.serviceMonitor.telemetryPath` | Set path to redis-exporter telemtery-path (default is /metrics) | string | `""` | | `exporter.serviceMonitor.timeout` | Set timeout for scrape (default is 10s) | string | `""` | -| `exporter.tag` | Exporter image tag | string | `"v1.57.0"` | +| `exporter.tag` | Exporter image tag | string | `"v1.67.0"` | | `prometheusRule.additionalLabels` | Additional labels to be set in metadata. | object | `{}` | | `prometheusRule.enabled` | If true, creates a Prometheus Operator PrometheusRule. | bool | `false` | | `prometheusRule.interval` | How often rules in the group are evaluated (falls back to `global.evaluation_interval` if not set). | string | `"10s"` | diff --git a/charts/redis-ha/templates/redis-haproxy-deployment.yaml b/charts/redis-ha/templates/redis-haproxy-deployment.yaml index 07677fcd..609828d8 100644 --- a/charts/redis-ha/templates/redis-haproxy-deployment.yaml +++ b/charts/redis-ha/templates/redis-haproxy-deployment.yaml @@ -9,6 +9,8 @@ metadata: {{- range $key, $value := .Values.extraLabels }} {{ $key }}: {{ $value | quote }} {{- end }} + annotations: +{{ toYaml .Values.haproxy.annotations | indent 4 }} spec: {{- with .Values.haproxy.deploymentStrategy }} strategy: @@ -39,8 +41,8 @@ spec: prometheus.io/path: "{{ .Values.haproxy.metrics.scrapePath }}" {{- end }} checksum/config: {{ print (include "config-haproxy.cfg" .) (include "config-haproxy_init.sh" .) | sha256sum }} - {{- if .Values.haproxy.annotations }} -{{ toYaml .Values.haproxy.annotations | indent 8 }} + {{- if .Values.haproxy.podAnnotations }} +{{ toYaml .Values.haproxy.podAnnotations | indent 8 }} {{- end }} spec: # Needed when using unmodified rbac-setup.yml diff --git a/charts/redis-ha/values.yaml b/charts/redis-ha/values.yaml index 93386495..7e38ba3e 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -141,6 +141,10 @@ haproxy: # -- HAProxy template annotations annotations: {} + + # -- Annotations to be added to the HAProxy deployment pods + podAnnotations: {} + # -- HAProxy resources resources: {} # -- Configuration of `emptyDir` @@ -477,6 +481,9 @@ redis: # -- Annotations for the redis statefulset annotations: {} + # -- Annotations to be added to the redis statefulset pods + podAnnotations: {} + # -- Update strategy for Redis StatefulSet ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies updateStrategy: From 8a05284d01df69e8a5627e0f89668d3cd85aa843 Mon Sep 17 00:00:00 2001 From: Aaron Layfield Date: Sat, 13 Sep 2025 09:15:51 +0900 Subject: [PATCH 2/2] feat(redis-ha): update chart version to 4.34.9 and add pod annotations support for HAProxy deployment Signed-off-by: Aaron Layfield --- charts/redis-ha/Chart.yaml | 2 +- charts/redis-ha/values.yaml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/redis-ha/Chart.yaml b/charts/redis-ha/Chart.yaml index bc6d7d11..e61de51a 100644 --- a/charts/redis-ha/Chart.yaml +++ b/charts/redis-ha/Chart.yaml @@ -5,7 +5,7 @@ keywords: - redis - keyvalue - database -version: 4.34.8 +version: 4.34.9 appVersion: 8.2.1 description: This Helm chart provides a highly available Redis implementation with a master/slave configuration and uses Sentinel sidecars for failover management icon: https://img.icons8.com/external-tal-revivo-shadow-tal-revivo/24/external-redis-an-in-memory-data-structure-project-implementing-a-distributed-logo-shadow-tal-revivo.png diff --git a/charts/redis-ha/values.yaml b/charts/redis-ha/values.yaml index c696ff44..84e8eb9d 100644 --- a/charts/redis-ha/values.yaml +++ b/charts/redis-ha/values.yaml @@ -145,8 +145,12 @@ haproxy: # -- HAProxy deployment annotations deploymentAnnotations: {} + # -- Annotations to be added to the HAProxy deployment pods + podAnnotations: {} + # -- HAProxy resources resources: {} + # -- Configuration of `emptyDir` emptyDir: {}