Skip to content

Commit abc8f08

Browse files
authored
Add redis auth (#528)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced `authEnabled` parameter for enabling password generation in Redis. - Added authentication logic for Redis failover configuration. - **Bug Fixes** - Updated version of the Redis chart from `0.3.1` to `0.4.0`. - **Documentation** - Updated README to include the new `authEnabled` parameter description. - **Chores** - Incremented version numbers for multiple packages in the version map. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent b43c958 commit abc8f08

7 files changed

Lines changed: 39 additions & 2 deletions

File tree

‎packages/apps/redis/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.3.1
19+
version: 0.4.0
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

‎packages/apps/redis/README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ Service utilizes the Spotahome Redis Operator for efficient management and orche
1919
| `size` | Persistent Volume size | `1Gi` |
2020
| `replicas` | Number of Redis replicas | `2` |
2121
| `storageClass` | StorageClass used to store the data | `""` |
22+
| `authEnabled` | Enable password generation | `true` |
2223

2324

‎packages/apps/redis/templates/dashboard-resourcemap.yaml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,10 @@ rules:
1313
- rfrs-{{ .Release.Name }}
1414
- "{{ .Release.Name }}-external-lb"
1515
verbs: ["get", "list", "watch"]
16+
- apiGroups:
17+
- ""
18+
resources:
19+
- secrets
20+
resourceNames:
21+
- "{{ .Release.Name }}-auth"
22+
verbs: ["get", "list", "watch"]

‎packages/apps/redis/templates/redisfailover.yaml‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
{{- if .Values.authEnabled }}
2+
{{- $existingPassword := lookup "v1" "Secret" .Release.Namespace (printf "%s-auth" .Release.Name) }}
3+
{{- $password := randAlphaNum 32 | b64enc }}
4+
{{- if $existingPassword }}
5+
{{- $password = index $existingPassword.data "password" }}
6+
{{- end }}
7+
---
8+
apiVersion: v1
9+
kind: Secret
10+
metadata:
11+
name: {{ .Release.Name }}-auth
12+
data:
13+
password: {{ $password }}
14+
{{- end }}
15+
16+
---
17+
118
apiVersion: databases.spotahome.com/v1
219
kind: RedisFailover
320
metadata:
@@ -52,3 +69,7 @@ spec:
5269
- appendonly no
5370
- save ""
5471
{{- end }}
72+
{{- if .Values.authEnabled }}
73+
auth:
74+
secretPath: {{ .Release.Name }}-auth
75+
{{- end }}

‎packages/apps/redis/values.schema.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@
2121
"type": "string",
2222
"description": "StorageClass used to store the data",
2323
"default": ""
24+
},
25+
"authEnabled": {
26+
"type": "boolean",
27+
"description": "Enable password generation",
28+
"default": true
2429
}
2530
}
2631
}

‎packages/apps/redis/values.yaml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
## @param size Persistent Volume size
55
## @param replicas Number of Redis replicas
66
## @param storageClass StorageClass used to store the data
7+
## @param authEnabled Enable password generation
78
##
89
external: false
910
size: 1Gi
1011
replicas: 2
1112
storageClass: ""
13+
authEnabled: true

‎packages/apps/versions_map‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ rabbitmq 0.4.3 HEAD
7676
redis 0.1.1 f642698
7777
redis 0.2.0 5ca8823
7878
redis 0.3.0 c07c4bbd
79-
redis 0.3.1 HEAD
79+
redis 0.3.1 b7375f73
80+
redis 0.4.0 HEAD
8081
tcp-balancer 0.1.0 f642698
8182
tcp-balancer 0.2.0 HEAD
8283
tenant 0.1.3 3d1b86c

0 commit comments

Comments
 (0)