Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,28 @@ spec:
dataFrom:
- extract:
key: credreg-secrets-eks-production

---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: redis-auth
namespace: credreg-prod
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secret-manager
kind: ClusterSecretStore
target:
name: redis-auth
creationPolicy: Owner
template:
data:
password: "{{ .redis_password }}"
redis-password.conf: |
requirepass {{ .redis_password }}
data:
- secretKey: redis_password
remoteRef:
key: credreg-secrets-eks-production
property: redis-password
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ data:
redis.conf: |
bind 0.0.0.0
port 6379
requirepass your_secure_password
appendonly yes
maxmemory 500mb
maxmemory-policy allkeys-lru
appendonly yes
maxmemory 500mb
maxmemory-policy allkeys-lru
tcp-keepalive 300
protected-mode yes
include /run/redis-auth/redis-password.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ spec:
effect: "NoSchedule"
containers:
- name: redis
image: redis:7.2-alpine # Official Redis image
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
image: redis:8.0-alpine # Official Redis image
command:
- /bin/sh
- -c
- |
set -euo pipefail
PASS="$(cat /run/redis-auth/password)"
exec redis-server /usr/local/etc/redis/redis.conf --requirepass "$PASS"
ports:
- containerPort: 6379
volumeMounts:
- name: redis-data
mountPath: /data
- name: redis-config
mountPath: /usr/local/etc/redis
- name: redis-auth
mountPath: /run/redis-auth
readOnly: true
resources:
requests:
cpu: "100m"
Expand All @@ -44,18 +53,27 @@ spec:
memory: "1Gi"
livenessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: redis-config
configMap:
name: redis-config
- name: redis-auth
secret:
secretName: redis-auth
volumeClaimTemplates:
- metadata:
name: redis-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,28 @@ spec:
dataFrom:
- extract:
key: credreg-secrets-eks-sandbox

---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: redis-auth
namespace: credreg-sandbox
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secret-manager
kind: ClusterSecretStore
target:
name: redis-auth
creationPolicy: Owner
template:
data:
password: "{{ .redis_password }}"
redis-password.conf: |
requirepass {{ .redis_password }}
data:
- secretKey: redis_password
remoteRef:
key: credreg-secrets-eks-sandbox
property: redis-password
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ data:
redis.conf: |
bind 0.0.0.0
port 6379
requirepass your_secure_password
appendonly yes
maxmemory 500mb
maxmemory-policy allkeys-lru
appendonly yes
maxmemory 500mb
maxmemory-policy allkeys-lru
tcp-keepalive 300
protected-mode yes
include /run/redis-auth/redis-password.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ spec:
effect: "NoSchedule"
containers:
- name: redis
image: redis:7.2-alpine # Official Redis image
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
image: redis:8.0-alpine # Official Redis image
command:
- /bin/sh
- -c
- |
set -euo pipefail
PASS="$(cat /run/redis-auth/password)"
exec redis-server /usr/local/etc/redis/redis.conf --requirepass "$PASS"
ports:
- containerPort: 6379
volumeMounts:
- name: redis-data
mountPath: /data
- name: redis-config
mountPath: /usr/local/etc/redis
- name: redis-auth
mountPath: /run/redis-auth
readOnly: true
resources:
requests:
cpu: "100m"
Expand All @@ -44,18 +53,27 @@ spec:
memory: "1Gi"
livenessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: redis-config
configMap:
name: redis-config
- name: redis-auth
secret:
secretName: redis-auth
volumeClaimTemplates:
- metadata:
name: redis-data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,28 @@ spec:
dataFrom:
- extract:
key: credreg-secrets-eks-staging

---
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: redis-auth
namespace: credreg-staging
spec:
refreshInterval: 1h
secretStoreRef:
name: aws-secret-manager
kind: ClusterSecretStore
target:
name: redis-auth
creationPolicy: Owner
template:
data:
password: "{{ .redis_password }}"
redis-password.conf: |
requirepass {{ .redis_password }}
data:
- secretKey: redis_password
remoteRef:
key: credreg-secrets-eks-staging
property: redis-password
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ data:
redis.conf: |
bind 0.0.0.0
port 6379
requirepass your_secure_password
appendonly yes
maxmemory 500mb
maxmemory-policy allkeys-lru
tcp-keepalive 300
protected-mode yes
include /run/redis-auth/redis-password.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ spec:
effect: "NoSchedule"
containers:
- name: redis
image: redis:7.2-alpine # Official Redis image
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
image: redis:8.0-alpine # Official Redis image
command:
- /bin/sh
- -c
- |
set -euo pipefail
PASS="$(cat /run/redis-auth/password)"
exec redis-server /usr/local/etc/redis/redis.conf --requirepass "$PASS"
ports:
- containerPort: 6379
volumeMounts:
- name: redis-data
mountPath: /data
- name: redis-config
mountPath: /usr/local/etc/redis
- name: redis-auth
mountPath: /run/redis-auth
readOnly: true
resources:
requests:
cpu: "100m"
Expand All @@ -44,18 +53,27 @@ spec:
memory: "1Gi"
livenessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 30
periodSeconds: 10
readinessProbe:
exec:
command: ["redis-cli", "ping"]
command:
- /bin/sh
- -c
- redis-cli -a "$(cat /run/redis-auth/password)" ping
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: redis-config
configMap:
name: redis-config
- name: redis-auth
secret:
secretName: redis-auth
volumeClaimTemplates:
- metadata:
name: redis-data
Expand Down
Loading