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 'subnet' flag for docker/podman driver #13730

Merged
merged 3 commits into from Mar 30, 2022

Conversation

presztak
Copy link
Member

This PR adds support to define subnet address of the minikube docker/podman driver cluster.
Closes #12315

Example:
minikube start --subnet 192.168.60.0/24

Result:
docker network inspect minikube

"IPAM": {
    "Driver": "default",
    "Options": {},
    "Config": [
        {
            "Subnet": "192.168.60.0/24",
            "Gateway": "192.168.60.1"
        }
    ]
},

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Feb 27, 2022
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 9, 2022
// CreateNetwork creates a network returns gateway and error, minikube creates one network per cluster
func CreateNetwork(ociBin string, networkName string) (net.IP, error) {
func CreateNetwork(ociBin string, networkName string, subnet string) (net.IP, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters can omit repeated type:

func CreateNetwork(ociBin, networkName, subnet string) { ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

// CreateNetwork creates a network returns gateway and error, minikube creates one network per cluster
func CreateNetwork(ociBin string, networkName string) (net.IP, error) {
func CreateNetwork(ociBin string, networkName string, subnet string) (net.IP, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function parameters can omit repeated type:

func CreateNetwork(ociBin, networkName, subnet string) { ...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -107,3 +128,15 @@ func verifyNetworkExists(ctx context.Context, t *testing.T, networkName string)
t.Fatalf("%s network is not listed by [%v]: %v", networkName, c.Args, output)
}
}

func verifySubnet(ctx context.Context, t *testing.T, network string, subnet string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit repeated param (see comment above for more detail).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@@ -107,3 +128,15 @@ func verifyNetworkExists(ctx context.Context, t *testing.T, networkName string)
t.Fatalf("%s network is not listed by [%v]: %v", networkName, c.Args, output)
}
}

func verifySubnet(ctx context.Context, t *testing.T, network string, subnet string) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Omit repeated param (see comment above for more detail).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@sharifelgamal
Copy link
Collaborator

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Mar 29, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13730) |
+----------------+----------+---------------------+
| minikube start | 52.0s    | 54.9s               |
| enable ingress | 27.7s    | 29.5s               |
+----------------+----------+---------------------+

Times for minikube start: 53.7s 51.3s 51.5s 51.0s 52.7s
Times for minikube (PR 13730) start: 52.3s 52.8s 52.3s 51.7s 65.3s

Times for minikube ingress: 28.5s 26.0s 27.0s 26.5s 30.6s
Times for minikube (PR 13730) ingress: 29.1s 29.1s 29.1s 29.1s 31.1s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13730) |
+----------------+----------+---------------------+
| minikube start | 25.9s    | 25.5s               |
| enable ingress | 23.2s    | 34.9s               |
+----------------+----------+---------------------+

Times for minikube start: 26.3s 26.4s 26.3s 25.6s 25.1s
Times for minikube (PR 13730) start: 25.3s 25.0s 26.1s 25.8s 25.4s

Times for minikube ingress: 22.9s 22.9s 24.4s 22.9s 23.0s
Times for minikube (PR 13730) ingress: 22.0s 23.5s 83.4s 22.9s 23.0s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 13730) |
+----------------+----------+---------------------+
| minikube start | 40.8s    | 42.0s               |
| enable ingress | 22.8s    | 25.5s               |
+----------------+----------+---------------------+

Times for minikube start: 34.8s 40.9s 41.2s 41.3s 46.1s
Times for minikube (PR 13730) start: 40.6s 41.0s 42.0s 45.7s 40.6s

Times for minikube ingress: 17.9s 22.4s 23.4s 22.4s 28.0s
Times for minikube (PR 13730) ingress: 22.4s 32.4s 32.4s 17.9s 22.4s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Linux TestAddons/parallel/Registry (gopogh) 1.23 (chart)
Docker_Linux TestFunctional/parallel/PersistentVolumeClaim (gopogh) 1.23 (chart)
Docker_Linux TestMultiNode/serial/DeployApp2Nodes (gopogh) 1.23 (chart)
Docker_Linux TestMultiNode/serial/PingHostFrom2Pods (gopogh) 1.23 (chart)
Docker_Linux TestFunctional/parallel/DashboardCmd (gopogh) 1.85 (chart)
Docker_Linux TestNetworkPlugins/group/auto/DNS (gopogh) 7.41 (chart)
Docker_Windows TestCertExpiration (gopogh) 8.21 (chart)
Docker_Windows TestNoKubernetes/serial/ProfileList (gopogh) 24.49 (chart)
Docker_Windows TestNetworkPlugins/group/kubenet/DNS (gopogh) 30.36 (chart)
Docker_Windows TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 30.88 (chart)
Docker_Linux TestNetworkPlugins/group/false/DNS (gopogh) 32.72 (chart)
Docker_Windows TestNetworkPlugins/group/bridge/DNS (gopogh) 40.00 (chart)
Docker_Windows TestNetworkPlugins/group/kindnet/Start (gopogh) 43.75 (chart)
Hyper-V_Windows TestSkaffold (gopogh) 45.89 (chart)
Docker_Windows TestSkaffold (gopogh) 47.76 (chart)
Docker_macOS TestNetworkPlugins/group/custom-weave/Start (gopogh) 48.59 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/kindnet/Start (gopogh) 48.78 (chart)
Docker_macOS TestFunctional/serial/ComponentHealth (gopogh) 50.65 (chart)
Docker_macOS TestFunctional/serial/ExtraConfig (gopogh) 50.65 (chart)
Docker_Linux TestNetworkPlugins/group/kindnet/DNS (gopogh) 56.04 (chart)
Docker_Linux TestNetworkPlugins/group/custom-weave/Start (gopogh) 61.11 (chart)
Hyper-V_Windows TestNoKubernetes/serial/StartWithK8s (gopogh) 63.70 (chart)
Docker_Windows TestNetworkPlugins/group/calico/Start (gopogh) 64.58 (chart)
Docker_Linux TestNetworkPlugins/group/calico/Start (gopogh) 70.99 (chart)
Docker_Linux TestNetworkPlugins/group/bridge/DNS (gopogh) 72.84 (chart)
Docker_Linux TestNetworkPlugins/group/kubenet/DNS (gopogh) 73.46 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 74.40 (chart)
Docker_Linux TestNetworkPlugins/group/enable-default-cni/DNS (gopogh) 74.69 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/calico/Start (gopogh) 78.05 (chart)
Docker_Linux_containerd TestNetworkPlugins/group/bridge/DNS (gopogh) 81.20 (chart)
More tests... Continued...

Too many tests failed - See test logs for more details.

To see the flake rates of all tests by environment, click here.

Copy link
Collaborator

@sharifelgamal sharifelgamal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: presztak, sharifelgamal

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 30, 2022
@sharifelgamal sharifelgamal merged commit 31d1fda into kubernetes:master Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Question] How to change the default IP address of the minikube docker driver cluster?
6 participants