-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
A unique hostPort is not generated when using extraPortMappings without specifying hostPort. #3301
Comments
/assign @aroradaman |
I'm curious about this use case, how do you know which port is assigned to the container then? |
For the usecase I have, essentially i actually don't want/need to expose anything to the host port. What i do is run another independent container The previous behaviour i've sees is that it selects a random hostPort v0.18.0 of kind, so when I raised this issue essentially i'm looking for the same behaviour, otherwise a few or my test envs break. I suppose the option to also not expose to a hostPort sounds like a good feature and would serve this usecase. |
no no, do not misunderstand me, the bug is legit, the behavior should be recovered, is that I was curious to understand the use case |
All good, no misunderstanding here. Hope i've clarified the use case. Essentially it's being able to create complex multi container envs that network with the kind cluster. In my case i'm testing istio in a multi cluster setup, also additional containers pretending to be vms in a cloud env which are networked with kubernetes. |
Following up on this issue, are there any updates or decision on how this will move forward? I see there's an op PR but has been blocked. If that's just an implementation detail that would be good to know or if this is the intended behaviour and there is no intention to change it back to the previous behaviour then i'll look at investing some other sort of work around. Either way it would be good to know the path forward. |
#3302 has outstanding review comments. If you'd like to help someone could try again. |
@prahaladramji #3513 fixes the issue |
@aroradaman: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What happened:
Creating a kind cluster without any
hostPort
defined in theextraPortMappings
should use random but uniquehostPort
. However it seems like it's using the same and so fails before cluster creation during validation. This was/is working as expected with kind v0.18.0There is a workaround if creating only 1 cluster, which is to manually add
hostPort
and select a unique port. However this does not scale when we need to run multiple kind cluster. (eg for demonstrating or testing a multi cluster to replacate a multi region behaviour etc).What you expected to happen:
The kind cluster to be created successfully
How to reproduce it (as minimally and precisely as possible):
Given the below config file and creating a cluster will fail with the folloing error.
command run:
kind create cluster --config config.yaml
Anything else we need to know?:
This error only occurs after #3175 so all version from v0.19.0 on wards.
v0.18.0 continues to work as expected.
Environment:
kind version
): v0.20.0docker info
orpodman info
): Docker engine 24.0.2/etc/os-release
): OSX 13.4kubectl version
): 1.24.15The text was updated successfully, but these errors were encountered: