5.7.8. 部署集群

您可以在兼容云平台中安装 OpenShift Container Platform。

重要

安装程序的 create cluster 命令只能在初始安装过程中运行一次。

先决条件

  • 配置托管集群的云平台的帐户。
  • 获取 OpenShift Container Platform 安装程序以及集群的 pull secret。

流程

  1. 更改为包含安装程序的目录并初始化集群部署:

    $ ./openshift-install create cluster --dir <installation_directory> \ 1
        --log-level=info 2
    1
    对于 <installation_directory>,请指定
    2
    要查看不同的安装详情,请指定 warndebugerror,而不要指定 info
    注意

    如果您在主机上配置的云供应商帐户没有足够的权限来部署集群,安装过程将会停止,并且显示缺少的权限。

    集群部署完成后,终端会显示访问集群的信息,包括指向其 Web 控制台的链接和 kubeadmin 用户的凭证。

    输出示例

    ...
    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: "4vYBz-Ee6gm-ymBZj-Wt5AL"
    INFO Time elapsed: 36m22s

    注意

    当安装成功时,集群访问和凭证信息还会输出到 <installation_directory>/.openshift_install.log

    重要
    • 安装程序生成的 Ignition 配置文件包含在 24 小时后过期的证书,然后在过期时进行续订。如果在更新证书前关闭集群,且集群在 24 小时后重启,集群会自动恢复过期的证书。一个例外情况是,您需要手动批准待处理的 node-bootstrapper 证书签名请求(CSR)来恢复 kubelet 证书。如需更多信息,请参阅从过期的 control plane 证书中恢复的文档。
    • 建议您在生成 12 小时后使用 Ignition 配置文件,因为集群安装后 24 小时证书从 16 小时轮转至 22 小时。通过在 12 小时内使用 Ignition 配置文件,您可以避免在安装过程中运行证书更新时避免安装失败。
    重要

    您不得删除安装程序或安装程序所创建的文件。需要这两者才能删除集群。