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

Unable to attach volumes to pod, Error failed to attach: node "xxxxxx-xxx4139" has no NodeID annotation #314

Closed
san360 opened this issue Nov 15, 2019 · 14 comments

Comments

@san360
Copy link

san360 commented Nov 15, 2019

Errors from log files
K8's version 1.13.12
Trident 19.10 and installed with csi flag

trident-csi-c98574d6f-2r8j8 csi-attacher I1114 23:23:29.480251       1 csi_handler.go:120] Attaching "csi-cf6fab5c7ed93f986c742e83359e3190c78263db1e212b2622ae3ae1ef230a08"
trident-csi-c98574d6f-2r8j8 csi-attacher I1114 23:23:56.295373       1 csi_handler.go:103] Error processing "csi-cf6fab5c7ed93f986c742e83359e3190c78263db1e212b2622ae3ae1ef230a08": failed to attach: node "xxxxxx-xxx4139" has no NodeID annotation
trident-csi-c98574d6f-2r8j8 csi-attacher I1114 23:25:18.215553       1 csi_handler.go:120] Attaching "csi-cf6fab5c7ed93f986c742e83359e3190c78263db1e212b2622ae3ae1ef230a08"
trident-csi-c98574d6f-2r8j8 csi-attacher I1114 23:25:18.240505       1 csi_handler.go:103] Error processing "csi-cf6fab5c7ed93f986c742e83359e3190c78263db1e212b2622ae3ae1ef230a08": failed to attach: node "xxxxxx-xxx4139" has no NodeID annotation
@gnarl
Copy link
Contributor

gnarl commented Nov 15, 2019

Please contact NetApp Support to open a support case on this issue. The "has no NodeID annotation" may be a Kubernetes issue but more information is needed.

@scaleoutsean
Copy link
Contributor

Haven't enabled required Feature Gates?

@san360
Copy link
Author

san360 commented Nov 17, 2019 via email

@san360
Copy link
Author

san360 commented Nov 18, 2019

I noticed in our environment that below annotation is missing on nodes
csi.volume.kubernetes.io/nodeid='{"csi.trident.netapp.io":"xxxxx-xxxxx"}'
I added the annotation on one of the node and the error disappeared but another error popped up

Events:
  Type     Reason                  Age                  From                     Message
  ----     ------                  ----                 ----                     -------
  Normal   SuccessfulAttachVolume  4m15s                attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-74456e52-0a31-11ea-93b1-00505608c43f"
  Warning  FailedMount             2m12s                kubelet, xxxxx-xxxxxx  Unable to mount volumes for pod "task-pv-pod_default(ac03886a-0a37-11ea-8d01-00505608c441)": timeout expired waiting for volumes to attach or mount for pod "default"/"task-pv-pod". list of unmounted volumes=[task-pv-storage]. list of unattached volumes=[task-pv-storage default-token-jfz8d]
  Warning  FailedMount             22s (x9 over 2m30s)  kubelet, xxxxx-xxxxxx  MountVolume.MountDevice failed for volume "pvc-74456e52-0a31-11ea-93b1-00505608c43f" : rpc error: code = Unimplemented desc = unknown service csi.v0.Node
`
``

@adkerr
Copy link
Contributor

adkerr commented Nov 19, 2019

The original error (no nodeID) typically is because the trident node server was not able to start properly. Check the daemonset pod to make sure they all started without error

@san360
Copy link
Author

san360 commented Nov 19, 2019

All the pods under trident namespace are working.

NAME                          READY   STATUS    RESTARTS   AGE
trident-csi-58x27             2/2     Running   0          8h
trident-csi-6bnx8             2/2     Running   0          8h
trident-csi-7kqk8             2/2     Running   0          8h
trident-csi-9btdv             2/2     Running   0          8h
trident-csi-c98574d6f-gvpcd   5/5     Running   0          8h
trident-csi-fv7f5             2/2     Running   0          8h
trident-csi-g76z6             2/2     Running   0          8h
trident-csi-v4lt2             2/2     Running   0          8h
trident-csi-xmtx4             2/2     Running   0          8h

@trulleberg
Copy link

@san360, did you recieve any feedback via the ticket?

@san360
Copy link
Author

san360 commented Nov 28, 2019

So far nothing. Are you facing similar issue as well?

@korenaren
Copy link
Contributor

@san360 - if you have a support case open with NetApp, please send me the case # to martyt@netapp.com. I'll see if I can figure out what's going on. Thanks.

@trulleberg
Copy link

@san360 Yes we had the same issue. We had to modify the mounts of the worker nodes (make them shared) and install trident with custom-yaml (adjusted the kubelet_path)

This sorted out our problmen and made trident work as it should.

@san360
Copy link
Author

san360 commented Dec 4, 2019

@san360 Yes we had the same issue. We had to modify the mounts of the worker nodes (make them shared) and install trident with custom-yaml (adjusted the kubelet_path)

This sorted out our problmen and made trident work as it should.

Thanks for the update.
In our case the kubelets are running as a docker container. I am not sure if you have the same setup. Could you please describe your steps in detail?

I tried to install trident with custom yaml but it failed to start the daemonset container due to missing triden-csi secret. Does it generate secret yaml for you?

@clintonk
Copy link
Contributor

clintonk commented Dec 4, 2019

@san360 Yes, the Trident installer generates the trident-csi secret automatically.

@gnarl
Copy link
Contributor

gnarl commented Dec 6, 2019

@san360 We were finally able to reproduce this issue. When using containerized kubelet or a container orchestrator that does not install kubelet in /var/lib/kubelet all references to /var/lib/kubelet in the daemonset YAML need to be updated. Also, the kubelet path needs to be the same on all nodes. Mixing containerized kubelet with non-containerized kubelet, for example, is not supported.

When using containerized kubelet, RancherOS, Rancher, PKS, or any other container orchestrator that changes the path of kubelet Trident needs to be installed with customized YAML. OpenShift is an exception where customized YAML is not needed.

  • ./tridentctl install --generate-custom-yaml
  • Edit setup/trident-daemonset.yaml
  • Update all references in the file of '/var/lib/kubelet' to the correct path
  • Install Trident with the '--use-custom-yaml' flag

As of Trident 19.10.0 these are all the references to /var/lib/kubelet that need to be updated.

grep -in "/var/lib/kubelet" *
trident-daemonset.yaml:53:          mountPath: /var/lib/kubelet/plugins
trident-daemonset.yaml:55:          mountPath: /var/lib/kubelet/pods
trident-daemonset.yaml:79:          value: "/var/lib/kubelet/plugins/csi.trident.netapp.io/csi.sock"
trident-daemonset.yaml:100:          path: /var/lib/kubelet/plugins/csi.trident.netapp.io/
trident-daemonset.yaml:104:          path: /var/lib/kubelet/plugins_registry/
trident-daemonset.yaml:108:          path: /var/lib/kubelet/plugins
trident-daemonset.yaml:112:          path: /var/lib/kubelet/pods

We are working on a change to make Trident easier to install when the kubelet path differs from the default. Thanks for your feedback and patience so far. Let us know if this fixes your issue.

@korenaren
Copy link
Contributor

@san360 I believe this is resolved, so closing this issue. Please let me know if that is not the case, and we will reopen.

netapp-ci pushed a commit that referenced this issue Dec 21, 2019
netapp-ci pushed a commit that referenced this issue Jul 30, 2020
Co-authored-by: Alex Meade <mr.alex.meade@gmail.com>
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

7 participants