exit.WithCodeT(exit.Config,"Unable to parse memory '{{.memory}}': {{.error}}",out.V{"memory":viper.GetString(memory),"error":err})
glog.Warningf("Unable to query memory limits: %v",err)
}
ifreq<minUsableMem&&!viper.GetBool(force){
exit.WithCodeT(exit.Config,"Requested memory allocation {{.requested}}MB is less than the usable minimum of {{.minimum}}MB",
out.V{"requested":req,"mininum":minUsableMem})
...
...
@@ -820,12 +823,30 @@ func validateMemorySize() {
out.T(out.Notice,"Requested memory allocation ({{.requested}}MB) is less than the recommended minimum {{.recommended}}MB. Kubernetes may crash unexpectedly.",
// in Docker Desktop if you allocate 2 GB the docker info shows: Total Memory: 1.945GiB which becomes 1991 when we calculate the MBs
// thats why it is not same number as other drivers which is 2 GB
ifcontainerLimit<1991{
out.T(out.Tip,`Increase Docker for Desktop memory to at least 2.5GB or more:
Docker for Desktop > Settings > Resources > Memory
`)
}elseifcontainerLimit<2997&&sysLimit>8000{// for users with more than 8 GB advice 3 GB
out.T(out.Tip,`Your system has {{.system_limit}}MB memory but Docker has only {{.container_limit}}MB. For a better performance increase to at least 3GB.
Docker for Desktop > Settings > Resources > Memory
exit.UsageT("Requested cpu count {{.requested_cpus}} is less than the minimum allowed of {{.minimum_cpus}}",out.V{"requested_cpus":cpuCount,"minimum_cpus":minimumCPUS})
}
ifdriver.IsKIC((drvName)){
si,err:=oci.CachedDaemonInfo(drvName)
iferr!=nil{
out.T(out.Confused,"Failed to verify '{{.driver_name}} info' will try again ...",out.V{"driver_name":drvName})
si,err=oci.DaemonInfo(drvName)
iferr!=nil{
exit.UsageT("Ensure your {{.driver_name}} is running and is healthy.",out.V{"driver_name":driver.FullName(drvName)})
}
}
ifsi.CPUs<2{
ifdrvName==oci.Docker{
out.T(out.Conflict,`Your Docker Desktop has less than 2 CPUs. Increase CPUs for Docker Desktop.
exit.UsageT("Ensure your {{.driver_name}} system has enough CPUs. The minimum allowed is 2 CPUs.",out.V{"driver_name":driver.FullName(viper.GetString("driver"))})
}
}
}
// validateFlags validates the supplied flags against known bad combinations
@@ -232,11 +232,16 @@ func generateClusterConfig(cmd *cobra.Command, existing *config.ClusterConfig, k
iferr!=nil{
exit.WithCodeT(exit.Config,"Generate unable to parse memory '{{.memory}}': {{.error}}",out.V{"memory":viper.GetString(memory),"error":err})
}
ifdriver.IsKIC(drvName)&&mem>containerLimit{
exit.UsageT("{{.driver_name}} has only {{.container_limit}}MB memory but you specified {{.specified_memory}}MB",out.V{"container_limit":containerLimit,"specified_memory":mem,"driver_name":driver.FullName(drvName)})
}
}else{
glog.Infof("Using suggested %dMB memory alloc based on sys=%dMB, container=%dMB",mem,sysLimit,containerLimit)
exit.WithCodeT(exit.Config,"Generate unable to parse disk size '{{.diskSize}}': {{.error}}",out.V{"diskSize":viper.GetString(humanReadableDiskSize),"error":err})
out.T(out.Tip,"Please ensure your system has {{.cpu_counts}} CPU cores.",out.V{"cpu_counts":viper.GetInt(cpus)})
}else{
out.T(out.Tip,"Please ensure your {{.driver_name}} system has access to {{.cpu_counts}} CPU cores or reduce the number of the specified CPUs",out.V{"driver_name":viper.GetString("driver"),"cpu_counts":viper.GetInt(cpus)})
out.T(out.Tip,"Please ensure your {{.driver_name}} system has access to {{.cpu_counts}} CPU cores or reduce the number of the specified CPUs",out.V{"driver_name":driver.FullName(viper.GetString("driver")),"cpu_counts":viper.GetInt(cpus)})
}
}
exit.UsageT("Ensure your {{.driver_name}} system has enough CPUs. The minimum allowed is 2 CPUs.",out.V{"driver_name":viper.GetString("driver")})