-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Introduce a Kubernetes client #1488
Comments
As far as I know @iocanel is working on eliminating the reflection from the KubernetesClient. Once that is done, I think we could utilize Quarkus in the jvm-operators project that @Jiri-Kremser has created |
Right. Here's the relevant pull request: fabric8io/kubernetes-client#1433 |
I'd love to try this out again once this is merged and available in central. |
Definitely, the maven plugin for the native builds looks promising. Some changes needs to be done to the current abstract-operator, like removing the reflection calls (or putting them in the list to that json file) and some minor refactoring of the static methods, but nothing difficult. Currently, I am blocked by the run-time issues in the f8-k8s client when performing calls using the ok http client. |
@iocanel Do you think that the kubernetes-client will be able to run ootb with Quarkus or do you think we would need a dedicated extension (like mention in fabric8io/kubernetes-client#1427) ? |
@rhuss: I think it eventually will be able to run out of the box. I don't see why we would need an extension. |
For whom might be interested, I made some experimentations with both k8s clients (Fabric8 and the Client Java) in native environment that can be viewed here. Basically both worked pretty well with token authentication relying on registering the domain model to be used with reflection. In a more broader usage scenario, the entire domain model should be registered. |
@ricardozanini Nice! Could you describe what changes you needed to make? We haven't actually done any real work on our side, but the very simple attempts we had done to use the kubernetes client with quarkus to create a native binary stumbled on some okhttp + ssl issues on graalvm |
FWIW I did few tests today with kubernetes client and I just had to enable the JNI flag to make the native build do a simple watch. |
Very interesting, @iocanel and I will have to take a closer look |
Hi @geoand! For the "official" kubernetes client I had to:
For the Fabric8 client, was almost the same configuration except for the The problem lies on the JSON Serialization library. Kubernetes Java uses GSON and Fabiric8 Jackson. Both heavy reflection users. I intent to have a look on how you guys are working with JSON serialization with JSON-B to implement our own k8s client for our needs (at least at this stage of development), since we are trying to stay away from reflection at all. The last resort will rely on JSON Path libraries to get what we need from the API responses. :( |
Thanks for the info! |
Nice @ricardozanini ! |
There is now a PR for this. |
this was my "one-liner" :)
|
@jkremser The PR assuming it will be merged will shield you from all that GraalVM native-image complexity :) |
PR for not using reflection has been released in the kubernetes client since 4.2.0 currently we are 4.3.0 so it should work. |
@lordofthejars there were still some reflection issues that needed to be addressed to make the Client work on GraalVM, hence the need for the extension |
Sure, anything you need from Kubernetes client just pings us and we will release ASAP. |
Thanks :) We should be good for the time being, but I'll definitely let you know whatever comes up |
In an attempt to deploy a test Operator into Kubernetes using QuarkusIO, I encountered errors using both the Fabric8 client and the official Java client. Fabric8 uses reflection in some base classes, so fails at runtime and the official Java client had errors compiling to a native image because of optional dependencies for Azure Kubernetes.
It would be really awesome to have native-image support for Kubernetes Operators via a client that was developed for (and tested on) AWS, Azure, GKE, minikube, OpenShift, etc... so that Kubernetes users could easily on-ramp resources that connect to the API server (a la Operators).
The text was updated successfully, but these errors were encountered: