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
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: longhorn-jellystat-data
|
name: jellystat-pvc
|
||||||
namespace: default
|
namespace: default
|
||||||
spec:
|
spec:
|
||||||
accessModes:
|
accessModes:
|
||||||
- ReadWriteMany
|
- ReadWriteMany
|
||||||
storageClassName: longhorn
|
storageClassName: ""
|
||||||
|
volumeName: jellystat-pv
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
storage: 1Gi
|
storage: 1Gi
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
---
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
@@ -14,12 +15,6 @@ spec:
|
|||||||
app: jellystat
|
app: jellystat
|
||||||
spec:
|
spec:
|
||||||
initContainers:
|
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
|
- name: jellystat-db
|
||||||
image: postgres:alpine
|
image: postgres:alpine
|
||||||
restartPolicy: Always
|
restartPolicy: Always
|
||||||
@@ -38,7 +33,7 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: backup
|
- name: backup
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
subPath: pgdata
|
subPath: db
|
||||||
containers:
|
containers:
|
||||||
- name: jellystat
|
- name: jellystat
|
||||||
image: cyfershepard/jellystat:1.1.6
|
image: cyfershepard/jellystat:1.1.6
|
||||||
@@ -68,4 +63,4 @@ spec:
|
|||||||
volumes:
|
volumes:
|
||||||
- name: backup
|
- name: backup
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: longhorn-jellystat-data
|
claimName: jellystat-pvc
|
||||||
|
|||||||
Reference in New Issue
Block a user