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

k8s 1.17: csi-hostpath-snapclass is not created during the driver deployment #199

Closed
sedovalx opened this issue Sep 14, 2020 · 13 comments
Closed
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@sedovalx
Copy link

I'm trying to deploy the driver on minikube with --kubernetes-version v1.17.9, so I have installed CRDs and then have run csi-driver-host-path/deploy/kubernetes-1.17/deploy.sh for that. The last line in the deploy log was "deploying snapshotclass based on snapshotter version". And then, when I tried to create a snapshot with examples/csi-snapshot-v1beta1.yaml I've got the following error for the new-snapshot-demo volume snapshot:

$ kubectl describe volumesnapshot                                                                
Name:         new-snapshot-demo
Namespace:    default
Labels:       <none>
Annotations:  kubectl.kubernetes.io/last-applied-configuration:
                {"apiVersion":"snapshot.storage.k8s.io/v1beta1","kind":"VolumeSnapshot","metadata":{"annotations":{},"name":"new-snapshot-demo","namespace...
API Version:  snapshot.storage.k8s.io/v1beta1
Kind:         VolumeSnapshot
Metadata:
  Creation Timestamp:  2020-09-14T10:21:34Z
  Generation:          1
  Resource Version:    59736
  Self Link:           /apis/snapshot.storage.k8s.io/v1beta1/namespaces/default/volumesnapshots/new-snapshot-demo
  UID:                 1acdcca0-2cbd-4825-b15d-1eb6edd793b8
Spec:
  Source:
    Persistent Volume Claim Name:  csi-pvc
  Volume Snapshot Class Name:      csi-hostpath-snapclass
Status:
  Error:
    Message:     Failed to get snapshot class with error failed to retrieve snapshot class csi-hostpath-snapclass from the informer: "volumesnapshotclass.snapshot.storage.k8s.io \"csi-hostpath-snapclass\" not found"
    Time:        2020-09-14T10:21:34Z
  Ready To Use:  false
Events:
  Type     Reason                  Age    From                 Message
  ----     ------                  ----   ----                 -------
  Warning  GetSnapshotClassFailed  4m23s  snapshot-controller  Failed to get snapshot class with error failed to retrieve snapshot class csi-hostpath-snapclass from the informer: "volumesnapshotclass.snapshot.storage.k8s.io \"csi-hostpath-snapclass\" not found"

In the "deploy-hostpath.sh" I see that the csi-hostpath-snapshotclass.yaml applied for k8s 1.16 only. Is it right? Am I doing something wrong?

@sedovalx
Copy link
Author

The problem happened because I was calling the deploy.sh script from inside the kubernetes-1.17 directory. It should be called from the outside of it.

@pohly
Copy link
Contributor

pohly commented Sep 15, 2020

/reopen

It should be possible to invoke the script anywhere. That's what BASE_DIR

BASE_DIR=$(dirname "$0")
is for.

I'm not sure why it is failing, but the issue seems legitimate.

/help

@k8s-ci-robot
Copy link
Contributor

@pohly: Reopened this issue.

In response to this:

/reopen

It should be possible to invoke the script anywhere. That's what BASE_DIR

BASE_DIR=$(dirname "$0")
is for.

I'm not sure why it is failing, but the issue seems legitimate.

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot reopened this Sep 15, 2020
@sedovalx
Copy link
Author

BASE_DIR is . if I do

cd deploy/kubernetes-1.17
./deploy.sh

but it contains kubernetes-1.17 if

./deploy/kubernetes-1.17/deploy.sh

MacOS, zsh

@pohly
Copy link
Contributor

pohly commented Sep 15, 2020

Bingo:

driver_version="$(basename "${BASE_DIR}")"

That only works when BASE_DIR includes the "kubernetes-x.yy" name. The check shouldn't make that assumption and instead use
driver_version="$(basename "$(readlink -f "${BASE_DIR}")" )"

Does readlink -f work under MacOS? It's from GNU coreutils.

@sedovalx
Copy link
Author

No, seems it doesn't work on MacOS. Here is an explanation and a workaround https://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac

@pohly
Copy link
Contributor

pohly commented Sep 16, 2020

@sedovalx a simple cd + pwd should do the trick here. Do you think you can come up with a PR?

@sedovalx
Copy link
Author

Sorry - I don't have much knowledge in bash. Can do if you tell me exactly what to change :)

@aayushrangwala
Copy link
Contributor

/cc @pohly

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Feb 8, 2021
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Mar 10, 2021
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-contributor-experience at kubernetes/community.
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

xing-yang added a commit to xing-yang/csi-driver-host-path that referenced this issue Aug 23, 2022
d24254f Merge pull request kubernetes-csi#202 from xing-yang/kind_0.14.0
0faa3fc Update to Kind v0.14.0 images
ef4e1b2 Merge pull request kubernetes-csi#201 from xing-yang/add_1.24_image
4ddce25 Add 1.24 Kind image
7fe5149 Merge pull request kubernetes-csi#200 from pohly/bump-kubernetes-version
70915a8 prow.sh: update snapshotter version
31a3f38 Merge pull request kubernetes-csi#199 from pohly/bump-kubernetes-version
7577454 prow.sh: bump Kubernetes to v1.22.0

git-subtree-dir: release-tools
git-subtree-split: d24254f
TerryHowe pushed a commit to TerryHowe/csi-driver-host-path that referenced this issue Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants