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.
This commit is contained in:
@@ -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
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
@@ -75,7 +56,7 @@ spec:
|
|||||||
runAsUser: 1000
|
runAsUser: 1000
|
||||||
runAsGroup: 1000
|
runAsGroup: 1000
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: redisdata
|
- name: data
|
||||||
mountPath: /data
|
mountPath: /data
|
||||||
subPath: data
|
subPath: data
|
||||||
- name: tmp
|
- name: tmp
|
||||||
@@ -83,9 +64,21 @@ spec:
|
|||||||
securityContext:
|
securityContext:
|
||||||
fsGroup: 1000
|
fsGroup: 1000
|
||||||
volumes:
|
volumes:
|
||||||
- name: redisdata
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: redis
|
|
||||||
- name: tmp
|
- name: tmp
|
||||||
emptyDir:
|
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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user