Move Redis cluster to trading-platform and wire into kustomization

This commit is contained in:
sirius0xdev 2026-05-26 09:52:16 -09:00
commit c5e2ef16d2
2 changed files with 1 additions and 0 deletions

View file

@ -11,3 +11,4 @@ resources:
- secrets
- network-policies
- routes
- redis-cluster.yaml

View file

@ -0,0 +1,103 @@
# Redis single-instance for trading platform caching
apiVersion: v1
kind: Service
metadata:
name: trading-redis
namespace: customer1
labels:
app: trading-redis
spec:
selector:
app: trading-redis
ports:
- port: 6379
targetPort: 6379
name: redis
type: ClusterIP
---
apiVersion: v1
kind: ConfigMap
metadata:
name: trading-redis-config
namespace: customer1
data:
redis.conf: |
maxmemory 256mb
maxmemory-policy allkeys-lru
save 900 1
save 300 10
save 60 10000
appendonly yes
appendfsync everysec
dir /data
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: trading-redis
namespace: customer1
labels:
app: trading-redis
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: trading-redis
template:
metadata:
labels:
app: trading-redis
spec:
securityContext:
runAsNonRoot: true
runAsUser: 999
fsGroup: 999
containers:
- name: redis
image: redis:7.4-alpine
ports:
- containerPort: 6379
name: redis
args:
- redis-server
- /etc/redis/redis.conf
resources:
requests:
cpu: 100m
memory: 128Mi
limits:
cpu: 500m
memory: 512Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop:
- ALL
volumeMounts:
- name: config
mountPath: /etc/redis
- name: data
mountPath: /data
readinessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 5
periodSeconds: 5
livenessProbe:
exec:
command:
- redis-cli
- ping
initialDelaySeconds: 10
periodSeconds: 10
volumes:
- name: config
configMap:
name: trading-redis-config
- name: data
emptyDir: {}