-
Notifications
You must be signed in to change notification settings - Fork 190
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
Creating kwok cluster during docker build fails to be accessible after running the container #1077
Comments
It looks like you’re missing this in your RUN section “go install sigs.k8s.io/kwok/cmd/{kwok,kwokctl}@${KWOK_LATEST_RELEASE}” |
Not required, if you don't use
When the container starts, the only process running is your shell, the cluster doesn't actually start. |
This didn't help and I'm still experiencing the same error.
I'm trying to run
So how can I make the cluster run in the background? Do I have to include the cluster creation command on the entrypoint/cmd? |
Yes |
How to use it?
What happened?
I'm trying to create a container containing a cluster created on build time (running
kwokctl create cluster
on Dockerfile). When running the container, the cluster is shown as created (after running the container and entering it, runningkwokctl get clusters
returns the proper result), but the cluster is inaccessible (runningkwokctl kubectl get pods
for example, returns connection refused on port 32764 - the default port kwok opens on cluster creation). Moreover, when creating a new cluster, it creates the cluster on the same port successfully (and new cluster is accessible).I saw on the examples in this repository that the cluster is served using kubectl proxy. Is it a must to access the cluster? I couldn't find documentation about building an image with the cluster, especially when the kwok is meant to run in the background and the entrypoint is another application.
From what I saw, the cluster creation during the build was fine and all the files under
/root/.kwok/clusters/<my-cluster>
are fine. I tried also to move the creation of the cluster command to the entrypoint, without success.What did you expect to happen?
Cluster is running on that port after creating and running the container. Entering the container and running
kubectl get pods
shouldn't return connection refusedHow can we reproduce it (as minimally and precisely as possible)?
The Dockerfile:
And inside the container the results of the commands:
Anything else we need to know?
I'm not sure if this behavior should be expected or not, though I don't see any reason for it to fail.
Kwok version
OS version
$ uname -a
Linux 193b14697e0f 6.5.0-28-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024 x86_64 GNU/Linux
On Darwin:
$ uname -a
paste output here
On Windows:
C:> wmic os get Caption, Version, BuildNumber, OSArchitecture
paste output here
The text was updated successfully, but these errors were encountered: