简体   繁体   中英

Kubernetes Pod is not saving the data even though it has persistent storage

I am using JBPM business-central which is deployed on K8s. Below is my depolyment.apps where the persistent volume is attached.

kubectl edit deployment.apps/jbpm-server-full
     volumes:
      - name: jbpm-pv-storage
        persistentVolumeClaim:
          claimName: jbpm-pv-claim

But when i restart the pod i am losing all the workspaces in business-central even though we have attached persistent volumes attached to the k8S pod.

You need to mount that volume inside the container and write data into the mounted path

apiVersion: v1
kind: Pod
metadata:
  name: task-pv-pod
spec:
  volumes:
    - name: task-pv-storage
      persistentVolumeClaim:
        claimName: task-pv-claim
  containers:
    - name: task-pv-container
      image: nginx
      ports:
        - containerPort: 80
          name: "http-server"
      volumeMounts:
        - mountPath: "/usr/share/nginx/html"
          name: task-pv-storage

https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM