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 MEP for dedicated docker driver #9296

Merged
Merged
Changes from all 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
@@ -0,0 +1,40 @@
# Static IP for minikube containers KIC Drivers (docker/podman)

design by @medyagh

medyagh marked this conversation as resolved.
Show resolved Hide resolved
## Prototype [PR 9294](https://github.com/kubernetes/minikube/pull/9294):

Each minikube cluster will get it is own network, instead of using docker’s owned default network which is unmodifiable by the user.
medyagh marked this conversation as resolved.
Show resolved Hide resolved

on “minikube start”, minikube will try to create a docker network at a default subnet
medyagh marked this conversation as resolved.
Show resolved Hide resolved
If a user happens to have an existing network in that exact subnet, minikube will try X times, by incrementing the sunbet by 10 each time.

once the network is created, it will calculate container IP inside the network by this formula:

```
gateway IP = first ip of the subnet
container IP = gateway IP + 1 + container index
```

container_index is calculated from this formula:

default is 1 for single node (and for multinde is the order the machine created based on it is name, for example the index for minikube-m02 will be 2)



### Alternative design :

once network is found or created, minikube can look up list of all the container IPs in the network, and try to

medyagh marked this conversation as resolved.
Show resolved Hide resolved

### Considerations:

if can’t create network, should fall back to docker’s default bridge IP
medyagh marked this conversation as resolved.
Show resolved Hide resolved
The existing running clusters should not break by using newer version of minikube


### Advantages:

since we own the created network we can assign and calculate the IP.
medyagh marked this conversation as resolved.
Show resolved Hide resolved
By avoiding using the default docker bridge we can isolate minikube network problems to not be affected by user’s other containers.
User will have the same minikube IP across computer restart and hibernations, which will save user time on the next start. (each time IP changes there will be a tax of 22 seconds of setting up the cluster by kubeadm)