Skip to main content
deleted 875 characters in body
Source Link

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

Azure Storage Class is defined asIn your case, you defined two "volumeMounts". The second section will overwrite the first one. So your "/catalogue-data" is always a local drive.

...
              provisioner: disk.csi.azure.com
              parameters:
               skuname: StandardSSD_LRS
              reclaimPolicy: Delete
              allowVolumeExpansionvolumeMounts: true
              volumeBindingMode: WaitForFirstConsumer

1)deploy in AKS 2)check the mount and create a new directory

jing@l-jing-2:~$ kubectl exec -it geonetwork-8589fd8fb7-j256r -n
geonetwork-ns -- sh
$ findmnt | grepmountPath: "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4   name: rw,relatimegeonetwork
$ cd /catalogue-data
$ ls
resources
$ mkdir aaaaa
$ exit

3)restart pod, check

jing@l-jing-2:~$#### kubectlvolumeMounts: rollout### restartThis deploymentline geonetworkshould -nbe geonetwork-ns
deploymentremoved.apps/geonetwork restarted

jing@l-jing-2:~$ kubectl exec -it geonetwork-699b5b4574-z62hk -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                          mountPath: /dev/sdh[/gn]
metadata-import
                                              ext4    rw,relatime
$ cdname: /cataloguegeonetwork-data
$ ls
aaaaa  resourcesmetafileshare

looks like the volume was retained.

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

Azure Storage Class is defined as,

...
              provisioner: disk.csi.azure.com
              parameters:
               skuname: StandardSSD_LRS
              reclaimPolicy: Delete
              allowVolumeExpansion: true
              volumeBindingMode: WaitForFirstConsumer

1)deploy in AKS 2)check the mount and create a new directory

jing@l-jing-2:~$ kubectl exec -it geonetwork-8589fd8fb7-j256r -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
resources
$ mkdir aaaaa
$ exit

3)restart pod, check

jing@l-jing-2:~$ kubectl rollout restart deployment geonetwork -n geonetwork-ns
deployment.apps/geonetwork restarted

jing@l-jing-2:~$ kubectl exec -it geonetwork-699b5b4574-z62hk -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
aaaaa  resources

looks like the volume was retained.

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

In your case, you defined two "volumeMounts". The second section will overwrite the first one. So your "/catalogue-data" is always a local drive.

      volumeMounts:
        - mountPath: /catalogue-data
          name: geonetwork
      #### volumeMounts: ### This line should be removed. 
        - mountPath: /metadata-import
          name: geonetwork-metafileshare
added 1279 characters in body
Source Link

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

Azure Storage Class is defined as,

...
              provisioner: disk.csi.azure.com
              parameters:
               skuname: StandardSSD_LRS
              reclaimPolicy: Delete
              allowVolumeExpansion: true
              volumeBindingMode: WaitForFirstConsumer

1)deploy in AKS 2)check the mount and create a new directory

jing@l-jing-2:~$ kubectl exec -it geonetwork-8589fd8fb7-j256r -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
resources
$ mkdir aaaaa
$ exit

3)restart pod, check

jing@l-jing-2:~$ kubectl rollout restart deployment geonetwork -n geonetwork-ns
deployment.apps/geonetwork restarted

jing@l-jing-2:~$ kubectl exec -it geonetwork-699b5b4574-z62hk -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
aaaaa  resources

looks like the volume was retained.

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.

Azure Storage Class is defined as,

...
              provisioner: disk.csi.azure.com
              parameters:
               skuname: StandardSSD_LRS
              reclaimPolicy: Delete
              allowVolumeExpansion: true
              volumeBindingMode: WaitForFirstConsumer

1)deploy in AKS 2)check the mount and create a new directory

jing@l-jing-2:~$ kubectl exec -it geonetwork-8589fd8fb7-j256r -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
resources
$ mkdir aaaaa
$ exit

3)restart pod, check

jing@l-jing-2:~$ kubectl rollout restart deployment geonetwork -n geonetwork-ns
deployment.apps/geonetwork restarted

jing@l-jing-2:~$ kubectl exec -it geonetwork-699b5b4574-z62hk -n
geonetwork-ns -- sh
$ findmnt | grep "catalogue-data"
├─/catalogue-data                           /dev/sdh[/gn]

                                              ext4    rw,relatime
$ cd /catalogue-data
$ ls
aaaaa  resources

looks like the volume was retained.

Source Link

GeoNetwork should not format the 'catalogue-data' folder after a restart. You may want to check your mountPath and Storage Class definition.