Skip to content

Instantly share code, notes, and snippets.

@Oddly
Last active October 2, 2024 17:34
Show Gist options
  • Save Oddly/8d437613a1a359ef33fc1aa823f78c74 to your computer and use it in GitHub Desktop.
Save Oddly/8d437613a1a359ef33fc1aa823f78c74 to your computer and use it in GitHub Desktop.
Kubernetes on Docker desktop internet fix

This will update the Kubernetes CoreDNS service to forward login.microsoftonline.com to 1.1.1.1. Thank you patrickhuber

Put below code in coredns.yml and then kubectl apply -f coredns.yml. Ignore the errors.

apiVersion: v1
kind: ConfigMap
metadata:
  name: coredns
  namespace: kube-system
data:
  Corefile: |
    login.microsoftonline.com {
      forward . 1.1.1.1
    }

    .:53 {
        errors
        health {
           lameduck 5s
        }
        ready
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           fallthrough in-addr.arpa ip6.arpa
           ttl 30
        }
        prometheus :9153
        forward . /etc/resolv.conf {
           max_concurrent 1000
        }
        cache 30
        loop
        reload
        loadbalance
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment