# HG changeset patch # User drewp@bigasterisk.com # Date 1655353945 25200 # Node ID fb68881b79a025bdd28515ad92288a49701c0b32 # Parent 996f39b034947c918411a878d83781eb966cf244 dns fussing diff -r 996f39b03494 -r fb68881b79a0 dns_check.py --- a/dns_check.py Wed Jun 15 21:31:53 2022 -0700 +++ b/dns_check.py Wed Jun 15 21:32:25 2022 -0700 @@ -33,13 +33,13 @@ ''' if host.name in ['dash', 'bang', 'slash']: - check('dash', '10.2.0.199') + check('dash', '10.2.0.212') check('projects.bigasterisk.com', '10.2.0.1') elif host.name in ['prime']: check('dash', '10.5.0.5') check('projects.bigasterisk.com', '10.2.0.1') # expected the public addr, but fine else: - check('dash', '10.2.0.199') + check('dash', '10.2.0.212') check('projects.bigasterisk.com', '10.2.0.1') if host.name in ['prime']: diff -r 996f39b03494 -r fb68881b79a0 dns_k8s_check.py --- a/dns_k8s_check.py Wed Jun 15 21:31:53 2022 -0700 +++ b/dns_k8s_check.py Wed Jun 15 21:32:25 2022 -0700 @@ -1,6 +1,11 @@ import json import subprocess +corednsConfig = subprocess.check_output(["kubectl", "get", "-n", "kube-system", "configmap/coredns", "-o", "yaml"]).decode('ascii') +print(corednsConfig) +if 'forward . 10.5.0.1' not in corednsConfig: + raise ValueError("coredns config is wrong") + subprocess.check_call(["skaffold", "run"], cwd="/my/proj/infra/k8s_lookup/") try: diff -r 996f39b03494 -r fb68881b79a0 templates/kube/coredns.yaml --- a/templates/kube/coredns.yaml Wed Jun 15 21:31:53 2022 -0700 +++ b/templates/kube/coredns.yaml Wed Jun 15 21:32:25 2022 -0700 @@ -58,7 +58,7 @@ errors health ready - kubernetes %{CLUSTER_DOMAIN}% in-addr.arpa ip6.arpa { + kubernetes cluster.local in-addr.arpa ip6.arpa { pods insecure fallthrough in-addr.arpa ip6.arpa } @@ -113,6 +113,14 @@ effect: "NoSchedule" nodeSelector: kubernetes.io/os: linux + affinity: # because dns is broken so often, and it might be a circular config that can't start unless this is on bang + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: "kubernetes.io/hostname" + operator: In + values: ["bang"] topologySpreadConstraints: - maxSkew: 1 topologyKey: kubernetes.io/hostname @@ -122,7 +130,7 @@ k8s-app: kube-dns containers: - name: coredns - image: %{SYSTEM_DEFAULT_REGISTRY}%rancher/mirrored-coredns-coredns:1.9.1 + image: rancher/mirrored-coredns-coredns:1.9.1 imagePullPolicy: IfNotPresent resources: limits: @@ -206,7 +214,7 @@ spec: selector: k8s-app: kube-dns - clusterIP: %{CLUSTER_DNS}% + clusterIP: '10.43.0.10' ports: - name: dns port: 53 diff -r 996f39b03494 -r fb68881b79a0 templates/net/bang_10.2.network.j2 --- a/templates/net/bang_10.2.network.j2 Wed Jun 15 21:31:53 2022 -0700 +++ b/templates/net/bang_10.2.network.j2 Wed Jun 15 21:32:25 2022 -0700 @@ -7,4 +7,4 @@ DHCP=no Address=10.2.0.1/16 DNS=10.2.0.1 -Domains=bigasterisk.com +DNSDefaultRoute=true diff -r 996f39b03494 -r fb68881b79a0 templates/net/bang_isp.network.j2 --- a/templates/net/bang_isp.network.j2 Wed Jun 15 21:31:53 2022 -0700 +++ b/templates/net/bang_isp.network.j2 Wed Jun 15 21:32:25 2022 -0700 @@ -4,10 +4,8 @@ MACAddress=64:ee:b7:14:81:9e [Network] -# in particular, don't take DNS addrs from this dhcp server -UseDNS=false DHCP=no Address=192.168.42.2/24 Gateway=192.168.42.1 DNS=10.2.0.1 -Domains=bigasterisk.com \ No newline at end of file +DNSDefaultRoute=true