A useful tool to create and check OpenShift clusters on IBM Cloud PowerVC.
To install an OpenShift cluster, please head to the main documentation root here.
CLI options:
- check-alive
- create-bastion
- create-cluster
- create-rhcos
- send-metadata
- watch-create
- watch-installation
This will check if the controller is alive.
Example usage:
$ ocp-ipi-powervc-linux-amd64 check-alive --serverIP ${controller_ip} -shouldDebug false
args:
-
serverIPThe IP address of the controller. -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
This will create an HAProxy VM which will act as an OpenShift Load Balancer. This VM will be managed by another instance of this program with the watch-installation parameter.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 create-bastion --cloud ${cloud_name} --bastionName ${bastion_name} --flavorName ${flavor_name} --imageName ${image_name} --networkName ${network_name} --sshKeyName ${ssh_keyname} --domainName ${domain_name} --enableHAProxy true --serverIP ${controller_ip} --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
bastionNameThe name of the VM to use which should match the OpenShift cluster name. -
flavorNameThe OpenStack flavor to create the VM with. -
imageNameThe OpenStack image to create the VM with. -
networkNameThe OpenStack network to create the VM with. -
sshKeyNameThe OpenStack ssh keyname to create the VM with. -
domainNameThe DNS domain name for the bastion. (optional) -
enableHAProxydefaults totrue. If we should install HA Proxy on the bastion node. -
serverIPThe IP address of the controller. -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
NOTE: DEPRECATED
This was a development tool used during the initial investigation. It takes a powervc install-config.yaml, converts it to a openstack configuration, calls the IPI installer, and then converts the generated files to work on a PowerVC setup.
Example usage:
$ ocp-ipi-powervc-linux-amd64 create-cluster --directory ${directory} --shouldDebug true
args:
-
directorylocation to use the IPI installer -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
This will create a test RHCOS VM. This VM will be managed by the controller.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 create-rhcos --cloud ${cloud_name} --rhcosName ${rhcos_name} --flavorName ${flavor_name} --imageName ${image_name} --networkName ${network_name} --sshPublicKey $(cat ${HOME}/.ssh/id_installer_rsa.pub) --domainName ${domain_name} --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
rhcosNameThe name of the VM to use which should match the OpenShift cluster name. -
flavorNameThe OpenStack flavor to create the VM with. -
imageNameThe OpenStack image to create the VM with. -
networkNameThe OpenStack network to create the VM with. -
passwdHashThe password hash of the core user. -
sshPublicKeyThe OpenStack ssh keyname to create the VM with. -
domainNameThe DNS domain name for the bastion. (optional) -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
This will send a command to the server to either create or delete a local copy of the metadata.json file.
Example usage:
$ ocp-ipi-powervc-linux-amd64 send-metadata --createMetadata ${directory}/metadata.json --serverIP ${controller_ip} --shouldDebug true
args:
-
createMetadataTells the server to create a local copy of this metadata.json file. -
deleteMetadataTells the server to delete a local copy of this metadata.json file. -
serverIPThe IP address of the controller. -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
NOTE:
The environment variable IBMCLOUD_API_KEY needs to be set.
Example usage:
$ ocp-ipi-powervc-linux-amd64 watch-create --metadata ${directory}/metadata.json --kubeconfig ${directory}/auth/kubeconfig --cloud ${cloud_name} --bastionUsername ${bastion_username} --bastionRsa ${HOME}/.ssh/id_installer_rsa --baseDomain ${domain_name} --shouldDebug false
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
metadatathe location of themetadata.jsonfile created by the IPI OpenShift installer. -
kubeconfigthe location of thekubeconfigfile created by the IPI OpenShift installer. -
bastionUsernamethe default username for the HAProxy VM. -
bastionRsathe SSH private key file for the default username for the HAProxy VM. -
baseDomainthe domain name of the OpenShift cluster. -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
This is for checking the progress of an ongoing openshift-install create cluster operation of the OpenShift IPI installer. Run this in another window while the installer deploys a cluster.
NOTE:
The environment variable IBMCLOUD_API_KEY is optional. If not set, make sure DNS is supported via CoreOS DNS or another method.
Example usage:
$ ocp-ipi-powervc-linux-amd64 watch-installation --cloud ${cloud_name} --domainName ${domain_name} --bastionMetadata ${directory}/metadata.json --bastionUsername ${bastion_username} --bastionRsa ${HOME}/.ssh/id_installer_rsa --dhcpSubnet ${dhcp_subnet} --dhcpNetmask ${dhcp_netmask} --dhcpRouter ${dhcp_router} --dhcpDnsServers "${dhcp_servers}" --shouldDebug true
args:
-
cloudthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
domainNamethe domain name to use for the OpenShift cluster. -
bastionMetadatathe location of themetadata.jsonfile created by the IPI OpenShift installer. This parameter can have more than one occurance. -
bastionUsernamethe default username for the HAProxy VM. -
bastionRsathe SSH private key file for the default username for the HAProxy VM. -
enableDhcpddefaults to `false. Enables updating the locally installed dhcp server. -
dhcpInterfaceThe network interface to listen for DHCPd requests. -
dhcpSubnetThe subnet to use for DHCPd requests. -
dhcpNetmaskThe netmask to use for DHCPd requests. -
dhcpRouterThe router to use for DHCPd requests. -
dhcpDnsServersThe comma separated DNS servers to use for DHCPd requests. -
dhcpServerIdThe DNS server identifier for a DHCP request. -
shouldDebugdefauts tofalse. This will cause the program to output verbose debugging information.
scripts/create-cluster.sh
Required environment variables before running this script:
-
BASEDOMAINthe domain name to use for the OpenShift cluster. -
BASTION_IMAGE_NAMEthe OpenStack image name for the HAProxy VM. -
BASTION_USERNAMEthe default username for the HAProxy VM. -
CLOUDthe name of the cloud to use in the~/.config/openstack/clouds.yamlfile. -
CLUSTER_DIRthe directory location where the OpenShift IPI installer will save important files. -
CLUSTER_NAMEthe name prefix to use for the OpenShift cluster which you are installing. -
CONTROLLER_IPthe IP address of the controller. -
FLAVOR_NAMEthe OpenStack flavor name to use for OpenShift VMs. -
MACHINE_TYPEthe PowerPC machine type to use for OpenShift VMs. -
NETWORK_NAMEthe OpenStack network name to use for OpenShift VMs. -
RHCOS_IMAGE_NAMEthe OpenStack image name to use for OpenShift VMs. -
SSHKEY_NAMEthe OpenStack ssh keyname to use for the HAProxy VM.
Required existing files before running this script:
-
~/.pullSecretCompact -
~/.ssh/id_installer_rsa.pub
Required existing binaries before running this script:
-
openshift-installThe OpenShift IPI installer. -
openstackThe OpenStack CLI tool existing on Fedora/RHEL/CentOS repositories. -
jqThe JSON query CLI tool found at https://jqlang.org/download/ and existing on Fedora/RHEL/CentOS repositories.