該項目包含一個BASH腳本,可幫助您在IBM®雲(PowerVS)上的IBM®PowerSystems™虛擬服務器上部署OpenShift Container Platform 4.x。 OCP4-UPI-PowerVS上的TerraForm代碼用於部署過程。
確保您的PowerVS實例已準備好部署OpenShift群集。請檢查此鏈接以獲取更多詳細信息
這是快速演示。
腳本僅支持64位操作系統。
該腳本需要bash Shell和Package Manager預先配置。
需要Catalina(10.15)及以上。
該腳本使用Homebrew Package Manager安裝所需的軟件包。
需要RHEL8/CENTOS8及以上或Ubuntu 16.04及以上。
該腳本根據分佈使用默認軟件包管理器( yum/dnf/apt )。
該腳本可以在Gitbash,Linux和Cygwin終端的Windows子系統上運行。
如果使用Cygwin,請確保安裝curl和解unzip軟件包。您將需要再次運行Cygwin設置。
注意: PowerShell不受支持。
$ mkdir ocp-install-dir && cd ocp-install-dir
$ curl -sL https://raw.githubusercontent.com/ocp-power-automation/openshift-install-power/main/openshift-install-powervs -o ./openshift-install-powervs
$ chmod +x ./openshift-install-powervs
$ ./openshift-install-powervs
Automation for deploying OpenShift 4.X on PowerVS
Usage:
openshift-install-powervs [command] [<args> [<value>]]
Available commands:
setup Install all the required packages/binaries in current directory
variables Interactive way to populate the variables file
create Create an OpenShift cluster
destroy Destroy an OpenShift cluster
output Display the cluster information. Runs terraform output [NAME]
access-info Display the access information of installed OpenShift cluster
help Display this information
Where <args>:
-var Terraform variable to be passed to the create/destroy command
-var-file Terraform variable file name in current directory. (By default using var.tfvars)
-flavor Cluster compute template to use eg: small, medium, large
-force-destroy Not ask for confirmation during destroy command
-ignore-os-checks Ignore operating system related checks
-ignore-warnings Warning messages will not be displayed. Should be specified first, before any other args.
-verbose Enable verbose for terraform console messages
-all-images List all the images available during variables prompt
-trace Enable tracing of all executed commands
-version, -v Display the script version
Environment Variables:
IBMCLOUD_API_KEY IBM Cloud API key
RELEASE_VER OpenShift release version (Default: 4.15)
ARTIFACTS_VERSION Tag or Branch name of ocp4-upi-powervs repository (Default: main)
RHEL_SUBS_PASSWORD RHEL subscription password if not provided in variables
NO_OF_RETRY Number of retries/attempts to run repeatable actions such as create (Default: 5)
Submit issues at: https://github.com/ocp-power-automation/openshift-install-power/issues
使用容器圖像
要使用quay.io/powercloud存儲庫中的圖像,請運行以下命令。
docker run -it -e IBMCLOUD_API_KEY="<key>" -v $(pwd):/data quay.io/powercloud/openshift-install-powervs:<valid-tag> create
或者
podman run -it -e IBMCLOUD_API_KEY="<key>" -v $(pwd):/data quay.io/powercloud/openshift-install-powervs:<valid-tag> create
標籤提供有關發布版本,OCP版本或支持的體系結構的信息。
如果您需要構建OpenShift-install-Powervs圖像,請查看以下“使用容器”鏈接
該腳本假設Powervs OpenShift的先決條件已經到位。
如果您錯過了,這是前提條件的鏈接
對於運行腳本,您需要以下內容:
導出IBM Cloud API密鑰和RHEL訂閱密碼。
$ set +o history
$ export IBMCLOUD_API_KEY='<your API key>'
$ export RHEL_SUBS_PASSWORD='<your RHEL subscription password>'
$ set -o history
運行create命令。
$ ./openshift-install-powervs create
腳本將設置所需的工具並以交互式模式運行,以提示輸入。
一旦上述命令成功完成,它將打印群集訪問信息。
Login to bastion: 'ssh -i automation/data/id_rsa [email protected]' and start using the 'oc' command.
To access the cluster on local system when using 'oc' run: 'export KUBECONFIG=/root/ocp-install-dir/automation/kubeconfig'
Access the OpenShift web-console here: https://console-openshift-console.apps.test-ocp-6f2c.ibm.com
Login to the console with user: "kubeadmin", and password: "MHvmI-z5nY8-CBFKF-hmCDJ"
Add the line on local system 'hosts' file:
145.48.43.53 api.test-ocp-6f2c.ibm.com console-openshift-console.apps.test-ocp-6f2c.ibm.com integrated-oauth-server-openshift-authentication.apps.test-ocp-6f2c.ibm.com oauth-openshift.apps.test-ocp-6f2c.ibm.com prometheus-k8s-openshift-monitoring.apps.test-ocp-6f2c.ibm.com grafana-openshift-monitoring.apps.test-ocp-6f2c.ibm.com example.apps.test-ocp-6f2c.ibm.com
在運行腳本之前,您可以根據需要選擇覆蓋某些環境變量。
默認情況下,已安裝OpenShift版本4.15。
如果要安裝4.14,請導出變量RELEASE_VER 。
$ export RELEASE_VER="4.14"
您可以通過在安裝目錄中擁有所需的輸入文件來避免交互模式
所需的輸入文件
Terraform vars文件(文件名: var.tfvars )
ssh鍵文件(文件名: id_rsa & id_rsa.pub )
示例var.tfvars文件
ibmcloud_region = "syd"
ibmcloud_zone = "syd04"
service_instance_id = "123456abc-xzz-2223434343"
rhel_image_name = "rhel-83"
rhcos_image_name = "rhcos-415"
network_name = "ocp-net"
openshift_install_tarball = "https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/stable-4.15/openshift-install-linux.tar.gz"
openshift_client_tarball = "https://mirror.openshift.com/pub/openshift-v4/ppc64le/clients/ocp/stable-4.15/openshift-client-linux.tar.gz"
cluster_id_prefix = "test-ocp"
cluster_domain = "xip.io"
storage_type = "nfs"
volume_size = "300"
bastion = {memory = "16", processors = "1", "count" = 1}
bootstrap = {memory = "32", processors = "0.5", "count" = 1}
master = {memory = "32", processors = "0.5", "count" = 3}
worker = {memory = "32", processors = "0.5", "count" = 2}
rhel_subscription_username = "[email protected]"
rhel_subscription_password = "mysubscriptionPassword"
您還可以使用選項-var-file <filename>將自定義Terraform變量文件傳遞給腳本。您還可以使用選項-var "key=value"傳遞一個變量。如果給出相同的變量多次一次,則優先級將是從左側(低)到右(高)。
查看以下學習路徑,用於部署和使用OpenShift powervs
腳本支持以下核心命令。
下面是一個簡單的流程圖,解釋了每個命令的流程。

請參閱貢獻文檔以獲取更多詳細信息。 PR是最歡迎的!