Created
June 23, 2021 14:31
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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