DevServices with Kubernetes

127 views
Skip to first unread message

Alex Soto Bueno

unread,
Mar 1, 2022, 11:49:19 AM3/1/22
to Quarkus Development mailing list
Hi mates, I know it is an old yet under discussion topic, but I was thinking that it will be really useful to allow DevServices works in Kubernetes so I don't need a Docker Host installed in my machine.

I have created a simple snippet that of course it is not covering everything but just shows the simple code you need to do to start a MariaDB in Kubernetes. The special things to provide are shown in the private method.



But named QuarkusMariaDBKubernetes. Probably a common interface could be abstracted and then just do a if(dockerAvailable) do this if not if(kubernetesAvailable) do that

Probably I'm not adding anything new to this topic but I just wanted to share my bits and maybe it helps.

Georgios Andrianakis

unread,
Mar 2, 2022, 2:01:24 AM3/2/22
to Alex Soto Bueno, Quarkus Development mailing list
Hey Alex,

I think Stuart actually had a PoC around something similar.

--
You received this message because you are subscribed to the Google Groups "Quarkus Development mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to quarkus-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/quarkus-dev/76a7935b-0194-4e7f-85f2-16ab075be0d3n%40googlegroups.com.

Stuart Douglas

unread,
Mar 2, 2022, 2:12:48 AM3/2/22
to Alex Soto Bueno, Quarkus Development mailing list
I started experimenting with an approach similar to kubedock (https://github.com/joyrex2001/kubedock) before I realised kubedock existed.

Have you tried it out? Basically it emulates the docker HTTP API and translates them into kube commands.

My Java based PoC that did the same thing is here: https://github.com/stuartwdouglas/kubeman

Basically this just allowed the existing code to 'just work' but with a kube backend.

Stuart


Ioannis Canellos

unread,
Mar 2, 2022, 2:56:21 AM3/2/22
to sdou...@redhat.com, Alex Soto Bueno, quark...@googlegroups.com
From my point of view this approach is good enough.

The comment about DevServices and Kubernetes got me thinking though.
Would it make sense to optionally include the DevServices in the generated Kubernetes manifests?
Maybe as an easier way to get onboard on Kubernetes or even to decleratively create a testing environment on Kubernetes?

Alex Soto Bueno

unread,
Mar 2, 2022, 4:41:41 AM3/2/22
to Ioannis Canellos, Stuart Douglas, Quarkus Development mailing list
I have been working a bit with kubedock. One of the things I saw is that creates a proxy server and it is written in Go, which means that you need to download, run it as a CLI tool and start the correct version of the tool (Mac, Win, Linux) so I think that it could be not a valid option for Quarkus. 

The idea of Ioannis is a really cool idea and it could be used also in DevServices, as we could say something like if Kubernetes extension is present and the property kubernetes.deploy=true and in devmode then do a kubectl apply of the devservices and port forward them. And then the generated manifests could be used either for QA staging or for devsevices so we don't need to create any docker proxy or like in my example fabric8 kubernetes client integration.

William Burke

unread,
Mar 2, 2022, 8:40:25 AM3/2/22
to Stuart Douglas, Alex Soto Bueno, Quarkus Development mailing list
Stuart,

Emulation approaches like these always worry me.  
* They still require some setup specific to the emulator
* They can get out of sync with the thing they emulate

Unless somebody is constantly going back and forth from docker and kube, I as an app developer, would rather work directly with Kube or Docker.



--
Bill Burke
Red Hat

Alex Soto Bueno

unread,
Mar 2, 2022, 10:05:53 AM3/2/22
to William Burke, Stuart Douglas, Quarkus Development mailing list
William what you mention is true, for this reason, I was purposing to create a direct integration to Kubernetes with Fabric8 as in my snippet or using the Dekorate approach mentioned by Ioannis. Said that emulation has the big advantage that the integration should be fairly easy and reduce the amount of code to use, but also it has another disadvantage, you need to be able to configure some Kube parameters in case of OpenShift to make work the images, so well something that should be studied for sure.


Reply all
Reply to author
Forward
0 new messages