Skip to content

Commit 4ce82a9

Browse files
committed
Add redis auth
1 parent 2e0ae0b commit 4ce82a9

7 files changed

Lines changed: 40 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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
{{- if .Values.authEnabled }}
2+
{{- $existingPassword := lookup "v1" "Secret" .Release.Namespace (printf "%s-auth" .Release.Name) }}
3+
{{- $password := randAlphaNum 16 | b64enc }}
4+
{{- if $existingPassword }}
5+
{{- $password = index $existingPassword.data "password" }}
6+
{{- else }}
7+
---
8+
apiVersion: v1
9+
kind: Secret
10+
metadata:
11+
name: {{ .Release.Name }}-auth
12+
data:
13+
password: {{ $password }}
14+
{{- end }}
15+
{{- end }}
16+
17+
---
18+
119
apiVersion: databases.spotahome.com/v1
220
kind: RedisFailover
321
metadata:
@@ -52,3 +70,7 @@ spec:
5270
- appendonly no
5371
- save ""
5472
{{- end }}
73+
{{- if .Values.authEnabled }}
74+
auth:
75+
secretPath: {{ .Release.Name }}-auth
76+
{{- 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)