firefly-iii: Use volume claim template for redis
Using a volume claim template to define the persistent volume claim for the Redis pod has two advantages: first, it enables using clustered Redis, if we decide that becomes necessary, and second, it makes deleteing and recreating the volume easier in the case of data corruption. Simply scale down the StatefulSet to 0, delete the PVC, and scale the StatefulSet back up.etcd
parent
2ce1821667
commit
02c88700f7
|
@ -1,22 +1,3 @@
|
|||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: redis
|
||||
namespace: firefly-iii
|
||||
labels:
|
||||
app.kubernetes.io/name: redis
|
||||
app.kubernetes.io/component: redis
|
||||
app.kubernetes.io/instance: firefly-iii
|
||||
app.kubernetes.io/part-of: firefly-iii
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
|
@ -75,7 +56,7 @@ spec:
|
|||
runAsUser: 1000
|
||||
runAsGroup: 1000
|
||||
volumeMounts:
|
||||
- name: redisdata
|
||||
- name: data
|
||||
mountPath: /data
|
||||
subPath: data
|
||||
- name: tmp
|
||||
|
@ -83,9 +64,21 @@ spec:
|
|||
securityContext:
|
||||
fsGroup: 1000
|
||||
volumes:
|
||||
- name: redisdata
|
||||
persistentVolumeClaim:
|
||||
claimName: redis
|
||||
- name: tmp
|
||||
emptyDir:
|
||||
volumeClaimTemplates:
|
||||
- apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: data
|
||||
labels:
|
||||
app.kubernetes.io/name: redis
|
||||
app.kubernetes.io/component: redis
|
||||
app.kubernetes.io/part-of: firefly-iii
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 2G
|
||||
|
||||
|
|
Loading…
Reference in New Issue