OpenShift Container Platform for HA 加速器入門
在 IBM Cloud Pak® System上部署 OpenShift Container Platform - HA 的必要條件及步驟。
程序
確保 Red Hat Satellite 6 共用服務實例在 RHEL 8.6:
- ansible-2.9-for-rhel-8-x86_64-rpms
- rhel-8-for-x86_64-baseos-rpms
- rhel-8-for-x86_64-appstream-rpms
附註:
- 這些套件僅由協助程式節點使用。
- Red Hat Satellite Server for 4.x中不需要 OpenShift Container Platform RPM。 如需 Red Hat Satellite Server 設定的相關資訊,請參閱 IBM Cloud Pak System上的 部署 RedHat OpenShift 4.3 。 逐步指導教學
。
部署 Cloud Pak Docker Private Registry 虛擬系統加速器,它會自動載入 OpenShift Container Platform 4.12.0 映像檔。 儲存此部署的「完整網域名稱 (FQDN)」,以進行下一步。
在您計劃部署 OpenShift Container Platform 叢集的雲端群組中部署 IBM Cloud Pak® System 登錄服務共用服務。 當您部署「 IBM Cloud Pak System 登錄服務」共用服務時,請輸入在前一個步驟中部署的 Cloud Pak Docker Private Registry 加速器的 FQDN。
選用項目: 為 IP 群組中用於部署 OpenShift Container Platform 叢集的每一個 IP 設定 DNS 萬用字元位址。 它可讓您透過 IBM Cloud Pak System 使用者介面上的主控台鏈結,立即存取主控台。 如果未事先設定 DNS,則您可以執行下列步驟:
基於測試目的,請從執行 Web 瀏覽器的系統中,將項目新增至
/etc/hosts。在 OpenShift Container Platform 安裝完成之後隨時個別新增 DNS 項目。 針對 IP 群組中用於 OpenShift Container Platform 部署的每一個 IP 位址,新增下列兩個萬用字元項目:
*.<fqdn> IN A <ip> *.apps.<fqdn> IN A <ip>附註: 部署完成之後, OpenShift Container Platform 加速器部署的「歷程」區段中會提供指示。 比方說,如果此 FQDN 項目存在於 DNS 中:
9.9.9.9 cps-xxx.domain.com則新增這兩個萬用字元項目:
*.cps-xxx.domain.com IN A 9.9.9.9 *.apps.cps-xxx.domain.com IN A 9.9.9.9
附註:OpenShift 會限制 CoreOS 主機名稱的字元數上限。 主機名稱的字元數上限不能超過 63 個字元。 在您定義 FQDN(叢集名稱和網域名稱)時,請考量這項限制。 例如,CoreOS 工作程式節點的主機名稱是 "worker-xxxx.clustername.domain"。
如需 OpenShift 外部 DNS 需求的相關資訊,請參閱 使用者佈建的 DNS 需求
。 列出為 "This record must be resolvable by both client external to the cluster ..." 的 DNS 記錄 是必要項目。 在「協助程式節點」上提供 DNS,以涵蓋叢集內的解析。
部署 OpenShift Container Platform 加速器。 有 * 的部署欄位才是必要的。 請指定您要部署的「OpenShift 版本」。 依預設,它是 V4.12.0 ,符合 Cloud Pak Docker Private Registry 中載入的映像檔。 如果未指定「OpenShift 叢集名稱」和「OpenShift 基本網域」,則此部署會自動以在兩個「協助程式節點」前面所使用的浮動 IP 位址來命名該叢集。 這很適合提前預先載入的 DNS 萬用字元項目。 叢集可透過 IBM Cloud Pak System 使用者介面上的主控台鏈結立即存取。
附註:
- DNS 名稱只能包含字母字元 (a-z)、數值字元 (0-9)、減號 (-) 及句點 (.)。 僅容許使用句點字元來定界網域樣式名稱的元件。
- 如果您要部署 4.12.0以外的任何其他版本,請指定 OpenShift 版本。 如果您使用 Cloud Pak Docker 型樣來設定登錄,請確定您的登錄已載入該映像檔。
存取 OpenShift Container Platform 主控台:
從 Cloud Pak System 使用者介面擷取 kubeadmin 密碼。
展開 PrimaryHelper 虛擬機器,然後按一下區段底端附近的 OpenShift 主控台鏈結。
username: kubeadmin password: <password retrieved from step 1>附註:如果 OpenShift 主控台不管部署成功,依然未在瀏覽器中開啟,請確定下列其中一個活動已完成:
- DNS 萬用字元項目會在部署之前或之後新增。
/etc/hosts項目存在於具有 Web 瀏覽器的系統上。
部署歷程中的範例輸出有更多關於要在 DNS 或
/etc/hosts中新增的確切字行的指示,例如:OpenShift Web 主控台:
https://console-openshift-console.apps.test.domain.com將下列萬用字元項目新增至 DNS 伺服器,以存取 OpenShift Web 主控台、應用程式及 API:
*.<host name> IN A 9.9.9.9 *.<host name> IN A 9.9.9.9基於測試目的,請新增下列
/etc/hosts項目來存取 OpenShift Web 主控台:9.9.9.9 console-openshift-console.apps.test.domain.com oauth-<host name>
如果 OpenShift 叢集已斷線,別忘了向 Red Hat 登錄您的 OpenShift 叢集。 如果您的 OpenShift 叢集無法存取網際網路來呼叫到 Red Hat,就需要採取這個手動步驟。 若要在「叢集登錄」頁面上登錄叢集,請參閱 在使用者佈建的基礎架構上完成安裝
。
若要升級 OpenShift Container Platform 叢集,請確保新版本映像檔已鏡映至 Docker Private Registry。 在 IBM Cloud Pak System 上部署 OpenShift Container Platform 叢集是已斷線的叢集。 如需如何升級的相關資訊,請參閱 使用 CLI 更新次要版本內的叢集
。
下列訊息彙總鏈結的步驟。
"Disconnected clusters Customers which have chosen to not be connected to Red Hat and are curating their own OpenShift Container Platform container image content manually should consult the Red Hat errata associated with product releases and note any comments impacting upgrades. During upgrade the user interface may caution about switching between these versions and it is up to the customer to ensure they have correctly selected the appropriate version before bypassing those cautions."例如,若要將叢集升級至 V4.10.0 至 V4.12.0,請從 4.12.0上的 Red Hat 中尋找 release.txt 。
https://mirror.openshift.com/pub/openshift-v4/clients/ocp/4.12.0/release.txt尋找標示為「摘要」的值:
摘要:
sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9確保映像檔鏡映至 IBM Cloud Pak System 及 OpenShift Container Platform 叢集所使用的專用 Docker 登錄。 如果您需要相關資訊或說明,請參閱 使用 Red Hat OpenShift 的鏡映登錄建立鏡映登錄
。
登入主要 Helper 節點,並從指令行執行 upgrade 指令,這會指向您的專用 Docker 登錄,以及來自新 OpenShift Container Platform 版本的映像檔。
-bash-4.2# oc adm upgrade --to-image=ipas-pvm-144-004.cps.test.domain.com:443/ocp4/ openshift4@sha256:d78292e9730dd387ff6198197c8b0598da340be7678e8e1e4810b557a926c2b9 --allow-explicit-upgrade --force=true Updating to release image ipas-pvm-144-004.cps.raleigh.ibm.com:443/ocp4/ openshift4@sha256:b51a0c316bb0c11686e6b038ec7c9f7ff96763f47a53c3443ac82e8c054bc035如果要查看升級的進度,請移至管理 > 叢集設定 > 叢集操作程式頁面。
附註:如果 "openshift-samples" 叢集操作程式因安裝過程中的網際網路連線中斷而效能欠佳,請執行下列步驟:
- 移至首頁 > 搜尋 > "config" > samples.operator.openshift.io。
- 編輯 YAML 並變更為
managementState: Removed。 - 儲存檔案。
此外,如需步驟的相關資訊,請參閱 搭配使用 Cluster Samples Operator 與替代登錄
的步驟 5。
OpenShift Container Platform 升級可能需要大約一小時才能完成。