5.9. 部署集群
您可以在兼容云平台上安装 OpenShift Container Platform。
重要
在初始安装过程中,您只能运行安装程序的 create cluster
命令一次。
先决条件
- 使用托管集群的云平台配置帐户。
- 获取 OpenShift Container Platform 安装程序和集群的 pull secret。
- 验证主机上的云供应商帐户是否有部署集群的正确权限。权限不正确的帐户会导致安装过程失败,并显示包括缺失权限的错误消息。
流程
进入包含安装程序的目录并初始化集群部署:
$ ./openshift-install create cluster --dir <installation_directory> \ 1 --log-level=info 2
验证
当集群部署成功完成时:
-
终端会显示用于访问集群的说明,包括指向 Web 控制台和
kubeadmin
用户的凭证的链接。 -
凭证信息还会输出到
<installation_directory>/.openshift_install.log
.
重要
不要删除安装程序或安装程序所创建的文件。需要这两者才能删除集群。
输出示例
... INFO Install complete! INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/home/myuser/install_dir/auth/kubeconfig' INFO Access the OpenShift web-console here: https://console-openshift-console.apps.mycluster.example.com INFO Login to the console with user: "kubeadmin", and password: "password" INFO Time elapsed: 36m22s
重要
-
安装程序生成的 Ignition 配置文件包含在 24 小时后过期的证书,然后在过期时进行续订。如果在更新证书前关闭集群,且集群在 24 小时后重启,集群会自动恢复过期的证书。一个例外是,您必须手动批准待处理的
node-bootstrapper
证书签名请求(CSR)来恢复 kubelet 证书。如需更多信息,请参阅从过期的 control plane 证书 中恢复的文档。 - 建议您在 Ignition 配置文件生成后的 12 小时内使用它们,因为 24 小时的证书会在集群安装后的 16 小时到 22 小时间进行轮转。通过在 12 小时内使用 Ignition 配置文件,您可以避免在安装过程中因为执行了证书更新而导致安装失败的问题。