Skip to content

Use ca.NewCA() for generating certs and keys for the proxy injector#2163

Merged
alpeb merged 10 commits intomasterfrom
alpeb/webhook-reuse-ca
Jan 30, 2019
Merged

Use ca.NewCA() for generating certs and keys for the proxy injector#2163
alpeb merged 10 commits intomasterfrom
alpeb/webhook-reuse-ca

Conversation

@alpeb
Copy link
Member

@alpeb alpeb commented Jan 28, 2019

Use ca.NewCA() for generating certs and keys for the proxy injector instead of grabbing the trust anchor from the linkerd-ca-bundle ConfigMap, as well as avoiding having to watch linkerd-proxy-injector-service-tls-linkerd-io secrets for the cert and key used for the injector's TLS server.

This is just a POC. If this approach is accepted, the next step is to remove all the code that was dealing with those secrets.

Fixes #2095

@alpeb alpeb force-pushed the alpeb/webhook-reuse-ca branch from 6ae8d62 to 0ed4083 Compare January 28, 2019 14:49
@alpeb alpeb self-assigned this Jan 28, 2019
@olix0r
Copy link
Member

olix0r commented Jan 28, 2019

Should the ca logic be put somewhere in pkg/ to indicate it's a library? Is the controller/ca package generic library code or code related to our current CA? I'd opt to depend on generic code, rather than code related to our CA, which will have to change substantially in an upcoming change.

This isn't a blocker, just an organizational note.

@alpeb
Copy link
Member Author

alpeb commented Jan 28, 2019

@ver yea, ca.go is pretty generic so we can move it into /pkg. The more specific stuff dealing with the resources watching and secrets updating lives in /controller/ca/controller.go.

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

This looks like the right approach to me. I'd love to see some refactoring here to allow the proxy-injector to use as much of the generic CA code as possible, and I called that out in my comments below.

@alpeb
Copy link
Member Author

alpeb commented Jan 29, 2019

My last push is broken into 4 commits like so:

  • Moved ca.go into /pkg/tls
  • Merged the smaller tls.go with ca.go and addressed @klingerf's comments
  • Cleaned up and de-coupled the CA controller and the proxy-injector
  • Removed the need to use --tls during install to have the proxy injector work
  • Updated tests

Let me know what you think 🙏

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

Awesome! I am really excited for this change. Just had a few more cleanup suggestions, and then it should be good to go.

image

😻

Copy link
Contributor

@klingerf klingerf left a comment

Choose a reason for hiding this comment

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

⭐️ Looks great, thanks for updating!

alpeb added 10 commits January 30, 2019 15:13
Signed-off-by: Alejandro Pedraza <[email protected]>
- Remove from CA controller everything that dealt with the
webhook/proxy-injector
- Remove no longer needed proxy-injector volumes for 'trust-anchors' and
'webhook-secrets'
- Remove from the proxy-injector the retrieval of the trust anchor and
secrets

Signed-off-by: Alejandro Pedraza <[email protected]>
Signed-off-by: Alejandro Pedraza <[email protected]>
Signed-off-by: Alejandro Pedraza <[email protected]>
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.

4 participants