Skip to content

Commit

Permalink
Fixed Minikube plugin CoreDNS CrashloopBackoff error
Browse files Browse the repository at this point in the history
  • Loading branch information
freemanjp committed Jun 8, 2019
1 parent 099f2ed commit 5dd9021
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion minikube-none/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ mkdir -p $HOME/.kube
touch $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config

sudo --preserve-env minikube <args> start --vm-driver=none <args>
sudo --preserve-env minikube --vm-driver=none <args> start --extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf <args>
```

Useful if you're already running in a virtual machine (VM) with Docker and can't
Expand Down
13 changes: 11 additions & 2 deletions minikube-none/minikube.plugin.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ __minikube_none() {
while [[ $# -gt 0 ]]; do
if [[ "$command" == '' ]]; then
case "$1" in
--vm-driver*)
has_vm_driver='true'
pre_args+=("$1")
shift
;;
-b|--bootstrapper|--log_backtrace_at|--log_dir|--loglevel|-p|--profile|--stderrthreshold|-v|--v|--vmodule)
pre_args+=("$1")
shift
Expand Down Expand Up @@ -47,8 +52,12 @@ __minikube_none() {
touch $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config

(set -x ; sudo --preserve-env minikube "${pre_args[@]}" "$command" \
--vm-driver=none "${post_args[@]}")
if [ -f /run/systemd/resolve/resolv.conf ]; then
post_args=('--extra-config=kubelet.resolv-conf=/run/systemd/resolve/resolv.conf' "${post_args[@]}")
fi

(set -x ; sudo --preserve-env minikube --vm-driver=none \
"${pre_args[@]}" "$command" "${post_args[@]}")
else
minikube "${pre_args[@]}" "$command" "${post_args[@]}"
fi
Expand Down

0 comments on commit 5dd9021

Please sign in to comment.