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

[draft] Running containers with kubedock (crw-3367) #2710

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

deerskindoll
Copy link
Contributor

What does this pull request change?

What issues does this pull request fix or reference?

Specify the version of the product this pull request applies to

Pull Request checklist

The author and the reviewers validate the content of this pull request with the following checklist, in addition to the automated tests.

  • Any procedure:
    • Successfully tested.
  • Any page or link rename:
    • The page contains a redirection for the previous URL.
    • Propagate the URL change in:
  • Builds on Eclipse Che hosted by Red Hat.
  • the Validate language on files added or modified step reports no vale warnings.

@deerskindoll deerskindoll self-assigned this Mar 27, 2024
Copy link

github-actions bot commented Mar 27, 2024

⚡️ Deploying pull request preview...

@che-bot che-bot added this to Triage in Reviews Mar 27, 2024
Copy link

github-actions bot commented Mar 27, 2024

Click here to review and test in web IDE: Contribute

@deerskindoll
Copy link
Contributor Author

deerskindoll commented Apr 4, 2024

feedback from Anton:

I would really appreciate if we could add some more context explaining why kubedock is useful. The docs says
Use kubedock to run containers as Kubernetes pods.

And while that is technically true, you can also use devfile to run containers. Or k8s deployment. Kubedock is minimal container engine implementation which gives you podman(or docker)-like experience inside Dev Spaces Workspace. Developers are used to using podman/docker during their local development workflow, and kubedock brings that experience onto the OpenShift, inside Dev Spaces.. This is otherwise incredibly hard to achieve due to the inherent OpenShift security restrictions. Kubedock is specifically useful when dealing with ad-hoc, ephemeral and testing containers. Suitable use cases are (list is not exhaustive)

  1. Executing applications tests which rely on Testcontainers framework - kubedock will dynamically spin up required test container image , on the fly, as an OpenShift pod, giving user seamless experience.

  2. Quarkus Dev Services - which are internally relying on Testcontainers as well.

  3. When you are in need to you to run a container stored in remote container registry, for local development purposes and for whatever reasons you don't want to pollute the devfile . It's very important to mention (even though this is obvious!) that even though it gives you podman-like experience which you are used to from your local development environment, the absolute hard requirement is that the particular image which is being used via kubedock must be compatible with OpenShift. I specifically have security requirements in mind - i.e. not every container image which can be executed in your local machine, can also be executed on OpenShift. So if you do podman run - it will fail with kubedock, and it will work locally. (edited)

Once the use cases/motivation is explained, it would really good if we can share an example devfile.yaml, but ideally with accompanied git repo as well. I know this is hard, because including public github link in official documentation is always risky, so not sure what is the general rule of thumb for tech writers.

Container Image Guidelines for OpenSHift are here https://docs.openshift.com/container-platform/4.15/openshift_images/create-images.html - For example, the kafka-native testcontainer wasn't compatible with openshift - it only worked in local environment. So user who used this testcontinaer locally, would be surprised if he tried to use it via kubedock in dev spaces. We had to reach out to upstream community and they had to refactor that image, so it would become OCP-compatible (luckily, the image owner was Red Hatter as well..). I am just sharing all my experience accumulated over the past weeks..

@deerskindoll
Copy link
Contributor Author

@agiertli let me know if you like it. I didn't include some of the details because I felt the content is pretty self-explanatory.

====

.Prerequisites
* An image compliant with Openshift security requirements.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to list those requirements explicitly

* An image compliant with Openshift security requirements.

.Process
. Add `KUBEDOCK_ENABLED=true` environment variable to the devfile.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please share an actual devfile example with such env variable defined, it makes it easier for users to follow this.

====
You must configure podman or docker API to point to kubedock setting
`CONTAINER_HOST=tcp://127.0.0.1:2475` or `DOCKER_HOST=tcp://127.0.0.1:2475` when running containers.
However, you must configure podman to point to local podman when building the container.
Copy link

@agiertli agiertli May 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be an example devfile shared in documentation.

I would also mention that user can supply additional kubedock parameters via KUBEDOCK_PARAMS as demonstrated here:

https://github.com/agiertli/quarkus-workshops/blob/main/devfile.yaml#L14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Reviews
  
In progress
2 participants