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

Add --static-ip flag #15523

Closed
spowelljr opened this issue Dec 15, 2022 · 0 comments · Fixed by #15553
Closed

Add --static-ip flag #15523

spowelljr opened this issue Dec 15, 2022 · 0 comments · Fixed by #15553
Assignees
Labels
area/networking networking issues co/docker-driver Issues related to kubernetes in container priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@spowelljr
Copy link
Member

A --static-ip flag should be added to minikube start, this flag will only be for Docker and Podman (for now anyway).

This flag will operate somewhat similarly to the --subnet flag.

Currently a CIDR passed to --subnet assigns values as follows:

IP:        CIDR[0]        = 192.168.49.0
Gateway:   CIDR[1]        = 192.168.49.1
MinClient: CIDR[2]        = 192.168.49.2
MaxClient: CIDR[2nd last] = 192.168.49.254
Broadcast: CIDR[last]     = 192.168.49.255

This should be modified so the first IP is MinClient:

MinClient: CIDR[0]        = 192.168.49.0
MaxClient: CIDR[4th last] = 192.168.49.252
IP:        CIDR[3rd last] = 192.168.49.253
Gateway:   CIDR[2nd last] = 192.168.49.254
Broadcast: CIDR[last]     = 192.168.49.255

This will ensure that minikube ip will be the IP the user passed in.

To ensure that we get the desired IPs a mask of /30 should likely be used as that will give us a range of 4 values, this will require that the last digit of the IP is <= 252.

Opposed to the --subnet flag there shouldn't be any incrementing and retrying if the range specified is in use, if it's in use we should fail the start.

Example of desired output if network is free:

$ minikube start --static-ip=192.168.60.0
...
$ minikube ip
192.168.60.0
@spowelljr spowelljr added priority/backlog Higher priority than priority/awaiting-more-evidence. area/networking networking issues co/docker-driver Issues related to kubernetes in container labels Dec 15, 2022
@spowelljr spowelljr self-assigned this Dec 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking networking issues co/docker-driver Issues related to kubernetes in container priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant