Content
Kubernetes persistent data not working over PVC
Added by Eric Leiner over 4 years ago
I have it running last Docker version under Kubernetes with NFS as a Persistence Volume.
The problem becomes when OpenProject mounts the pgdata over already mounted NFS (PVC) /var/openproject
I can see the content of the /var/openproject/pgdata inside the running container but not in the NFS server.
I tried to give full permissions but nothing helped.
My NFS server config (/etc/exports):
/mnt/storage/openproject 10.10.0.0/24(nohide,rw,sync,no_wdelay,subtree_check)
Otherwiser when I do a "touch /var/openproject/hello.txt" in the Openproject running container the file is save to the NFS Server without problem.
The issue is arround the "/var/openproject/pgdata"
Using "devel" as namespace my yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: openproject
labels:
name: openproject
namespace: devel
spec:
replicas: 1
selector:
matchLabels:
name: openproject
template:
metadata:
name: openproject
labels:
name: openproject
spec:
containers:
- name: openproject
image: openproject/community:latest
- name: SECRET_KEY_BASE
value: "mysecret"
ports:
- containerPort: 8080
name: http
protocol: TCP
volumeMounts:
- name: openproject-data
mountPath: /var/openproject
volumes:
- name: openproject-data
persistentVolumeClaim:
claimName: openproject-pvc
---
apiVersion: v1
kind: Service
metadata:
namespace: devel
name: openproject
labels:
run: openproject
spec:
ports:
- name: openproject
protocol: TCP
port: 8080
targetPort: 8080
selector:
name: openproject
---
kind: Ingress
apiVersion: networking.k8s.io/v1beta1
metadata:
name: openproject
namespace: devel
spec:
rules:
- host: op.mysite.com
http:
paths:
- path: /
backend:
serviceName: openproject
servicePort: 8080
Any idea how to solve it?
Replies (1)
Did you manage to get a fix for this?
Currently facing similar issue