kubesphere / ks-installer

Install KubeSphere on existing Kubernetes cluster
https://kubesphere.io
Apache License 2.0
532 stars 746 forks source link

主机设置里有未能访问的DNS地址时,安装出错 #33

Closed zryfish closed 3 years ago

zryfish commented 5 years ago

当主机 /etc/resolv.conf 包含未能访问的 DNS 地址时,安装会失败。因为 coredns 配置对主机 dns 的 proxy 策略,如果主机 dns 不可访问,会导致 coredns 返回给 pod 的响应不正常。

apiVersion: v1
data:
  Corefile: |
    .:53 {
        errors
        health
        kubernetes cluster.local in-addr.arpa ip6.arpa {
           pods insecure
           upstream
           fallthrough in-addr.arpa ip6.arpa
        }
        prometheus :9153
        proxy . /etc/resolv.conf 
        cache 30
        loop
        reload
        loadbalance
    }
kind: ConfigMap
BoBo-G commented 5 years ago

kubectl -n kube-system edit configmap coredns 然后把proxy 删除掉就可以了 你应该是卡到wait mysql了 脚本里面host用的是xxx.xxx.svc 没有cluster.local 造成的

zryfish commented 5 years ago

临时解决方法是

kubectl -n kube-system edit cm coredns

去掉 upstream 和 proxy 那两行,然后执行

kubectl -n kube-system scale deployment coredns --replicas=0 && kubectl -n kube-system scale deployment coredns --replicas=1

然后重新执行下installer,执行完installer之后记得将配置恢复成默认设置

根本原因是coredns将未能解析的请求forward给主机DNS时,主机DNS返回的不是NXDOMAIN,导致coredns认为解析失败,不会接着解析,需要将 /etc/resolv.conf 中不能正常解析的 dns 去掉,换成能正常解析的DNS,可以考虑替换成下列公共DNS,确保主机能够访问DNS

8.8.8.8
114.114.114.114
lijinbang commented 5 years ago

我更改之后重新执行install还是失败,重新看了一下配置文件,那两行被删除的又重新回来了!

pixiake commented 5 years ago

修改coredns 配置后 在对应的安装脚本(allinone.sh multi-nodes.sh)里注释掉前两个ansible-playbook 命令重新执行对应脚本即可

li7hai26 commented 5 years ago

ks-install不用重新执行吧,去掉 upstream 和 proxy 那两行,额,安装会继续的好像,然后就安装好了,然后用kubectl logs -n kubesphere-system $(kubectl get pod -n kubesphere-system -l job-name=kubesphere-installer -o jsonpath='{.items[0].metadata.name}') -f 这个命令看,就在往下安装,就OK了,我是用的breeze安装的k8s集群

zy84338719 commented 5 years ago

去掉这两行安装后,安装假装会进行,但实际未安装完成,未安装完成,未安装完成 TASK [ks-istio : istio | disable istio-injection] ** changed: [localhost] => (item=istio-system) changed: [localhost] => (item=kube-system) changed: [localhost] => (item=kubesphere-system) changed: [localhost] => (item=openpitrix-system)

TASK [ks-istio : istio | Waiting for istio-init] *** changed: [localhost]

TASK [ks-istio : istio | Deploy istio] ***** changed: [localhost]

TASK [ks-istio : istio | Deploy jaeger-operator] *** changed: [localhost]

TASK [ks-istio : istio | Deploy jaeger-production] ***** changed: [localhost]

TASK [ks-istio : istio | Create jaeger operator service] *** changed: [localhost]

PLAY RECAP ***** localhost : ok=150 changed=129 unreachable=0 failed=0 skipped=35 rescued=0 ignored=1

zryfish commented 3 years ago

/close

ks-ci-bot commented 3 years ago

@zryfish: Closing this issue.

In response to [this](https://github.com/kubesphere/ks-installer/issues/33#issuecomment-958663684): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.