Skip to content
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.

Refactor Connect Inject Webhook to use webhook-cert-manager #861

Merged
merged 4 commits into from
Apr 6, 2021

Conversation

thisisnotashwin
Copy link
Contributor

@thisisnotashwin thisisnotashwin commented Mar 12, 2021

This PR is a partner to hashicorp/consul-k8s#454 and proposes the following changes:

  • Enable webhook-cert-manager whenever either controller or connectInject is enabled
  • Remove connectInject.certs values. It seems like this behavior was already broken, and we don't want to support it going forward with webhook-cert-manager.

The draft was created by @thisisnotashwin and cleanup and tests added by @ishustava.


[original description]
This is a rough draft but is at a good place to see the changes made and the impact on Helm. This will eventually be a PR against a feature-tproxy branch

@lkysow
Copy link
Member

lkysow commented Mar 17, 2021

@thisisnotashwin lmk when you want a full review, this approach looks good to me.

@thisisnotashwin
Copy link
Contributor Author

@lkysow will do. I initially hoped this PR would be reasonable isolated from the other changes getting made in the refactor but it is starting to appear a little trickier. Ill probably use this as a reference PR for a future PR that covers more of the changes. Will remove you and Iryna as reviewers to reduce some of the noise from the notifications.

@ishustava ishustava changed the base branch from master to feature/connect-refactor March 25, 2021 20:22
@ishustava ishustava changed the title WIP: mostly works but needs cleanup Refactor Connect Inject Webhook to use webhook-cert-manager Apr 6, 2021
@ishustava ishustava changed the base branch from feature/connect-refactor to feature-tproxy April 6, 2021 14:38
Comment on lines -188 to -215
livenessProbe:
httpGet:
path: /health/ready
port: 8080
scheme: HTTPS
failureThreshold: 2
initialDelaySeconds: 1
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /health/ready
port: 8080
scheme: HTTPS
failureThreshold: 2
initialDelaySeconds: 2
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 5
startupProbe:
httpGet:
path: /health/ready
port: 8080
scheme: HTTPS
failureThreshold: 15
periodSeconds: 2
timeoutSeconds: 5
Copy link
Contributor

Choose a reason for hiding this comment

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

we're removing these for the time being as we'd need to address them differently now that webhook runs through the operator-sdk. It'll be addressed in a separate PR.

@ishustava ishustava marked this pull request as ready for review April 6, 2021 14:46
@ishustava ishustava requested review from a team, lkysow and ndhanushkodi and removed request for a team April 6, 2021 14:46
Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

code reviewed only

Copy link
Contributor

@ndhanushkodi ndhanushkodi left a comment

Choose a reason for hiding this comment

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

Just had some questions more for my own understanding for things I was confused about. Otherwise, the rest of it looks good to me!!

@@ -26,7 +26,7 @@ webhooks:
name: {{ template "consul.fullname" . }}-connect-injector-svc
namespace: {{ .Release.Namespace }}
path: "/mutate"
caBundle: {{ .Values.connectInject.certs.caBundle | quote }}
caBundle: Cg==
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this has to do with base64 but what are the contents it encodes? Can we add a comment here?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah it's a base64 encoded newline. Will add!

Copy link
Contributor

@ishustava ishustava Apr 6, 2021

Choose a reason for hiding this comment

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

Actually, I realized that this property is not required, so I removed it instead to avoid confusion.

@ishustava ishustava merged commit 3346897 into feature-tproxy Apr 6, 2021
@ishustava ishustava deleted the webhook-refactor branch April 6, 2021 20:59
thisisnotashwin added a commit that referenced this pull request Apr 15, 2021
* Enable webhook-cert-manager whenever either controller or connectInject is enabled
* Remove connectInject.certs values. This behavior was already broken, and we don't want to support it going forward with webhook-cert-manager.

Co-authored-by: Iryna Shustava <[email protected]>
ishustava added a commit that referenced this pull request Apr 16, 2021
* Enable webhook-cert-manager whenever either controller or connectInject is enabled
* Remove connectInject.certs values. This behavior was already broken, and we don't want to support it going forward with webhook-cert-manager.

Co-authored-by: Iryna Shustava <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants