I have a Kubernetes POD running and I have attached a PVC to it. The PVC volume is /opt/stackstorm.
By default, there are certain files inside the /opt/stackstorm which comes as part of the docker official image. These files are visible when there is no PVC attached to the POD.
But when a PVC is attached, the files are replace and a lost&found directory is created.
How we can retain the directory even after attaching the PVC ?
I have changed directories for the PVC. When I change the directory from opt/stackstorm to /opt/stack then /opt/stackstorm has all the details but /opt/stack becomes empty.
So the PVC when attached to a POD is creating issue.
pvc.yaml:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: stacke
annotations:
volume.beta.kubernetes.io/storage-class: "ebs"
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 3Gi
deployment.yaml:
volumeMounts:
- name: stacke
mountPath: /opt/stackstorm
volumes:
- name: stacke
persistentVolumeClaim:
claimName: stacke
imagePullSecrets:
- name: regcred
expected results is that /opt/stackstorm should have all the files as part of the image.