gcp-compute-persistent-disk-csi-driver: Labels of pv are missing

with k8s version 1.17.16, when i use gce-pd to provison pv by storageclass, there are two labels failure-domain.beta.kubernetes.io/region, failure-domain.beta.kubernetes.io/zone in pv, you can see it as below

apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    kubernetes.io/createdby: gce-pd-dynamic-provisioner
    velero.io/alibabacloud-restore-plugin: "1"
  creationTimestamp: "2021-06-07T07:04:23Z"
  finalizers:
  - kubernetes.io/pv-protection
  labels:
    failure-domain.beta.kubernetes.io/region: europe-west1
    failure-domain.beta.kubernetes.io/zone: europe-west1-b
  name: pvc-165b7c53-1263-4469-a36f-84994da94a3b
  resourceVersion: "29425366"
  selfLink: /api/v1/persistentvolumes/pvc-165b7c53-1263-4469-a36f-84994da94a3b
  uid: c5fae559-1ba0-43c1-b864-4d44b76ae1b2

however, when i switch to pd.csi.storage.gke.io stable-1-17 the labels are missing, as below

apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    pv.kubernetes.io/provisioned-by: pd.csi.storage.gke.io
  creationTimestamp: "2021-07-01T07:33:42Z"
  finalizers:
  - kubernetes.io/pv-protection
  - external-attacher/pd-csi-storage-gke-io
...

in k8s version 1.18.18, both gce-pd and pd.csi.storage.gke.io stable-master are missing labels. I am not sure whether it is related with migaration feature result in pv always provisioned by pd.csi.storage.gke.io even if i used gce-pd. kubectl get csinodes -o yaml

apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: CSINode
  metadata:
    annotations:
      storage.alpha.kubernetes.io/migrated-plugins: kubernetes.io/gce-pd
    creationTimestamp: "2021-07-02T06:27:58Z"
    managedFields:

so please help me to figure out why is it and how to get labels failure-domain.beta.kubernetes.io/region, failure-domain.beta.kubernetes.io/zone automatically by pd.csi.storage.gke.io?

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 30 (13 by maintainers)

Most upvoted comments

It seems this issue has not been resolved yet? We’re on GKE 1.21.6-gke.1503 and gke.gcr.io/gcp-compute-persistent-disk-csi-driver:v1.3.4-gke.0

Having the same problem with velero.

I think the issue pointed out here is that the topology labels are put on the PV.Spec.NodeAffinity field, but not in PV.Metadata.Labels like it did for the the in-tree driver.