Skip to content

Commit

Permalink
Make redis persist data to a volume
Browse files Browse the repository at this point in the history
  • Loading branch information
mkretz committed May 29, 2024
1 parent 3a18b96 commit 37a127a
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/example/k8s/deploy-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ spec:
- name: ACKBAR_URL
value: http://ackbar.ackbar
- name: CONTEXT_ID
value: f3327714-8d22-44ae-b9c1-840544b398b4
value: 3c0d1a1d-2e58-4032-a7dd-cf93a3eef4d3
2 changes: 1 addition & 1 deletion cmd/example/k8s/hpa-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
name: partition-to-worker-ratio
selector:
matchLabels:
context: f3327714-8d22-44ae-b9c1-840544b398b4
context: 3c0d1a1d-2e58-4032-a7dd-cf93a3eef4d3
target:
type: Value
value: 1
5 changes: 5 additions & 0 deletions k8s/cm-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ackbar-redis
namespace: ackbar
15 changes: 15 additions & 0 deletions k8s/deploy-redis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,20 @@ spec:
containers:
- name: redis
image: redis:latest
args: ["/usr/local/etc/redis/redis.conf"]
ports:
- containerPort: 6379
volumeMounts:
- name: storage
mountPath: /data
- name: config
mountPath: /usr/local/etc/redis/redis.conf
readOnly: true
volumes:
- name: storage
persistentVolumeClaim:
claimName: ackbar-redis
- name: config
configMap:
defaultMode: 0666
name: ackbar-redis
11 changes: 11 additions & 0 deletions k8s/pvc-redis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ackbar-redis
namespace: ackbar
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi

0 comments on commit 37a127a

Please sign in to comment.