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

docs: update kube tutorial cert install procedure #4907

Merged

Conversation

anderseknert
Copy link
Member

@anderseknert anderseknert commented Jul 19, 2022

Two unrelated issues would break the Kubernetes tutorial in recent kube versions. The first one being the SHA1 hash used by default in at least older versions of OpenSSL, which is no longer accepted by Kubernetes. Easy fix.

The next one is definitely a head scratcher - for whatever reason, the subjectAltName previously provided in the config didn't seem to be picked up in certificate signing requests. Older versions of Kubernetes - or Go, really - would accept the common name (CN), but more recent ones require the use of subjectAltName, so it's possible this never "worked" as intended but was ignored as the CN was used instead.

The docs on the topic however all suggest that the previous config should have worked, and after having spent a long time trying to figure out why it didn't, I've found nothing to provide any insights here. Best I have is "works on my machine", so if anyone else would want to try this out to make sure it works on theirs too, that'd be great.

  • Use explicit hashing algorithm
  • Specify -extensions as this does not seem to be picked up when provided in config only.

Fixes #4902

Signed-off-by: Anders Eknert [email protected]

@philipaconrad
Copy link
Contributor

@anderseknert Added some extra Markdown formatting to your PR header comment.

I'll give the updated instructions a whirl. I know next-to-nothing about k8s, but I can definitely tell you if I get the same error message. 😄

Copy link
Contributor

@philipaconrad philipaconrad left a comment

Choose a reason for hiding this comment

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

@anderseknert I was able to run through the entire k8s tutorial, end-to-end. I think your fixes did the trick. 👍

@anderseknert
Copy link
Member Author

Thanks @philipaconrad! Knowing nothing is pretty much a super power for a tester :D

I believe at least the first error is caused by Mac OS shipping an older version of openssl, which defaults to SHA1 hashing, and that the first fix might not be needed on other platforms. Being explicit certainly doesn't hurt though.

The other fix, I have no idea 😬

Two unrelated issues would break the Kubernetes tutorial in
recent kube versions. The first one being the SHA1 hash used
by default in at least older versions of OpenSSL, which is no
longer accepted by Kubernetes. Easy fix.

The next one is definitely a head scratcher - for whatever
reason, the subjectAltName previously provided in the config
didn't seem to be picked up in certificate signing requests.
Older versions of Kubernetes - or Go, really - would accept
the common name (CN), but more recent ones require the use of
subjectAltName, so it's possible this never "worked" as intended
but was ignored as the CN was used instead.

The docs on the topic however all suggest that the previous
config _should_ have worked, and after having spent a long time
trying to figure out why it didn't, I've found nothing to
provide any insights here. Best I have is "works on my
machine", so if anyone else would want to try this out to make
sureit works on theirs too, that'd be great.

* Use explicit hashing algorithm
* Specify -extensions as this does not seem to be picked up when
  provided in config only.

Fixes open-policy-agent#4902

Signed-off-by: Anders Eknert <[email protected]>
@anderseknert
Copy link
Member Author

Fantastic, @philipaconrad! @Impakt, could you please try it out before we have it merged?

@anderseknert
Copy link
Member Author

Fix confirmed working by both @philipaconrad and @Impakt (on Slack). Merging.

@anderseknert anderseknert merged commit 6200ff3 into open-policy-agent:main Jul 19, 2022
@anderseknert anderseknert deleted the fix-kube-tutorial-cert-conf branch July 19, 2022 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Kubernetes Tutorial doesn't work
2 participants