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

Auto-discover caBundle when missing (take 2) #655

Merged
merged 38 commits into from
Sep 3, 2021

Conversation

JacobGabrielson
Copy link
Contributor

Issue, if available:

This is a prerequisite for #626 but does not fix it.

Description of changes:

fix problems with https://github.com/awslabs/karpenter/pull/636/files

  1. conflict between knative and controllerruntime was causing webhook to crash, and,
  2. CAData was empty so launch template created was invalid

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

jacob added 5 commits September 2, 2021 10:50
... instead of rest.InClusterConfig() - this will work in more
scenarios, such as when Karpenter is not running inside of the
cluster
1. wasn't finding CAData because it wasn't populated

2. use of controllerruntime in shared code (w/ webhook) was causing
init()-time crash
@netlify
Copy link

netlify bot commented Sep 2, 2021

✔️ Deploy Preview for karpenter-docs-prod canceled.

🔨 Explore the source changes: e75ebd1

🔍 Inspect the deploy log: https://app.netlify.com/sites/karpenter-docs-prod/deploys/61316377d78e170007700c58

encoded := base64.StdEncoding.EncodeToString(binary)
return &encoded, nil
_, err = transport.TLSConfigFor(transportConfig) // fills in CAData!
logging.FromContext(ctx).Infof("Discovered caBundle, length %d", len(transportConfig.TLS.CAData))
Copy link
Contributor

Choose a reason for hiding this comment

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

This should minimally be a debug statement like the other discovery bits. How often does this log line print?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only when creating a launch template

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

type contextKey string

const (
restKey contextKey = "restKey"
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor

@ellistarn ellistarn left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks for driving this through

ellistarn
ellistarn previously approved these changes Sep 2, 2021
@JacobGabrielson JacobGabrielson merged commit 31c6082 into aws:main Sep 3, 2021
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.

2 participants