-
Notifications
You must be signed in to change notification settings - Fork 262
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
Questions on creating external AC controller for Kueue #3249
Comments
Hi @leipanhz, The dependencies ,I think, you are referring to are just built-time dependencies, meaning the admission check controllers are using some public packages of Kueue as utilities (e.g. |
/assign |
@trasc I am new to Kubernetes, I have some detailed questions:
If you can explain steps needed for implementing external admission check to integrate with Kueue, that will be very helpful. Thank you. |
I am working a simplified |
@trasc Thank you for providing example of demo-acc! I hit an error during compilation: |
|
The v0.8.1 version I used seems to be the latest stable release: https://github.com/kubernetes-sigs/kueue/releases/tag/v0.8.1. I found v0.9.0-devel is the only higher version than v0.8.1. After trying, still seeing the same issue (with other errors): # sigs.k8s.io/kueue/pkg/features If I need to downgrade k8s.io/component-base, can you please recommend a version number? |
Check the version kueue 0.8.1 is using (in kueue's go.mod) You can also use kueue@main, temporarily, we will release v0.9.0 shortly. |
I downgraded versions of a few packages to be compatible with kueue 0.8.1. I am able to run makefile and build image. However, when I deployed the image, the controller-manager is crashing with the following error: Then in the kueu repo, I pulled demo-acc, built and deployed for comparison. The kueue controller manager crashes too, but for a different error (I don't have this issue with mainline code before 9/6): Do you have any suggestions for me to move forward? Happy to schedule an online troubleshooting session at your convenient time if that works for you. Btw, attached is the go.mod file used in my controller. Thank you for your time. |
Hi, For the first part:
I likely because the Kueue's API is not registered in the scheme, you'll need to do something like @@ -34,6 +34,7 @@ import (
"sigs.k8s.io/controller-runtime/pkg/metrics/filters"
metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
"sigs.k8s.io/controller-runtime/pkg/webhook"
+ kueueapi "sigs.k8s.io/kueue/apis/kueue/v1beta1"
"sigs.k8s.io/kueue/cmd/experimental/demo-acc/internal/controller"
// +kubebuilder:scaffold:imports
@@ -46,6 +47,7 @@ var (
func init() {
utilruntime.Must(clientgoscheme.AddToScheme(scheme))
+ utilruntime.Must(kueueapi.AddToScheme(scheme))
// +kubebuilder:scaffold:scheme
} I your controller's The second part:
It's likely because the manifests in your cluster are out of sync with the kueue's controller-manager. Not long ago, we've moved the MultiKueue APIs from |
@trasc, I followed your comments and was able to resolve most issues, thank you! For the multikueue issue: after removing some previously defined CRDs related to multikueue, and recompile with all cache cleaned, the error is gone. Note that, there are other errors related to webhook when running "make deploy", for example: For the first part (with my external controller), there is a mistakes in imports. After fixing that, the admission check registration issue was resolved. I encountered different errors, but that is probably related to my system setup and implementation. I am looking into them, and will reach out if I have additional questions about Kueue integration. Appreciate your knowledge sharing. |
@trasc I noticed there is always an error message when an Admissioncheck is created, from kueue/vendor/k8s.io/apiserver/pkg/registry/generic/registry/store.go, and the log information is not printed in the controller log, although admissioncheck is up running: 2024-10-23T20:57:16Z INFO Starting Controller {"controller": "admissioncheck", "controllerGroup": "kueue.x-k8s.io", "controllerKind": "AdmissionCheck"} Is this related to the package version or something else? I am using kueue v0.8.1 image. |
No, this happens because there are two controllers trying to update the same resource at the same time, one of them will get the conflict, however, when this happens controller-runtime will queue another reconcile request for that object and eventually will succeed. |
I don't see any logs from the other reconciler (the custom controller) after the error. Do you have any suggestions? |
No error is an indication that nothing went wrong :). In the demo-acc, the AC reconciler has only one job, to set the The testing step: It should get marked as kubectl get admissionchecks.kueue.x-k8s.io demo-ac -o=jsonpath='{.status.conditions[?(@.type=="Active")].status}{" -> "}{.status.conditions[?(@.type=="Active")].message}{"\n"}' Checks if that in fact happening. |
Sorry, I meant the info level logs added in the reconcile code didn't show as expected, after the above error message was printed. I tested on demo-ac and my controller, in both cases there are no logs printed even though the reconcile requests seems working. Is there anything I missed?
Yes this works |
I realized this is related to log level setting. I thought V(2) would enable printing logs by default, but it isn't. Feel free to resolve the issue. Thanks! |
You can add |
Thanks for your support @trasc |
In the doc and repo, there is an example for additional AdmissionCheck: ProvisioningRequest, but it's part of Kueue source code. It seems the implementation of admissin check controller has high dependencies with Kueue. Are there examples and documentations for a separate external AdmissionCheck controller that works with Kueue
The text was updated successfully, but these errors were encountered: