Skip to content

Commit

Permalink
fix(k8s): gracefully fail if minikube ingress addon can't be enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Jan 18, 2021
1 parent 2002afa commit c505c4f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 7 additions & 3 deletions core/src/plugins/kubernetes/local/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { exec } from "../../../util/util"
import { remove } from "lodash"
import { getNfsStorageClass } from "../init"
import { isClusterKind } from "./kind"
import chalk from "chalk"

// TODO: split this into separate plugins to handle Docker for Mac and Minikube

Expand Down Expand Up @@ -93,8 +94,7 @@ export async function configureProvider(params: ConfigureProviderParams<LocalKub

if (await isClusterKind(ctx, provider, log)) {
config.clusterType = "kind"
}
if (config.context === "minikube") {
} else if (config.context === "minikube") {
await exec("minikube", ["config", "set", "WantUpdateNotification", "false"])

config.clusterType = "minikube"
Expand All @@ -107,7 +107,11 @@ export async function configureProvider(params: ConfigureProviderParams<LocalKub

if (config.setupIngressController === "nginx") {
log.debug("Using minikube's ingress addon")
await exec("minikube", ["addons", "enable", "ingress"])
try {
await exec("minikube", ["addons", "enable", "ingress"])
} catch (err) {
log.warn(chalk.yellow(`Unable to enable minikube ingress addon: ${err.all}`))
}
remove(_systemServices, (s) => nginxServices.includes(s))
}

Expand Down
2 changes: 0 additions & 2 deletions static/kubernetes/system/ingress-controller/garden.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ values:
nodeSelector: ${var.system-node-selector}
defaultBackend:
enabled: false
admissionWebhooks:
enabled: false

0 comments on commit c505c4f

Please sign in to comment.