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

fix: remove node driver registrar lifecycle hook #70

Merged
merged 2 commits into from
Feb 3, 2024
Merged

fix: remove node driver registrar lifecycle hook #70

merged 2 commits into from
Feb 3, 2024

Conversation

vadasambar
Copy link
Contributor

@vadasambar vadasambar commented Oct 31, 2023

  • was causing /bin/sh not found error
  • new node driver registrar version automatically removes the socket before terminating

Problem

We see the following error message every time csi driver pod restarts

"Dec  6 18:33:03 ip-xxx-xx-x-xx kubelet: I1206 18:33:03.442938    4937 handlers.go:67] Exec lifecycle hook ([/bin/sh -c rm -rf /registration/csi-image.warm-metal.tech /registration/csi-image.warm-metal.tech-reg.sock]) for Container \"node-driver-registrar\" in Pod \"csi-image-warm-metal-p9zzf_kube-system(f77a9f24-2f8a-46f6-a413-c6f1bfa7ea83)\" failed - error: command '/bin/sh -c rm -rf /registration/csi-image.warm-metal.tech /registration/csi-image.warm-metal.tech-reg.sock' exited with 126: , message: \"OCI runtime exec failed: exec failed: unable to start container process: exec: \\\"/bin/sh\\\": stat /bin/sh: no such file or directory: unknown\

Solution

This problem happens because node-driver-registrar does not have /bin/sh in it because it uses distroless image. This problem should happen every time warm metal pod shuts down.

node-driver-registrar versions < v2.0.0-rc1 don't remove the socket (/registration/csi-image.warm-metal.tech and /registration/csi-image.warm-metal.tech-reg.sock) automatically and we had to use the lifecycle hook. Our current warm-metal chart in master uses v2.8.0 version of node-driver-registrar which automatically removes the sockets for us (kubernetes-csi/node-driver-registrar#21 (comment)). Hence, we don't need the lifecycle hook anymore.

Related

Checks

Helm lint passes without any issues:

image

@vadasambar
Copy link
Contributor Author

We need another PR to update our node-driver-registrar version in the installer and samples from v1.1.0 to v2.8.0.

More info on the installer: https://github.com/warm-metal/csi-driver-image/tree/master#installation

@vadasambar vadasambar marked this pull request as ready for review October 31, 2023 11:02
@mugdha-adhav
Copy link
Collaborator

We need another PR to update our node-driver-registrar version in the installer and samples from v1.1.0 to v2.8.0.

More info on the installer: https://github.com/warm-metal/csi-driver-image/tree/master#installation

Could we update them in this PR itself?

@vadasambar
Copy link
Contributor Author

We need another PR to update our node-driver-registrar version in the installer and samples from v1.1.0 to v2.8.0.
More info on the installer: https://github.com/warm-metal/csi-driver-image/tree/master#installation

Could we update them in this PR itself?

I think it could be a change that can be handled in a separate PR because the change is related to the installer while this PR is more concerned with the chart. Ideally, it would be nice to have both the changes in the same PR but I think we can split the changes into 2 PRs. Let me know what you think.

@mugdha-adhav
Copy link
Collaborator

I think it could be a change that can be handled in a separate PR because the change is related to the installer while this PR is more concerned with the chart. Ideally, it would be nice to have both the changes in the same PR but I think we can split the changes into 2 PRs. Let me know what you think.

Yeah, I think we should fix it in a separate PR. Could you please create an issue to update the installer?

@mugdha-adhav
Copy link
Collaborator

@vadasambar we should be updating our master with this change soon. Could you please update this PR and get it ready for review again?

@vadasambar
Copy link
Contributor Author

@vadasambar we should be updating our master with this change soon. Could you please update this PR and get it ready for review again?

Will do and mention you here again. Thanks for the reminder.

- was causing `/bin/sh not found` error
- new node driver registrar version automatically removes the socket before terminating
@vadasambar
Copy link
Contributor Author

@mugdha-adhav updated the PR but forgot to mention you. Can you take a look? I think the PR is ready for review.

@mugdha-adhav
Copy link
Collaborator

Could you please also remove the remaining references for the hook?

And also could we update the Makefile and Chart.yaml with v1.0.1 so that we don't need another PR for releasing this change?

@mbtamuli
Copy link
Contributor

The PR looks good. 👍🏼

@vadasambar vadasambar requested a review from a team as a code owner February 3, 2024 17:49
@mugdha-adhav mugdha-adhav merged commit 98d1b98 into warm-metal:main Feb 3, 2024
6 checks passed
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