controller-tools icon indicating copy to clipboard operation
controller-tools copied to clipboard

Unable to make multiple webhook-enabled controller deployments

Open muvaf opened this issue 3 years ago • 6 comments

In Crossplane, we have a single webhook server for core Crossplane controllers and an arbitrary number of webhooks deployed by the provider controllers. All of those are usual controller-runtime controllers and webhooks.

However, the generated ValidatingWebhookConfiguration and MutatingWebhookConfiguration files have static hard-coded names, which means that when we install one or more providers, they override the original configuration that was installed for Crossplane itself. So, the providers and Crossplane fight over a single object.

We could either add a new field to the webhook marker or derive the name from somewhere smart enough that it will differentiate one another.

I'd be willing to contribute the change if we can come to a solution/workaround.

muvaf avatar Mar 07 '22 14:03 muvaf

@muvaf Does this mean that it's actually not possible to install two controller managers that a) are built with kubebuilder/controller-tools, and b) use webhooks? That does seem like a problem.

negz avatar Mar 15 '22 01:03 negz

@negz That's what I can tell. There might be some point during the deployment of the controller where the names of these resources are patched but I couldn't find it. This is an example project referenced from the kubebuilder book.

muvaf avatar Mar 28 '22 16:03 muvaf

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 26 '22 16:06 k8s-triage-robot

/remove-lifecycle stale

negz avatar Jul 07 '22 18:07 negz

However, the generated ValidatingWebhookConfiguration and MutatingWebhookConfiguration files have static hard-coded names, which means that when we install one or more providers, they override the original configuration that was installed for Crossplane itself. So, the providers and Crossplane fight over a single object.

@muvaf Not at all. Take this sample project in Kubebuilder as an example:

Although the ValidatingWebhookConfiguration and MutatingWebhookConfiguration YAMLs generated by controller-tools have names mutating-webhook-configuration and validating-webhook-configuration (see), but it has kustomize namePrefix which should be the project name (see).

So when you make deploy, which actually executes $(KUSTOMIZE) build config/default | kubectl apply -f -, kustomize will generate names of the real webhook YAMLs as <project-name>-mutating-webhook-configuration and <project-name>-validating-webhook-configuration.

Unless you have two different services of webhook configurations in a same project scaffolded by Kubebuilder, that is not supported by controller-tools.

FillZpp avatar Jul 08 '22 03:07 FillZpp

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Oct 06 '22 04:10 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Nov 05 '22 04:11 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Dec 05 '22 04:12 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Dec 05 '22 04:12 k8s-ci-robot