You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
exitIfNotForced(reason.RsrcInsufficientSysMemory, "System only has {{.size}}MiB available, less than the required {{.req}}MiB for Kubernetes", out.V{"size": sysLimit, "req": minUsableMem})
1150
1150
}
1151
1151
1152
+
// if --memory=no-limit, ignore remaining checks
1153
+
ifreq==0&&driver.IsKIC(drvName) {
1154
+
return
1155
+
}
1156
+
1152
1157
ifreq<minUsableMem {
1153
1158
exitIfNotForced(reason.RsrcInsufficientReqMemory, "Requested memory allocation {{.requested}}MiB is less than the usable minimum of {{.minimum_memory}}MB", out.V{"requested": req, "minimum_memory": minUsableMem})
exitIfNotForced(reason.RsrcInsufficientDarwinDockerCores, "Docker Desktop has less than 2 CPUs configured, but Kubernetes requires at least 2 to be available")
exitIfNotForced(reason.RsrcInsufficientWindowsDockerCores, "Docker Desktop has less than 2 CPUs configured, but Kubernetes requires at least 2 to be available")
1221
+
} else {
1222
+
exitIfNotForced(reason.RsrcInsufficientCores, "{{.driver_name}} has less than 2 CPUs available, but Kubernetes requires at least 2 to be available", out.V{"driver_name": driver.FullName(viper.GetString("driver"))})
1223
+
}
1224
+
}
1225
+
1226
+
// if --cpus=no-limit, ignore remaining checks
1227
+
ifcpuCount==0&&driver.IsKIC(drvName) {
1228
+
return
1229
+
}
1230
+
1211
1231
ifcpuCount<minimumCPUS {
1212
1232
exitIfNotForced(reason.RsrcInsufficientCores, "Requested cpu count {{.requested_cpus}} is less than the minimum allowed of {{.minimum_cpus}}", out.V{"requested_cpus": cpuCount, "minimum_cpus": minimumCPUS})
exitIfNotForced(reason.RsrcInsufficientCores, "Requested cpu count {{.requested_cpus}} is greater than the available cpus of {{.avail_cpus}}", out.V{"requested_cpus": cpuCount, "avail_cpus": availableCPUs})
1228
1248
}
1229
-
1230
-
// looks good
1231
-
ifavailableCPUs>=2 {
1232
-
return
1233
-
}
1234
-
1235
-
ifdrvName==oci.Docker&&runtime.GOOS=="darwin" {
1236
-
exitIfNotForced(reason.RsrcInsufficientDarwinDockerCores, "Docker Desktop has less than 2 CPUs configured, but Kubernetes requires at least 2 to be available")
exitIfNotForced(reason.RsrcInsufficientWindowsDockerCores, "Docker Desktop has less than 2 CPUs configured, but Kubernetes requires at least 2 to be available")
1239
-
} else {
1240
-
exitIfNotForced(reason.RsrcInsufficientCores, "{{.driver_name}} has less than 2 CPUs available, but Kubernetes requires at least 2 to be available", out.V{"driver_name": driver.FullName(viper.GetString("driver"))})
1241
-
}
1242
1249
}
1243
1250
1244
1251
// validateFlags validates the supplied flags against known bad combinations
Copy file name to clipboardExpand all lines: cmd/minikube/cmd/start_flags.go
+11-3
Original file line number
Diff line number
Diff line change
@@ -160,8 +160,8 @@ func initMinikubeFlags() {
160
160
startCmd.Flags().Bool(interactive, true, "Allow user prompts for more information")
161
161
startCmd.Flags().Bool(dryRun, false, "dry-run mode. Validates configuration, but does not mutate system state")
162
162
163
-
startCmd.Flags().String(cpus, "2", fmt.Sprintf("Number of CPUs allocated to Kubernetes. Use %q to use the maximum number of CPUs.", constants.MaxResources))
164
-
startCmd.Flags().String(memory, "", fmt.Sprintf("Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use %q to use the maximum amount of memory.", constants.MaxResources))
163
+
startCmd.Flags().String(cpus, "2", fmt.Sprintf("Number of CPUs allocated to Kubernetes. Use %q to use the maximum number of CPUs. Use %q to not specify a limit (Docker/Podman only)", constants.MaxResources, constants.NoLimit))
164
+
startCmd.Flags().String(memory, "", fmt.Sprintf("Amount of RAM to allocate to Kubernetes (format: <number>[<unit>], where unit = b, k, m or g). Use %q to use the maximum amount of memory. Use %q to not specify a limit (Docker/Podman only)", constants.MaxResources, constants.NoLimit))
165
165
startCmd.Flags().String(humanReadableDiskSize, defaultDiskSize, "Disk size allocated to the minikube VM (format: <number>[<unit>], where unit = b, k, m or g).")
166
166
startCmd.Flags().Bool(downloadOnly, false, "If true, only download and cache files for later use - don't install or start anything.")
167
167
startCmd.Flags().Bool(cacheImages, true, "If true, cache docker images for the current bootstrapper and load them into the machine. Always false with --driver=none.")
@@ -337,6 +337,12 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
337
337
}
338
338
339
339
funcgetCPUCount(drvNamestring) int {
340
+
ifviper.GetString(cpus) ==constants.NoLimit {
341
+
ifdriver.IsKIC(drvName) {
342
+
return0
343
+
}
344
+
exit.Message(reason.Usage, "The '{{.name}}' driver does not support --cpus=no-limit", out.V{"name": drvName})
Copy file name to clipboardExpand all lines: pkg/minikube/constants/constants.go
+2
Original file line number
Diff line number
Diff line change
@@ -138,6 +138,8 @@ const (
138
138
TimeFormat=time.RFC822
139
139
// MaxResources is the value that can be passed into the memory and cpus flags to specify to use maximum resources
140
140
MaxResources="max"
141
+
// NoLimit is the value that can be passed into the memory and cpus flags to specify to not set the resource limit on the container (Docker & Podman only)
142
+
NoLimit="no-limit"
141
143
142
144
// DefaultCertExpiration is the amount of time in the future a certificate will expire in by default, which is 3 years
0 commit comments