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

Pod based webhooks should only be enabled if one wants to use pod integration #4120

Open
kannon92 opened this issue Jan 31, 2025 · 6 comments

Comments

@kannon92
Copy link
Contributor

ref: #4074

There are many cases where people do not want to enable pod based integrations as it can potentially cause an entire cluster to be quota limited by Kueue.

Even if one disables this, these webhooks can still be hit as they are added to all kueue deployments. In the above example, those webhooks caused a critical service in openshift to not create certificates.

We would like to explore ways to only enable the webhooks if pod-based integration is enabled.

Since Pod based workloads are not enabled by default, could we disable the webhooks by default?

@mimowo
Copy link
Contributor

mimowo commented Feb 3, 2025

Im surprised, I thought they get enabled based on the enablement of the pod integration. similarly we are enabling the job webhooks only when the particular job integration is enabled. Can you double check the webhooks are enabled whilst the pod integration is disabled?

cc @mbobrovskyi @dgrove-oss

@mbobrovskyi
Copy link
Contributor

mbobrovskyi commented Feb 3, 2025

By default all pod-based integrations disabled:

# - "pod"
# - "deployment" # requires enabling pod integration
# - "statefulset" # requires enabling pod integration
# - "leaderworkerset.x-k8s.io/leaderworkerset" # requires enabling pod integration

When integration is disabled, we use NoopWebhook:

if err := setupNoopWebhook(mgr, cb.JobType); err != nil {
return fmt.Errorf("%s: unable to create noop webhook: %w", fwkNamePrefix, err)
}

I also rechecked it manually.

@mimowo
Copy link
Contributor

mimowo commented Feb 3, 2025

hmmm, wondering if the no-op webhook might still require API server to send the object to the webhook server for mutations?

if so then instead of registering no-op it is probably better not to register it at all

@mimowo
Copy link
Contributor

mimowo commented Feb 3, 2025

I synced with @mbobrovskyi we register the no-op webhooks, because we rely on the webhook registration generated by kubebuilder: https://github.com/kubernetes-sigs/kueue/blob/main/config/components/webhook/manifests.yaml.

I agree registering the no-op webhooks is not ideal but to avoid it we would need to either:

  1. place the registration in a dedicated opt-in manifest file and request users to install them, when they forget we need a clear message what is missing
  2. add the registrations from Kueue code when we detect the Pod integration is enabled - could work, but sending the patches by Kueue post installation might be surprising to users.
  3. just guide users which are performance sensitive how to delete the registrations in docs

I don't have a clear opinion which one is best.

@kannon92
Copy link
Contributor Author

kannon92 commented Feb 3, 2025

I don’t either. We are working on an operator where we would remove these from the manifest based on frameworks before installation. That is probably difficult to do with kustomize.

I think docs may be important because the default namespace selector seems to be valid for Kind but other clusters would need to consider expanding the excludes. I’m not even sure if our helm chart customizes that..

@varshaprasad96
Copy link
Member

varshaprasad96 commented Feb 3, 2025

Looks like #4141 is also a side-effect of applying webhook configurations for all the frameworks together. I'm leaning a bit towards (1) - having webhook configurations for each framework in separate Kustomize directories. Users would have to manually uncomment patches for the integrations they have enabled explicitly. This would be an additional step, but a one-off task required when modifying config.yaml.

The helm charts seem to handle it well already through templating and ignoring the admission checks if integrations are not enabled:

{{- if has "pod" $integrationsConfig.frameworks }}
failurePolicy: Fail
{{- else }}
failurePolicy: Ignore

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

No branches or pull requests

4 participants