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

Create a Quarkus extension #1427

Closed
rhuss opened this issue Mar 10, 2019 · 15 comments
Closed

Create a Quarkus extension #1427

rhuss opened this issue Mar 10, 2019 · 15 comments
Labels
gsoc candidate for GSoC status/stale

Comments

@rhuss
Copy link
Contributor

rhuss commented Mar 10, 2019

Not 100% sure what this implies, but it would be awesome if kubernetes-client could work seamlessly with an Quarkus application.

I think this can be done by creating a Quarkus extension.

This story is a good standalone story and would be a good candidate for a GSoC task. Or for anyone interested in learning to write Quarkus extensions ;-)

This would be also a very good basis to transform https://github.com/jvm-operators to Quarkus applications. // @Jiri-Kremser @geoand @iocanel @rohanKanojia

@geoand
Copy link
Contributor

geoand commented Mar 10, 2019

It would definitely be awesome to get the Kubernetes Client to work with Quarkus on native mode!

The simplest approach I think would be to just create the declarations about reflection and whatever else the client does that doesn't work OOTB with native mode.
@gastaldi have you tried the "Quarkus" version of the Latest in native mode perhaps? That would give us an initial idea of what the problems may be.

But I think that having some sort of tighter Kubernetes / Openshift integration should also be something we need to think about.

@gastaldi
Copy link
Contributor

@geoand the only problem I have met so far is that the Jandex index is not present in the kubernetes-client JAR, even after 7ae4c56 was merged

@geoand
Copy link
Contributor

geoand commented Mar 10, 2019

Thanks for that info @gastaldi!

@jkremser
Copy link

I tried the native image last week with k8s client in version 4.1.1 (not the latest version of the client) and it built fine, but then had some troubles with creating the default k8s client new DefaultKubernetesClient() in run-time.

2019-03-11 10:58:08 ERROR Config:552 - Failed to parse the kubeconfig.
com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class io.fabric8.kubernetes.api.model.Config]: can not instantiate from JSON object (missing default constructor or creator, or perhaps need to add/enable type information?)
 at [Source: java.io.StringReader@7fa718b29df0; line: 1, column: 1]
	at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1134)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:298)
	at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:133)
	at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3807)
	at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2797)
	at io.fabric8.kubernetes.client.internal.KubeConfigUtils.parseConfigFromString(KubeConfigUtils.java:45)
	at io.fabric8.kubernetes.client.Config.loadFromKubeconfig(Config.java:466)
	at io.fabric8.kubernetes.client.Config.tryKubeConfig(Config.java:452)
	at io.fabric8.kubernetes.client.Config.autoConfigure(Config.java:204)
	at io.fabric8.kubernetes.client.Config.<init>(Config.java:192)
	at io.fabric8.kubernetes.client.ConfigBuilder.<init>(ConfigBuilder.java:16)
	at io.fabric8.kubernetes.client.ConfigBuilder.<init>(ConfigBuilder.java:13)
	at io.radanalytics.operator.Entrypoint.main(Entrypoint.java:63)

@geoand
Copy link
Contributor

geoand commented Mar 11, 2019

I think making the KubernetesClient SubstrateVM friendly is the first step to doing anything in this space. I know that @iocanel and I have talked about it a little

@rhuss
Copy link
Contributor Author

rhuss commented Mar 11, 2019

@geoand @iocanel I totally agree that SubstrateVM compatibility OOTB (without any extra help by Quarkus) would be a total killer feature for K8s intra-cluster usage (like for operators). Something which would be a clear winner feature over the standard Java K8s client.

I really would love to push hard here, maybe we should ask the Quarkus folks directly with e.g. the error message @Jiri-Kremser found above ?

@Sanne
Copy link

Sanne commented Mar 14, 2019

Relates to quarkusio/quarkus#1488

@ricardozanini
Copy link
Contributor

Hi! I'm working in a project that would benefit a lot from the Kube client if at least the Config and Authentication features was working OOTB with Quarkus.

The main problem here is in this line:
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/internal/KubeConfigUtils.java#L40

Is it possible to suggest a PR to parse the file without using reflection? If not, we'll have to manually register for reflection the entire io.fabric8.kubernetes.api.model.Config dependency tree. :(

Another option would to just annotate the entire domain with @RegisterForReflection, like @geoand suggested. :)

@geoand
Copy link
Contributor

geoand commented Jun 14, 2019

Hi, I think @iocanel would agree that the more reflection we can get rid of the better 😎

@ricardozanini
Copy link
Contributor

@geoand @iocanel if this is a yes, I'll start working on it right now. 😝

@geoand
Copy link
Contributor

geoand commented Jun 14, 2019

I would say @iocanel has the final say on this 😉

@ricardozanini
Copy link
Contributor

@geoand many thanks for your help!! Let's wait for @iocanel then. 😎

@ruromero
Copy link

I had the same experience as @ricardozanini Adding a @BuildStep to the BouncyCastle class just raised more errors and I finally had to give up.
So far it seems to be working with the kubernetes-client although I haven't done too fancy things. I must say that depending on how you create the config you must add the flags that @ricardozanini mentioned but that's the magic of GraalVM 😄

@iocanel
Copy link
Member

iocanel commented Jun 15, 2019

Parsing the config without reflection sounds good to me.

@stale
Copy link

stale bot commented Sep 13, 2019

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

@stale stale bot added the status/stale label Sep 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gsoc candidate for GSoC status/stale
Projects
None yet
Development

No branches or pull requests

9 participants