为什么 AWS 提供商的 OpenShift 安装程序无法连接到 Kubernetes API?

Why OpenShift installer for AWS provider fails unable to connect to Kubernetes API?

OpenShift AWS 安装程序无法等待 Kubernetes API 可用并出现致命错误 "waiting for Kubernetes API: context deadline exceeded":

$ 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 

问题也描述了here

在我的例子中,安装程序试图连接到 Kubernetes API 链接到一个不存在的端点。一个迹象表明如果 oc-client 在 运行 一个像 oc whoami 这样的简单命令时挂起 - 它实际上尝试连接到同一个端点(假设 KUBECONFIG 已设置)。
事实证明,它与 Route 53 托管区域有关,尤其是与子域有关。当针对子域安装 OpenShift 时(如我的情况),需要在主域中创建引用子域的记录集。因此,对于 openshift.example.com,请在 aws 控制台中执行以下操作:
转到 Route 53 -> Hosted zones -> 单击 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 记录。

此更改后安装成功。