【问题标题】:kube-apiserver refusing external connections on port 443kube-apiserver 拒绝端口 443 上的外部连接
【发布时间】:2016-10-18 17:48:59
【问题描述】:

我有一个使用 kube-aws 配置的 kubernetes 集群。我在三个控制器节点上添加了两个额外的控制器和集群 etcd。当我在不同节点上设置和获取值时,etcd 集群似乎(大部分)健康并且工作。

我将新的 etcd 服务器添加到 /etc/kubernetes/manifests/kube-apiserver.yaml:

--etcd-servers=http://10.0.0.50:2379,http://10.0.1.50:2379,http://10.0.2.50:2379

现在,kube-apiserver 拒绝安全端口 443 上的连接。

kubelet 日志包含这样的条目...

E0617 02:07:17.488289   30972 pod_workers.go:138] Error syncing pod 
b394008e8164, skipping: failed to "StartContainer" for "etcd-container" with 
CrashLoopBackOff: "Back-off 5m0s restarting failed container=etcd-container 
pod=etcd-server-ip-10-0-0-50.eu-west-1.compute.internal_default(b394008e8164)"

还有这个……

E0617 02:03:00.542951   30972 event.go:193] Server rejected event 
'&api.Event{TypeMeta:unversioned.TypeMeta{Kind:"", APIVersion:""}, 
ObjectMeta:api.ObjectMeta{Name:"etcd-server-ip-10-0-0-50.eu-
west-1.compute.internal.1458b", GenerateName:"", Namespace:"default", 
SelfLink:"", UID:"", ResourceVersion:"1189", Generation:0, 
CreationTimestamp:unversioned.Time{Time:time.Time{sec:0, nsec:0, 
loc:(*time.Location)(nil)}}, DeletionTimestamp:(*unversioned.Time)(nil), 
DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), 
Annotations:map[string]string(nil)}, 
InvolvedObject:api.ObjectReference{Kind:"Pod", Namespace:"default", 
Name:"etcd-server-ip-10-0-0-50.eu-west-1.compute.internal", 
UID:"b394008e8164", APIVersion:"v1", ResourceVersion:"", FieldPath:""}, 
Reason:"FailedSync", Message:"Error syncing pod, skipping: failed to 
\"StartContainer\" for \"etcd-container\" with RunContainerError: 
\"runContainer: API error (500): mkdir /usr/local/openssl: read-only file 
system\\n\"\n", Source:api.EventSource{Component:"kubelet", Host:"ip-
10-0-0-50.eu-west-1.compute.internal"}, 
FirstTimestamp:unversioned.Time{Time:time.Time{sec:63601711997, nsec:0, 
loc:(*time.Location)(0x3b1a5c0)}}, 
LastTimestamp:unversioned.Time{Time:time.Time{sec:63601725780, 
nsec:522501285, loc:(*time.Location)(0x3b1a5c0)}}, Count:7, Type:"Warning"}': 
'events "etcd-server-ip-10-0-0-50.eu-west-1.compute.internal.1458b" not 
found' (will not retry!)

像这样在端口 8080 上本地查询 kube-apiserver...

$ curl http://localhost:8080/api/v1/namespaces

...返回一个有效的响应。

但它拒绝对安全端口的任何尝试。

谁能指出正确的方向?

【问题讨论】:

    标签: kubernetes


    【解决方案1】:

    对于任何发现此问题的 kube-apiserver 有问题的人...

    我的问题原来是位于 /etc/kubernetes/ssl/ 中的错误 TLS 资产。 (事后看来,很明显,因为它响应的是 HTTP 请求而不是 HTTPS。)我问题中的日志条目与 TLS 资产的问题无关。 kubelet 日志帮助我找到了问题:

    $ journalctl -u kubelet -e  # jump to end of kubelet logs
    

    以下也派上了用场:

    $ journalctl -u oem-cloudinit  # if using aws will help you debug your cloud-config
    $ journalctl -u etcd2 -f  # follow etcd logs
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-09-17
      • 1970-01-01
      • 2018-08-09
      • 2018-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多