use nfs pv and pvc
This commit is contained in:
@@ -1,13 +1,34 @@
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: jellystat-pv
|
||||
namespace: default
|
||||
spec:
|
||||
capacity:
|
||||
storage: 1Gi
|
||||
volumeMode: Filesystem
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
path: /k3s/volumes/jellystat
|
||||
server: 10.0.0.123
|
||||
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: longhorn-jellystat-data
|
||||
name: jellystat-pvc
|
||||
namespace: default
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
storageClassName: longhorn
|
||||
storageClassName: ""
|
||||
volumeName: jellystat-pv
|
||||
resources:
|
||||
requests:
|
||||
storage: 1Gi
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
@@ -14,12 +15,6 @@ spec:
|
||||
app: jellystat
|
||||
spec:
|
||||
initContainers:
|
||||
- name: init-cleanup
|
||||
image: busybox
|
||||
command: ["rm", "-rf", "/var/lib/postgresql/data/lost+found"]
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /var/lib/postgresql/data
|
||||
- name: jellystat-db
|
||||
image: postgres:alpine
|
||||
restartPolicy: Always
|
||||
@@ -38,7 +33,7 @@ spec:
|
||||
volumeMounts:
|
||||
- name: backup
|
||||
mountPath: /var/lib/postgresql/data
|
||||
subPath: pgdata
|
||||
subPath: db
|
||||
containers:
|
||||
- name: jellystat
|
||||
image: cyfershepard/jellystat:1.1.6
|
||||
@@ -68,4 +63,4 @@ spec:
|
||||
volumes:
|
||||
- name: backup
|
||||
persistentVolumeClaim:
|
||||
claimName: longhorn-jellystat-data
|
||||
claimName: jellystat-pvc
|
||||
|
||||
Reference in New Issue
Block a user