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

New key being used with old certificate #33

Open
ferjjp opened this issue Mar 3, 2021 · 0 comments
Open

New key being used with old certificate #33

ferjjp opened this issue Mar 3, 2021 · 0 comments

Comments

@ferjjp
Copy link

ferjjp commented Mar 3, 2021

When a kubernetes node is restarted, it makes another call to NodePublishVolume with the same volume id used previously on the pod's first startup (if the pod has not been cleaned up before it starts again). The CSI then proceeds to create a new key and reuses the existing certificate request (with the same volume id), which leaves on the volume a new private key that is not related to the certificate.

This happens regardless of the certificate an private key being wiped out or not(for example if you are using a temp directory).

I came up with two possible fixes for this:

  1. If you are not using a temp directory, you can re-read the existing key file if you want to reuse the private key, and this coupled with the reusing of the previous certificate request would leave the correct pair on the volume.
  2. You can delete the existing certificate request if it exists, and always make a new one when calling NodePublishVolume.

I'm not sure if this is being maintained but I wanted to create this issue to make sure it's documented somewhere.

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

1 participant