Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node Affinity not set on v0.0.29 #454

Open
msander opened this issue Sep 25, 2024 · 2 comments
Open

Node Affinity not set on v0.0.29 #454

msander opened this issue Sep 25, 2024 · 2 comments

Comments

@msander
Copy link

msander commented Sep 25, 2024

I am using the local-path-provisioner with the volumeType "local". Since 0.0.29 I have the problem that the node affinity of the PV is not set. In 0.0.28 it worked correctly.
I am using rke2 (1.30.4). The PV is created as follows:

root@vm1:~# kubectl describe pv pvc-8b95ded6-dbc9-4e6c-8b7b-531c62ba28b6
Name:              pvc-8b95ded6-dbc9-4e6c-8b7b-531c62ba28b6
Labels:            <none>
Annotations:       local.path.provisioner/selected-node: vm1
                   pv.kubernetes.io/provisioned-by: rancher.io/local-path
Finalizers:        [kubernetes.io/pv-protection]
StorageClass:      local-path
Status:            Bound
Claim:             default/cnpg-database-1
Reclaim Policy:    Delete
Access Modes:      RWO
VolumeMode:        Filesystem
Capacity:          10Gi
Node Affinity:     
  Required Terms:  
    Term 0:        <none>
Message:           
Source:
    Type:  LocalVolume (a persistent volume backed by local storage on a node)
    Path:  /opt/local-path-provisioner/pvc-8b95ded6-dbc9-4e6c-8b7b-531c62ba28b6_default_cnpg-database-1
Events:    <none>

When going back to 0.0.28, the node affinity gets set correctly.

This is my storage class

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: local-path
  annotations:
    storageclass.kubernetes.io/is-default-class: "true"
    defaultVolumeType: local
provisioner: rancher.io/local-path
volumeBindingMode: WaitForFirstConsumer

PVC

Name:          cnpg-database-1
Namespace:     default
StorageClass:  local-path
Status:        Bound
Volume:        pvc-8b95ded6-dbc9-4e6c-8b7b-531c62ba28b6
Labels:        cnpg.io/cluster=cnpg-database
               cnpg.io/instanceName=cnpg-database-1
               cnpg.io/pvcRole=PG_DATA
Annotations:   cnpg.io/nodeSerial: 1
               cnpg.io/operatorVersion: 1.24.0
               cnpg.io/pvcStatus: ready
               pv.kubernetes.io/bind-completed: yes
               pv.kubernetes.io/bound-by-controller: yes
               volume.beta.kubernetes.io/storage-provisioner: rancher.io/local-path
               volume.kubernetes.io/selected-node: vm1
               volume.kubernetes.io/storage-provisioner: rancher.io/local-path
Finalizers:    [kubernetes.io/pvc-protection]
Capacity:      10Gi
Access Modes:  RWO
VolumeMode:    Filesystem
Used By:       cnpg-database-1
               cnpg-database-1-initdb-rbpld

@huangguoqiang
Copy link

yes, i met same issue.

@derekbit
Copy link
Member

Thanks for raising the issue. I will check and fix it soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants