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

cainjector fails to start if it can't list Certificates #3251

Closed
wallrj opened this issue Sep 4, 2020 · 4 comments · Fixed by #3254 or #3275
Closed

cainjector fails to start if it can't list Certificates #3251

wallrj opened this issue Sep 4, 2020 · 4 comments · Fixed by #3254 or #3275
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Milestone

Comments

@wallrj
Copy link
Member

wallrj commented Sep 4, 2020

cainjector watches secrets, webhooks, customresources and Certificates as event sources for its controller-runtime based reconciliation queue.

As it starts up it attempts to list all these resources to populate informer caches, before it begins reconciling any of them.
If any of these resources can not be listed then none of them are reconciled, which leads to a chicken-egg problem, in some cases.

When it attempts to list Certificates of version X where the CRDs specify a different API primary or storage version,
then the K8S API server needs to be able to perform a conversion via the cert-manager conversion webhook.

But if this is after a re-install of the CRDs, then cainjector will not yet have updated the CRDs with the caBundle of the cert-manager webhook.

Instead, cainjector should be able to perform secret based reconciliation to update CRDs and webhook configurations independently of the Certificate based reconciliation.

This may be the reason that cainjector used to run two goroutines with two separate controller-runtime managers for each of these, which we removed in #3187

See discussion at https://kubernetes.slack.com/archives/C4NV3DWUC/p1599044537041800

/cc @jfrancisco0 @meyskens

/kind bug

@jetstack-bot jetstack-bot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 4, 2020
@munnerz
Copy link
Member

munnerz commented Sep 4, 2020

Possibly related to #3187?

Edit: d'oh, you already said that

@munnerz
Copy link
Member

munnerz commented Sep 4, 2020

This may be the reason that cainjector used to run two goroutines with two separate controller-runtime managers for each of these, which we removed in #3187

Yeah, I think you may be correct... I should have documented this/commented it when adding support for injecting directly from Secret resources 🙈

@meyskens
Copy link
Contributor

meyskens commented Sep 4, 2020

/milestone v1.0
/priority critical-urgent

@jetstack-bot jetstack-bot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Sep 4, 2020
@jetstack-bot jetstack-bot added this to the v1.0 milestone Sep 4, 2020
@wallrj
Copy link
Member Author

wallrj commented Sep 4, 2020

/assign @wallrj

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now.
Projects
None yet
4 participants