diff --git a/packages/apps/redis/Chart.yaml b/packages/apps/redis/Chart.yaml index e02eb3d0..f1666ada 100644 --- a/packages/apps/redis/Chart.yaml +++ b/packages/apps/redis/Chart.yaml @@ -16,7 +16,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.3.1 +version: 0.4.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/packages/apps/redis/README.md b/packages/apps/redis/README.md index 4b3c049c..cc932a05 100644 --- a/packages/apps/redis/README.md +++ b/packages/apps/redis/README.md @@ -19,5 +19,6 @@ Service utilizes the Spotahome Redis Operator for efficient management and orche | `size` | Persistent Volume size | `1Gi` | | `replicas` | Number of Redis replicas | `2` | | `storageClass` | StorageClass used to store the data | `""` | +| `authEnabled` | Enable password generation | `true` | diff --git a/packages/apps/redis/templates/dashboard-resourcemap.yaml b/packages/apps/redis/templates/dashboard-resourcemap.yaml index a0c43508..45958e8f 100644 --- a/packages/apps/redis/templates/dashboard-resourcemap.yaml +++ b/packages/apps/redis/templates/dashboard-resourcemap.yaml @@ -13,3 +13,10 @@ rules: - rfrs-{{ .Release.Name }} - "{{ .Release.Name }}-external-lb" verbs: ["get", "list", "watch"] +- apiGroups: + - "" + resources: + - secrets + resourceNames: + - "{{ .Release.Name }}-auth" + verbs: ["get", "list", "watch"] diff --git a/packages/apps/redis/templates/redisfailover.yaml b/packages/apps/redis/templates/redisfailover.yaml index ca95caa1..0d7c4e03 100644 --- a/packages/apps/redis/templates/redisfailover.yaml +++ b/packages/apps/redis/templates/redisfailover.yaml @@ -1,3 +1,20 @@ +{{- if .Values.authEnabled }} + {{- $existingPassword := lookup "v1" "Secret" .Release.Namespace (printf "%s-auth" .Release.Name) }} + {{- $password := randAlphaNum 32 | b64enc }} + {{- if $existingPassword }} + {{- $password = index $existingPassword.data "password" }} + {{- end }} +--- +apiVersion: v1 +kind: Secret +metadata: + name: {{ .Release.Name }}-auth +data: + password: {{ $password }} +{{- end }} + +--- + apiVersion: databases.spotahome.com/v1 kind: RedisFailover metadata: @@ -52,3 +69,7 @@ spec: - appendonly no - save "" {{- end }} + {{- if .Values.authEnabled }} + auth: + secretPath: {{ .Release.Name }}-auth + {{- end }} diff --git a/packages/apps/redis/values.schema.json b/packages/apps/redis/values.schema.json index f4fdfb7c..aa96f278 100644 --- a/packages/apps/redis/values.schema.json +++ b/packages/apps/redis/values.schema.json @@ -21,6 +21,11 @@ "type": "string", "description": "StorageClass used to store the data", "default": "" + }, + "authEnabled": { + "type": "boolean", + "description": "Enable password generation", + "default": true } } } \ No newline at end of file diff --git a/packages/apps/redis/values.yaml b/packages/apps/redis/values.yaml index 754f695a..a330419d 100644 --- a/packages/apps/redis/values.yaml +++ b/packages/apps/redis/values.yaml @@ -4,8 +4,10 @@ ## @param size Persistent Volume size ## @param replicas Number of Redis replicas ## @param storageClass StorageClass used to store the data +## @param authEnabled Enable password generation ## external: false size: 1Gi replicas: 2 storageClass: "" +authEnabled: true diff --git a/packages/apps/versions_map b/packages/apps/versions_map index a506edbd..b313410b 100644 --- a/packages/apps/versions_map +++ b/packages/apps/versions_map @@ -76,7 +76,8 @@ rabbitmq 0.4.3 HEAD redis 0.1.1 f642698 redis 0.2.0 5ca8823 redis 0.3.0 c07c4bbd -redis 0.3.1 HEAD +redis 0.3.1 b7375f73 +redis 0.4.0 HEAD tcp-balancer 0.1.0 f642698 tcp-balancer 0.2.0 HEAD tenant 0.1.3 3d1b86c