Cluster information:
Kubernetes version: 1.27.4-gke.900
Cloud being used: GKE
Topic information
GKE has a built in feature for creating and restoring backups. This includes the restoration of PVCs.
In my environment I define and use custom storage classes, for example:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: my-storage-class
provisioner: pd.csi.storage.gke.io
allowVolumeExpansion: true
parameters:
type: pd-ssd
This is used by a given StatefulSet, for example:
apiVersion: apps/v1
kind: StatefulSet
spec:
...
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes: [ "ReadWriteOnce" ]
storageClassName: my-storage-class
resources:
requests:
storage: 100Gi
I run my regular backup, which works fine, and then I do a restore, which also completes fine.
The problem shows up when I try to add more StatefulSets.
I notice that the my-storage-class
PVCs have become gce-pd-gkebackup-ie
(last two chars may vary) after the backup, and then my StatefulSet cannot find any PVCs with the specified class, and a deployment ends up pending indefinitely.
I have tried using the substitution rule to rename the storage class annotation I want, but no luck.
Was wondering if anyone else faced a similar issue or has any ideas on how to overcome this? Please let me know if I can provide any other useful info to help understand the issue.