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

minikube node add fails if --ports was given to initial minikube start #16766

Open
everflux opened this issue Jun 24, 2023 · 12 comments
Open

minikube node add fails if --ports was given to initial minikube start #16766

everflux opened this issue Jun 24, 2023 · 12 comments
Labels
co/multinode Issues related to multinode clusters kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@everflux
Copy link

What Happened?

I started a single node cluster

minikube start --cpus 4 --memory 16384 --ports 80:80 --driver docker

and wanted to add an additional node afterwards

minikube node add

It uses a different configuration for the added node as the memory shows:

Creating docker container (CPUs=4, Memory=2200MB) ...

The creation fails since port 80 is bound to the first node

stderr:
docker: Error response from daemon: driver failed programming external connectivity on endpoint minikube-m02 (5f7a38f17f200fee0130c69df5aad7f54357fa86e0517d7cb3d08c483504f648): Bind for 0.0.0.0:80 failed: port is already allocated.

It would be great if the added node would not inherit the "--ports" configuration to make this scenario possible.

log.txt

Attach the log file

log.txt

Operating System

Ubuntu

Driver

Docker

@rmsilva1973
Copy link
Contributor

A REALLY crude fix for this could be provided by something like d00178f. But the matter goes deeper than that. If we're running on docker/podman perhaps things like ExposedPorts which are located on the ClusterConfig struct.

As a matter of fact since pods are nodes PERHAPS a few properties could be moved to the node struct:

ExposedPorts []string // Only used by the docker and podman driver
ListenAddress string // Only used by the docker and podman driver
Network string // only used by docker driver
Subnet string // only used by the docker and podman driver

But I have absolutely no idea on the implcations (or even feaseability) of doing so. I assume addressing #7366 will bump on that. Just my newbie 2 cents. 😊

@rmsilva1973
Copy link
Contributor

/triage discuss

@k8s-ci-robot k8s-ci-robot added the triage/discuss Items for discussion label Sep 3, 2023
@rmsilva1973
Copy link
Contributor

@spowelljr Sorry if it's not common ettiquete mentioning someone who hasn't commented on an issue (please let me know if it is the case) but since issue 7366 has been around for sometime I thought this could be interesting.

Again: if mentioning maintainers this way is wrong, feel free to tell me so (and please excuse me for doing so)

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2024
@everflux
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 27, 2024
@rmsilva1973
Copy link
Contributor

Hey @everflux Do you mind commenting your impressions on my take on this bug? I would like to work on this, but I wanted to bounce ideas with somene more experienced.

@everflux
Copy link
Author

I have no idea what the implications of your suggestion are.
When I would use minikube in a scenario as I described above I would expect

  • first node uses the exposed ports
  • further nodes can't use the ports, as they are in use, so the setting is just ignored

@k8s-triage-robot

This comment was marked as outdated.

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 13, 2024
@everflux
Copy link
Author

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 15, 2024
@afbjorklund
Copy link
Collaborator

afbjorklund commented Aug 11, 2024

This seems like a bug, easiest would be to have the exposed ports apply only to the (first) control plane node.

Does it even work when creating all the nodes at start, with --count ? Or is that broken too, with --ports ?

@afbjorklund afbjorklund added kind/bug Categorizes issue or PR as related to a bug. co/multinode Issues related to multinode clusters priority/backlog Higher priority than priority/awaiting-more-evidence. labels Aug 11, 2024
@everflux
Copy link
Author

Yes that is broken as well,

minikube start --nodes 2 --ports 80:80
...
🚜  Pulling base image v0.0.44 ...
🔥  Creating docker container (CPUs=2, Memory=3950MB) ...
🤦  StartHost failed, but will try again: creating host: create: creating: create kic node: create container: docker run -d -t --privileged --security-opt seccomp=unconfined --tmpfs /tmp --tmpfs /run -v /lib/modules:/lib/modules:ro --hostname minikube-m02 --name minikube-m02 --label created_by.minikube.sigs.k8s.io=true --label name.minikube.sigs.k8s.io=minikube-m02 --label role.minikube.sigs.k8s.io= --label mode.minikube.sigs.k8s.io=minikube-m02 --network minikube --ip 192.168.49.3 --volume minikube-m02:/var --security-opt apparmor=unconfined --memory=3950mb -e container=docker --expose 8443 -p 80:80 --publish=127.0.0.1::8443 --publish=127.0.0.1::22 --publish=127.0.0.1::2376 --publish=127.0.0.1::5000 --publish=127.0.0.1::32443 gcr.io/k8s-minikube/kicbase:v0.0.44@sha256:eb04641328b06c5c4a14f4348470e1046bbcf9c2cbc551486e343d3a49db557e: exit status 125
stdout:
d0306d95dab3eb92d61366f4885226437bf59ce98d908a374b277e98ac1370b4

stderr:
docker: Error response from daemon: driver failed programming external connectivity on endpoint minikube-m02 (4cb688df7a5e032a9446f8656aa15e64f147982d13a03f14be4868e1671e2d1a): Bind for 0.0.0.0:80 failed: port is already allocated.

🤷  docker "minikube-m02" container is missing, will recreate.
...

@afbjorklund afbjorklund removed the triage/discuss Items for discussion label Aug 26, 2024
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/multinode Issues related to multinode clusters kind/bug Categorizes issue or PR as related to a bug. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants