From cbdd447543742d901862d1e7c018f7ee095f79cc Mon Sep 17 00:00:00 2001 From: Piotr Resztak Date: Sun, 27 Feb 2022 16:56:05 +0100 Subject: [PATCH] add 'subnet' flag --- cmd/minikube/cmd/start_flags.go | 3 +++ pkg/minikube/config/types.go | 1 + 2 files changed, 4 insertions(+) diff --git a/cmd/minikube/cmd/start_flags.go b/cmd/minikube/cmd/start_flags.go index 3d8a69ce68..bbfeff2b95 100644 --- a/cmd/minikube/cmd/start_flags.go +++ b/cmd/minikube/cmd/start_flags.go @@ -121,6 +121,7 @@ const ( kicBaseImage = "base-image" ports = "ports" network = "network" + subnet = "subnet" startNamespace = "namespace" trace = "trace" sshIPAddress = "ssh-ip-address" @@ -249,6 +250,7 @@ func initDriverFlags() { // docker & podman startCmd.Flags().String(listenAddress, "", "IP Address to use to expose ports (docker and podman driver only)") startCmd.Flags().StringSlice(ports, []string{}, "List of ports that should be exposed (docker and podman driver only)") + startCmd.Flags().String(subnet, "", "Subnet to be used on kic cluster. If left empty, minikube will choose subnet address, beginning from 192.168.49.0. (docker and podman driver only)") } // initNetworkingFlags inits the commandline flags for connectivity related flags for start @@ -468,6 +470,7 @@ func generateNewConfigFromFlags(cmd *cobra.Command, k8sVersion string, rtime str MinikubeISO: viper.GetString(isoURL), KicBaseImage: viper.GetString(kicBaseImage), Network: viper.GetString(network), + Subnet: viper.GetString(subnet), Memory: getMemorySize(cmd, drvName), CPUs: getCPUCount(drvName), DiskSize: getDiskSize(), diff --git a/pkg/minikube/config/types.go b/pkg/minikube/config/types.go index 513a61ded6..048d2434ff 100644 --- a/pkg/minikube/config/types.go +++ b/pkg/minikube/config/types.go @@ -82,6 +82,7 @@ type ClusterConfig 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 MultiNodeRequested bool ExtraDisks int // currently only implemented for hyperkit and kvm2 CertExpiration time.Duration