From c4f0ee57f2d03e51e61c8ae912538a9b3ac76db6 Mon Sep 17 00:00:00 2001 From: ljupcovangelski Date: Thu, 26 Jan 2023 14:52:11 +0100 Subject: [PATCH] [#4020] Add Redis as optional tool --- .../charts/tools/charts/redis/Chart.yaml | 5 ++ .../tools/charts/redis/templates/secret.yaml | 9 ++++ .../tools/charts/redis/templates/service.yaml | 15 ++++++ .../charts/redis/templates/statefulset.yaml | 51 +++++++++++++++++++ .../charts/tools/charts/redis/values.yaml | 3 ++ 5 files changed, 83 insertions(+) create mode 100644 infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml create mode 100644 infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml create mode 100644 infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml create mode 100644 infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml create mode 100644 infrastructure/helm-chart/charts/tools/charts/redis/values.yaml diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml new file mode 100644 index 0000000000..7517025eb7 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/Chart.yaml @@ -0,0 +1,5 @@ +apiVersion: v2 +appVersion: "1.0" +description: AKHQ tool for Apache Kafka +name: redis +version: 7.0.8 diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml new file mode 100644 index 0000000000..91cfe45866 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/secret.yaml @@ -0,0 +1,9 @@ +apiVersion: v1 +kind: Secret +metadata: + name: redis + labels: + app.kubernetes.io/name: redis +type: Opaque +data: + redis-password: {{ default (randAlphaNum 32) | b64enc | quote }} diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml new file mode 100644 index 0000000000..6d80b395a9 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: redis + labels: + app: redis +spec: + type: ClusterIP + clusterIP: None + ports: + - name: redis + port: {{ .Values.port }} + targetPort: {{ .Values.port }} + selector: + app: redis diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml new file mode 100644 index 0000000000..42e6eb76d6 --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/templates/statefulset.yaml @@ -0,0 +1,51 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: redis + labels: + app: redis +spec: + replicas: 1 + selector: + matchLabels: + app: redis + serviceName: redis + template: + metadata: + labels: + app: redis + spec: + terminationGracePeriodSeconds: 10 + containers: + - name: redis + image: "redis:{{ .Values.version }}" + imagePullPolicy: "IfNotPresent" + command: + - "redis-server" + env: + - name: REDIS_PASSWORD + valueFrom: + secretKeyRef: + name: redis + key: redis-password + ports: + - name: redis + containerPort: {{ .Values.port }} + livenessProbe: + tcpSocket: + port: {{ .Values.port }} + initialDelaySeconds: 20 + periodSeconds: 10 + timeoutSeconds: 5 + successThreshold: 1 + failureThreshold: 5 + resources: {{ .Values.resources }} + volumeClaimTemplates: + - metadata: + name: redis-data + spec: + accessModes: + - "ReadWriteOnce" + resources: + requests: + storage: "5Gi" diff --git a/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml new file mode 100644 index 0000000000..c995c6573d --- /dev/null +++ b/infrastructure/helm-chart/charts/tools/charts/redis/values.yaml @@ -0,0 +1,3 @@ +version: 7.0.8 +port: 6379 +resources: \ No newline at end of file