amazon-web-services - 为什么 AWS 提供商的 OpenShift 安装程序无法连接到 Kubernetes API?
问题描述
OpenShift AWS 安装程序无法等待 Kubernetes API 可用,并出现致命错误“等待 Kubernetes API:超出上下文期限”:
$ openshift-install create cluster --dir=$HOME/openshift --log-level debug
...
DEBUG Still waiting for the Kubernetes API: Get https://api.cluster-name.'IP_ADDRESS'.nip.io:6443/version?timeout=32s: dial tcp 'IP_ADDRESS':6443: i/o timeout
DEBUG Still waiting for the Kubernetes API: Get https://api.cluster-name.'IP_ADDRESS'.nip.io:6443/version?timeout=32s: dial tcp 'IP_ADDRESS':6443: i/o timeout
DEBUG Still waiting for the Kubernetes API: Get https://api.cluster-name.'IP_ADDRESS'.nip.io:6443/version?timeout=32s: dial tcp 'IP_ADDRESS':6443: i/o timeout
DEBUG Still waiting for the Kubernetes API: Get https://api.cluster-name.'IP_ADDRESS'.nip.io:6443/version?timeout=32s: dial tcp 'IP_ADDRESS':6443: i/o timeout
DEBUG Fetching "Install Config"...
DEBUG Loading "Install Config"...
DEBUG Loading "SSH Key"...
DEBUG Using "SSH Key" loaded from state file
DEBUG Loading "Base Domain"...
DEBUG Loading "Platform"...
DEBUG Using "Platform" loaded from state file
DEBUG Using "Base Domain" loaded from state file
DEBUG Loading "Cluster Name"...
DEBUG Loading "Base Domain"...
DEBUG Using "Cluster Name" loaded from state file
DEBUG Loading "Pull Secret"...
DEBUG Using "Pull Secret" loaded from state file
DEBUG Loading "Platform"...
DEBUG Using "Install Config" loaded from state file
DEBUG Reusing previously-fetched "Install Config"
INFO Use the following commands to gather logs from the cluster
...
FATAL waiting for Kubernetes API: context deadline exceeded
这里也描述了这个问题
解决方案
在我的情况下,安装程序尝试连接到链接到不存在的端点的 Kubernetes API。oc
if -client 在运行简单命令时挂起的迹象之一oc whoami
- 它实际上尝试连接到同一个端点(假设设置了 KUBECONFIG)。
事实证明,它与 Route 53 托管区域有关,尤其是与子域有关。当针对子域(如我的情况)安装 OpenShift 时,需要在主域中创建引用子域的记录集。因此,对于 openshift.example.com,在 aws 控制台中执行以下操作:
转到 Route 53 -> 托管区域 -> 单击 openshift.example.com。(如果它不存在 - 创建一个托管区域) -> 复制 NS 记录,例如:
ns-711.awsdns-24.net.
ns-126.awsdns-15.com.
ns-1274.awsdns-31.org.
ns-1556.awsdns-02.co.uk.
返回托管区域 -> example.com。-> 创建记录集:
为 openshift.example.com 创建记录集,输入:NS - 名称服务器,值:粘贴复制的 NS 记录。
在此更改后,安装成功完成。
推荐阅读
- php - Why is my PHP code overriding my HTML code?
- .net - 对于 .NET Web 应用程序,是否可以将 Apache HTTPD 作为 Web 服务器,将 IIS 作为应用程序服务器?
- html - Css:如何将高度设置为父母宽度的 100%
- regex - 正则表达式 re.findall 只能提取一半数据
- javascript - 在电子项目的反应错误消息中看到“%s”而不是特定属性?
- testing - VHDL 测试台在仿真波形中获取 U
- codeigniter - 如何解决“未定义索引:forwardto[] 和 implode():传递的参数无效”的问题
- python - 如何将fuzzyWuzzy 与两个csv 一起使用?
- php - 更改用户角色名称 Wordpress
- python - Tkinter 未在 Python 中导入到可执行转换