安裝 OpenShift 4
若要安裝 OpenShift 叢集,請遵循官方 Redhat OpenShift 說明文件中的指示進行。
install-config.yaml
的範例:apiVersion: v1 baseDomain: yasen.local compute: - hyperthreading: Enabled name: worker replicas: 0 controlPlane: hyperthreading: Enabled name: master replicas: 3 metadata: name: ocp networking: networkType: ncp clusterNetwork: - cidr: 10.4.0.0/16 hostPrefix: 23 machineCIDR: 10.114.16.0/24 serviceNetwork: - 172.30.0.0/16 platform: vsphere: vcenter: vc.yasen.local username: administrator@yasen.local password: VMware1! datacenter: Datacenter1 defaultDatastore: NFS pullSecret: '' sshKey: 'ssh-rsa xxxx'
確保
networkType
設為 ncp
(區分大小寫),且 cidr
設為所需的子網路。遵循 OpenShift 安裝指示,您將需要將
nsx-container-plugin-operator/deploy
的內容複製到 <installation_directory>/manifests
資料夾,然後產生 ignition-configs
。若要產生資訊清單,請執行下列命令:
$ ./openshift-install create manifests --dir=<installation_directory>
若要將 NCP 網路營運人員 YAML 檔案複製到
manifests
資料夾中,請執行下列命令:$ cp nsx-container-plugin-operator/deploy/*.yaml <installation_directory>/manifests
若要產生
ignition-configs
,請執行下列命令:$ ./openshift-install create ignition-configs --dir=<installation_directory>
使用 DDNS 搭配 OpenShift 節點
從 NCP 3.0.2 開始,您可以使用 DDNS 搭配執行 CoreOS 的 OpenShift 節點。當 nsx-ovs 容器執行時,它會停止使用 DHCP 之主機上的作用中連線,並從該主機複製新的連線,並在現有的連線名稱前面加上「NSX」。此 NSX 連線具有來自原始連線之動態 IP 資訊 (位址、閘道、DNS 和網域) 的 IP 組態。新的 DHCP 用戶端會在容器內啟動,以維護和更新租用。如果在執行 nsx-ovs 時 DNS 或網域名稱發生變更,則它會結束並重新啟動。完成此作業的以便先由 NetworkManager 然後才由 nsx-ovs 取得 IP 資訊。當 NSX 連線內容處於作用中狀態時,無法將其覆寫。