Skip to content

Instantly share code, notes, and snippets.

@jess-sol
Created June 23, 2021 14:31
Show Gist options
  • Select an option

  • Save jess-sol/0edc1e4a7c7f19910ae58311cb4ce4e7 to your computer and use it in GitHub Desktop.

Select an option

Save jess-sol/0edc1e4a7c7f19910ae58311cb4ce4e7 to your computer and use it in GitHub Desktop.
Configures dnsmasq to refer to DNS server running in minikube when ingress-dns addon is enabled for a profile
#!/usr/bin/env bash
printf '' | sudo tee /etc/dnsmasq.d/minikube.conf
while IFS= read -r profile; do
cat <<EOF | sudo tee -a /etc/dnsmasq.d/minikube.conf
server=/$profile.invalid/$(minikube ip --profile "$profile")
address=/$profile.invalid/$(minikube ip --profile "$profile")
EOF
done < <(minikube profile list -o json | jq -r '.valid[] | select(.Config.Addons."ingress-dns") | .Name')
sudo systemctl restart dnsmasq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment