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

Copy kubernetes.io/hostname label to PVs #464

Merged
merged 2 commits into from
May 9, 2019

Conversation

cofyc
Copy link
Contributor

@cofyc cofyc commented May 8, 2019

What problem does this PR solve?

To simplify administration, it would be helpful to be able to search PVs by node name.

e.g.

$ kubectl get pv -l kubernetes.io/hostname=kube-node-3
NAME                CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS    REASON   AGE
local-pv-d20c2706   6Gi        RWO            Delete           Available           local-storage            5m4s

What is changed and how it works?

Configure kubernetes.io/hostname in nodeLabelsForPV, local-volume-provisioner will copy node labels to PVs it provisioned.

Note that local-volume-provisioner does not sync labels between node and PVs. It only applies to new PVs for now.

Check List

Tests

  • Unit test
  • E2E test
  • Stability test
  • Manual test (add detailed scripts or steps below)

1, Update local-volume-provisioner

kubectl apply -f manifests/local-dind/local-volume-provisioner.yaml
kubectl -n kube-system delete pods -lapp=local-volume-provisioner

2, Check new PVs it provisions

  • No code

Code changes

  • Has Helm charts change
  • Has Go code change
  • Has CI related scripts change
  • Has documents change

Side effects

  • Breaking backward compatibility

Related changes

  • Need to cherry-pick to the release branch
  • Need to update the documentation

@cofyc cofyc requested review from weekface and tennix May 8, 2019 04:15
@weekface
Copy link
Contributor

weekface commented May 8, 2019

/run-e2e-tests

Copy link
Member

@tennix tennix left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tennix tennix merged commit 7f1d85b into pingcap:master May 9, 2019
yahonda pushed a commit that referenced this pull request Dec 27, 2021
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

Successfully merging this pull request may close these issues.

3 participants