【问题标题】:kube-dns does not workkube-dns 不起作用
【发布时间】:2016-12-22 22:36:35
【问题描述】:

我已经创建了集群(Centos 7)并使用 kube-dns 部署了 rc。集群工作正常,但 kube-dns 在日志中打印错误。

    I0817 12:40:01.589924       1 dns.go:299] could not find service for endpoint "kubernetes" in namespace "default"
I0817 12:40:01.591584       1 dns.go:299] could not find service for endpoint "kube-scheduler" in namespace "kube-system"
I0817 12:40:01.591608       1 dns.go:299] could not find service for endpoint "kube-controller-manager" in namespace "kube-system"
I0817 12:40:01.591620       1 dns.go:299] could not find service for endpoint "kube-dns" in namespace "kube-system"

api服务器: ### # Kubernetes 系统配置 # # 以下值用于配置 kube-apiserver #

# The address on the local server to listen to.
KUBE_API_ADDRESS="--address=0.0.0.0"

# The port on the local server to listen on.
KUBE_API_PORT="--port=8080"

# Port minions listen on
KUBELET_PORT="--kubelet-port=10250"

# Comma separated list of nodes in the etcd cluster
KUBE_ETCD_SERVERS="--etcd-servers=http://127.0.0.1:2379"

# Address range to use for services
KUBE_SERVICE_ADDRESSES="--service-cluster-ip-range=10.10.150.0/19"

# default admission control policies
KUBE_ADMISSION_CONTROL="NamespaceLifecycle,NamespaceExists,LimitRanger,SecurityContextDeny,ServiceAccount,ResourceQuota"
# Add your own!

主配置文件:

KUBE_LOGTOSTDERR="--logtostderr=true"

ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}"
DNS_SERVER_IP="10.10.150.250"
DNS_DOMAIN="cluster.local"
DNS_REPLICAS=1

# journal message level, 0 is debug
KUBE_LOG_LEVEL="--v=0"

# Should this cluster be allowed to run privileged docker containers
KUBE_ALLOW_PRIV="--allow-privileged=false"

# How the controller-manager, scheduler, and proxy find the apiserver
KUBE_MASTER="--master=http://127.0.0.1:8080"

有人知道发生了什么吗?)

【问题讨论】:

    标签: kubernetes skydns kube-dns


    【解决方案1】:

    https://github.com/kubernetes/kubernetes/blob/master/hack/local-up-cluster.sh#L352

    KUBE_ENABLE_CLUSTER_DNS 应该为 true,DNS 才能正常工作。 --cluster-dns=10.10.150.250 --cluster_domain=cluster.local

    【讨论】:

    • 我在配置中有这些行。我将最后一个应用于这张票。此外,我还清理了我的 etcd 集群并重新启动了所有主节点和模式。我也收到了类似的问题,但使用的是 kube-controller-manager 和 kube-scheduler
    【解决方案2】:

    问题出在我的 SELinux 中...当我禁用它并且一切正常时。

    【讨论】:

    • 投反对票,这个建议不仅不起作用,而且从安全角度来看也是危险的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-11-13
    • 2019-01-31
    • 2018-03-30
    • 2018-06-24
    • 1970-01-01
    • 2021-09-11
    • 2018-09-10
    相关资源
    最近更新 更多