2

我有一个使用 flannel(不确定是否相关,可能是)作为 CNI 提供程序的 kubernetes 集群(v1.10)。尝试应用 kube-dns 但它会重复显示 podCrashLoopBackOff的日志kubedns

I0423 17:46:47.045712       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0423 17:46:47.545729       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0423 17:46:48.045723       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
I0423 17:46:48.545749       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
E0423 17:46:49.019286       1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:147: Failed to list *v1.Endpoints: Get https://10.96.0.1:443/api/v1/endpoints?resourceVersion=0: dial tcp 10.96.0.1:443: getsockopt: connection refused
E0423 17:46:49.019325       1 reflector.go:201] k8s.io/dns/pkg/dns/dns.go:150: Failed to list *v1.Service: Get https://10.96.0.1:443/api/v1/services?resourceVersion=0: dial tcp 10.96.0.1:443: getsockopt: connection refused
I0423 17:46:49.045731       1 dns.go:173] Waiting for services and endpoints to be initialized from apiserver...
F0423 17:46:49.545707       1 dns.go:167] Timeout waiting for initialization

我的kube-dns清单中没有任何内容涉及端口443并且kube-apiserver配置为6443. 它试图与被拒绝的事物建立联系是什么?

我也不知道它是否与具有 ip 的 kube-dns pod 有任何关系10.88.0.3

kubectl -n kube-system -o wide get pods
NAME                      READY     STATUS             RESTARTS   AGE       IP            NODE
kube-dns-564f9d98-lt9js   2/3       CrashLoopBackOff   13         18m       10.88.0.3     worker1
kube-flannel-ds-5bqm6     1/1       Running            0          35m       10.240.0.12   controller2
kube-flannel-ds-djmld     1/1       Running            0          35m       10.240.0.11   controller1
kube-flannel-ds-nbfhp     1/1       Running            0          35m       10.240.0.23   worker3
kube-flannel-ds-prxdr     1/1       Running            0          35m       10.240.0.22   worker2
kube-flannel-ds-x9cdq     1/1       Running            0          35m       10.240.0.21   worker1
kube-flannel-ds-zjbgb     1/1       Running            0          35m       10.240.0.13   controller3

再次,这是从哪里来的?这不是我配置的东西,它不在我的服务网络或 pod 网络 CIDR 范围内:

kubernetes_dns_domain: kubernetes.local
kubernetes_dns_ip: "{{ kubernetes_cluster_subnet }}.10"
kubernetes_cluster_subnet: 10.96.0
kubernetes_pod_network_cidr: 10.244.0.0/16
kubernetes_service_ip: "{{ kubernetes_cluster_subnet }}.1"
kubernetes_service_ip_range: "{{ kubernetes_cluster_subnet }}.0/24"
kubernetes_service_node_port_range: 30000-32767
kubernetes_secure_port: 6443

我完全糊涂了,如果对发生的事情有任何解释,我将不胜感激。

kube_dns_version:1.14.10 flannel_version:v0.10.0

4

0 回答 0