in pkg/addons/addons.go [231:282]
func addonSpecificChecks(cc *config.ClusterConfig, name string, enable bool, runner command.Runner) (bool, error) {
// to match both ingress and ingress-dns addons
if strings.HasPrefix(name, "ingress") && enable {
if driver.IsKIC(cc.Driver) {
if runtime.GOOS == "windows" || runtime.GOOS == "darwin" {
out.Styled(style.Tip, `After the addon is enabled, please run "minikube tunnel" and your ingress resources would be available at "127.0.0.1"`)
}
}
}
if strings.HasPrefix(name, "istio") && enable {
minMem := 8192
minCPUs := 4
if cc.Memory < minMem {
out.WarningT("Istio needs {{.minMem}}MB of memory -- your configuration only allocates {{.memory}}MB", out.V{"minMem": minMem, "memory": cc.Memory})
}
if cc.CPUs < minCPUs {
out.WarningT("Istio needs {{.minCPUs}} CPUs -- your configuration only allocates {{.cpus}} CPUs", out.V{"minCPUs": minCPUs, "cpus": cc.CPUs})
}
}
if name == "registry" {
if driver.NeedsPortForward(cc.Driver) {
port, err := oci.ForwardedPort(cc.Driver, cc.Name, constants.RegistryAddonPort)
if err != nil {
return false, errors.Wrap(err, "registry port")
}
if enable {
out.Boxed(`Registry addon with {{.driver}} driver uses port {{.port}} please use that instead of default port 5000`, out.V{"driver": cc.Driver, "port": port})
}
out.Styled(style.Documentation, `For more information see: https://minikube.sigs.k8s.io/docs/drivers/{{.driver}}`, out.V{"driver": cc.Driver})
}
return false, nil
}
if name == "auto-pause" && !enable { // needs to be disabled before deleting the service file in the internal disable
if err := sysinit.New(runner).DisableNow("auto-pause"); err != nil {
klog.ErrorS(err, "failed to disable", "service", "auto-pause")
}
return false, nil
}
// If the gcp-auth credentials haven't been mounted in, don't start the pods
if name == "gcp-auth" && enable {
rr, err := runner.RunCmd(exec.Command("cat", credentialsPath))
if err != nil || rr.Stdout.String() == "" {
return true, nil
}
}
return false, nil
}