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
Draft
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
:_content-type: ASSEMBLY
:description: Running containers with kubedock
:keywords: kubedock, container
:navtitle: Running containers with kubedock
:page-aliases:

[id="running-containers-with-kubedock"]
= Running containers with kubedock

link:https://github.com/joyrex2001/[Kubedock] is a minimal container engine implementation that gives you a podman-/docker-like experience inside a {prod-short} workspace. Kubedock is especially useful when you are dealing with ad-hoc, ephemeral, and testing containers, such as in the use cases listed below:

Check failure on line 10 in modules/administration-guide/pages/running-containers-with-kubedock.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'.", "location": {"path": "modules/administration-guide/pages/running-containers-with-kubedock.adoc", "range": {"start": {"line": 10, "column": 109}}}, "severity": "ERROR"}

* Executing application tests which rely on link:https://testcontainers.com/[Testcontainers] framework.

* Using link:https://quarkus.io/guides/dev-services[Quarkus Dev Services].

* Running a container stored in remote container registry, for local development purposes

[IMPORTANT]
====
The image you choose to use with kubedock must be compliant with Openshift security requirements.
Otherwise, running the image with kubedock will result in a failure even though the same image runs locally without issues.
====

.Enabling kubedock

After enabling the kubedock environment variable, kubedock will run the following `podman` commands:

* `podman run`
* `podman ps`
* `podman exec`
* `podman cp`
* `podman logs`
* `podman inspect`
* `podman kill`
* `podman rm`
* `podman wait`
* `podman stop`
* `podman start`

Other commands such as `podman build` are started by the local podman instead.

Check failure on line 40 in modules/administration-guide/pages/running-containers-with-kubedock.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'.", "location": {"path": "modules/administration-guide/pages/running-containers-with-kubedock.adoc", "range": {"start": {"line": 40, "column": 64}}}, "severity": "ERROR"}

[IMPORTANT]
====
Using `podman` commands with kubedock has following limitations

* The `podman build -t <image> . && podman run <image>` command will fail. Use `podman build -t <image> . && podman push <image> && podman run <image>` instead.
* The `podman generate kube` command is not supported.
* `--env` option causes the `podman run` command to fail.
====

.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


.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.


[NOTE]
====
You must configure podman or docker API to point to kubedock setting

Check failure on line 59 in modules/administration-guide/pages/running-containers-with-kubedock.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'.", "location": {"path": "modules/administration-guide/pages/running-containers-with-kubedock.adoc", "range": {"start": {"line": 59, "column": 20}}}, "severity": "ERROR"}
`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.

Check failure on line 61 in modules/administration-guide/pages/running-containers-with-kubedock.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'.", "location": {"path": "modules/administration-guide/pages/running-containers-with-kubedock.adoc", "range": {"start": {"line": 61, "column": 29}}}, "severity": "ERROR"}

Check failure on line 61 in modules/administration-guide/pages/running-containers-with-kubedock.adoc

View workflow job for this annotation

GitHub Actions / Linting with Vale

[vale] reported by reviewdog 🐶 [RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'. Raw Output: {"message": "[RedHat.CaseSensitiveTerms] Use 'Podman' rather than 'podman'.", "location": {"path": "modules/administration-guide/pages/running-containers-with-kubedock.adoc", "range": {"start": {"line": 61, "column": 54}}}, "severity": "ERROR"}
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

====