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

Allow to preconfigure dev services container for Kubernetes #38138

Open
AleksanderBrzozowski opened this issue Jan 11, 2024 · 3 comments · May be fixed by #38795
Open

Allow to preconfigure dev services container for Kubernetes #38138

AleksanderBrzozowski opened this issue Jan 11, 2024 · 3 comments · May be fixed by #38795

Comments

@AleksanderBrzozowski
Copy link

Description

We have a Kubernetes Operator implemented with Java Operator SDK and Quarkus.

For integration tests, we leverage dev services for Kubernetes provided by Quarkus:

  kubernetes-client:
    devservices:
      enabled: true
      flavor: k3s
      override-kubeconfig: true

Under the hood, a K3S Kubernetes distribution is provisioned and used for test purposes.

What do we lack from this setup is an ability to test ValidatingWebhookConfiguration resource from Kubernetes. We want to add a validation webhook to one of the resources that the Operator reconciles, therefore we expose a validation endpoint that is later called by Kubernetes API Server when a resource is changed.

The problem is that it is not possible to test this scenario with the current implementation, because there is no way to call the service from within Kubernetes docker container:

webhook: Kubernetes container --port: 8444--> Quarkus application 

I was able to test this scenario when I explicitly created a container and enabled accessToHost:

K3sContainer()
            .withAccessToHost(true)
            .apply { start() }

Then I had to expose port, like below, and a call started to work:

Testcontainers.exposeHostPorts(8444)

To sum up, I am wondering if it is possible to expose a property, for example:

  kubernetes-client:
    devservices:
      accessToHost: true / false # new property

What do you think?

Implementation ideas

No response

Copy link

quarkus-bot bot commented Jan 11, 2024

/cc @geoand (devservices,kotlin,kubernetes), @iocanel (kubernetes), @stuartwdouglas (devservices)

@geoand
Copy link
Contributor

geoand commented Jan 11, 2024

I'll leave this one to @metacosm and @csviri since they SMEs

@csviri
Copy link

csviri commented Jan 11, 2024

sure, this makes sense to me, I can take a look in coming weeks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants