Installer Provisioned Infrastructure method can be used to deploy an OpenShift cluster on IBM PowerVS.
This blog post covers creating and destroying a “public” OpenShift cluster i.e., one which is accessible through the internet and the nodes of the cluster can.
It is also possible to create an OpenShift cluster using IPI on Power VS for
- Private scenario: A cluster where DNS, Ingress Controller, and API server are private
- Disconnected scenario: A cluster where the nodes do not have access to the internet.
However, these two scenarios are outside the scope of this blog post.
Requirements for installing OpenShift on Power VS with IPI
- Create an IBM Cloud account.
- Create an IBM Cloud service account (optional)
Refer https://www.ibm.com/docs/en/dbaoc?topic=access-creating-managing-service-accounts for details on creating it.
- Create a resource group (optional)
Resource group is a logical grouping of resources such that a set of users can be allowed access to that group rather than enabling access to individual resources.
Refer https://cloud.ibm.com/docs/account?topic=account-rgs for steps on creating a resource group.
It is possible that your account admin set a different resource group as the default. Verify the name of the default resource group before continuing.
- Create an access group (optional)
An access group allows you to group users and assign required access policies to them based on their role. Refer https://cloud.ibm.com/docs/account?topic=account-groups for details on creating an access group.
Refer https://docs.redhat.com/en/documentation/openshift_container_platform/4.22/html/installing_on_ibm_power_virtual_server/installing-ibm-cloud-account-power-vs#pre-requisite-permissions-ibm-cloud_installing-ibm-cloud-account-power-vs for information on roles and their respective permissions.
- Assign permissions to the access group created as a part of the previous step through either of the following approaches (optional)
- UI (recommended)
Follow these steps: https://cloud.ibm.com/docs/account?topic=account-groups&interface=ui#access_ag
- CLI
ibmcloud iam access-group-policy-create GROUP_NAME {-f, --file @JSON_FILE | --roles ROLE_NAME1,ROLE_NAME2... [--service-name SERVICE_NAME] [--service-instance SERVICE_INSTANCE] [--region REGION] [--resource-type RESOURCE_TYPE] [--resource RESOURCE] [--resource-group-name RESOURCE_GROUP_NAME] [--resource-group-id RESOURCE_GROUP_ID]}
e.g. ibmcloud iam access-group-policy-create example_group --roles Administrator --service-name sample-service
This will give example_group Administrator role for all sample-service resources.
- Create or reuse an API key associated with the service account
Refer https://cloud.ibm.com/docs/account?topic=account-serviceidapikeys
- Create an SSH key pair locally
- Create or reuse an IBM Cloud Internet Services instance.
- Configure CIS to manage the domain you wish to use for your cluster. See https://cloud.ibm.com/docs/cis?topic=cis-getting-started for more info. The installer will add DNS records during installation.
- Obtain the openshift-install and oc binaries.
- Access the PowerVS IPI installer page on the OpenShift Cluster Manager site. If you have a Red Hat account, log in with your credentials. If you do not, create an account.
- Download the OpenShift installer and the Command Line interface that correspond with your host operating system and architecture.
Make sure you download the openshift-install and oc archives for the architecture of the system you're using for deployment. For example, if you're using an x86_64 VM to carry out deployment, the installer package may be named openshift-install-linux-amd64-4.22.x.tar.gz.
- Extract the installation program and client archives. For example, on a computer that uses a Linux operating system, run the following command:
tar -xvf openshift-install-linux-amd64-4.22.2.tar.gz && tar -xvf openshift-client-linux-amd64-4.22.2.tar.gz
- Download your installation pull secret from the Red Hat OpenShift Cluster Manager. This pull secret allows you to authenticate with the services that are provided by the included authorities, including Quay.io, which serves the container images for OpenShift Container Platform components.
- Move the
openshift-install and oc binaries to a folder in your $PATH, such as /usr/bin/
- Install podman
- Generate Cloud Credentials by using the ccoctl.sh script and referring to the associated documentation, or follow the manual procedure detailed in steps 12.1 and 12.2 below.
- Obtain the ccoctl binary; the general approach is as follows. Additional information can be found in this guide.
- Set the OCP_VERSION
OCP_VERSION=$(openshift-install version | head -n 1| awk '{print $2}')
- Obtain the architecture string for the system from which you're planning to run the installation
uname -m
- Set the
CCO_RELEASE_IMAGE.
- If the output of the above command was ppc64le, run
CCO_RELEASE_IMAGE=quay.io/openshift-release-dev/ocp-release@$(podman manifest inspect quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-multi | jq '.manifests[] | select(.platform.architecture=="ppc64le")' | jq '.digest' | tr -d '"')
- If the output was
x86 or amd64, run
CCO_RELEASE_IMAGE=quay.io/openshift-release-dev/ocp-release@$(podman manifest inspect quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-multi | jq '.manifests[] | select(.platform.architecture=="amd64")' | jq '.digest' | tr -d '"')
- If the output was
aarch64 or arm64, run
CCO_RELEASE_IMAGE=quay.io/openshift-release-dev/ocp-release@$(podman manifest inspect quay.io/openshift-release-dev/ocp-release:${OCP_VERSION}-multi | jq '.manifests[] | select(.platform.architecture=="arm64")' | jq '.digest' | tr -d '"')
- Obtain the CCO container image from the OpenShift Container Platform release image by running the following command
CCO_IMAGE=$(oc adm release info --image-for='cloud-credential-operator' $RELEASE_IMAGE -a <path to pull secret file>)
- Extract the ccoctl binary from the CCO container image within the OpenShift Container Platform release image by running the following command:
oc image extract $CCO_IMAGE --file="/usr/bin/ccoctl" -a <path to pull secret file>
- Change the permissions to make ccoctl executable by running the following command
chmod 775 ccoctl
- Extract the credentials
mkdir credreqs
- Obtain the OpenShift Container Platform release image by running the following command
RELEASE_IMAGE=$(openshift-install version | awk '/release image/ {print $3}')
oc adm release extract --cloud=powervs --credentials-requests $RELEASE_IMAGE --to=./credreqs
- Set IBMCLOUD_API_KEY in your environment
e.g. IBMCLOUD_API=your API KEY
ccoctl ibmcloud create-service-id --credentials-requests-dir ./credreqs --name <name> --resource-group-name <resource-group-name>
resource-group-name is optional but recommended.
Note: for <name>, choose any string to be used as a name for service ids created in your IBM Cloud account. Consider using the same string later that you use to title the cluster itself so that resources can be visually or programatically associated
Note that cluster resources will be charged as per IBM pricing and follows an operational expenditure model.
- Create a sub-directory to hold the artifacts the installer creates (install configuration, manifests, metadata, cluster authentication data, etc.)
mkdir ocp-deploy
Create the install configuration
openshift-install create install-config --dir=ocp-deploy
Folder specified must be the same as the above step.
You will be prompted for several pieces of information required for deploying the cluster
- SSH public key
- Platform: Select powervs
- IBM Cloud User ID
- IBM Cloud API Key
- Region
Region where the cluster will be deployed
- Zone
One or more zones contained within the region specified in v.
- Base domain
A domain created using IBM Cloud Internet Services.
- Cluster name
- Pull secret
RedHat pull secret
- If you don’t have an existing workspace or don’t want to use it for cluster deployment, skip steps c and d.
- Obtain the workspace (formerly called service instance) GUID.
- Install IBM cloud CLI by referring https://cloud.ibm.com/docs/cli?topic=cli-install-ibmcloud-cli, selecting the installation method for your operating system
- Log in to your IBM cloud account using
ibmcloud login
If you’re using Windows, enter ibmcloud resource service-instance <name of the workspace> and note the value in the GUID field of the output
- If you’re using Linux or Mac, enter
ibmcloud resource service-instance <name of the workspace> | grep -i GUID. Note the id displayed in the output.
- Edit install-config.yaml to include the workspace’s GUID.
- Open
ocp-deploy/install-config.yaml with an editor of your choice.
e.g. vi ocp-deploy/install-config.yaml
Add a property
platform.powervs.serviceInstanceGUID: GUID of the workspace in which cluster nodes will be created.
- If you wish to reuse the created
install-config.yaml for future deployments, back it up at a securely as it contains your pull secret. The following steps will delete the install-config.yaml
Note: Certain values such as the region, zone, etc. will be stored in ~/.powervs/config.json. If you wish to start over, you may want to delete it.
- Create manifests
openshift-install create manifests --dir=ocp-deploy
Folder specified must be the same as step 1 above.
- Copy the credentials files created in requirement 11 into
ocp-deploy/manifests
Trigger the installation
openshift-install create cluster --dir=ocp-deploy --log-level=debug
- Folder specified must be the same as step 1 above.
- The
log-level flag is optional but is recommended to be set to debug during manual installation for detailed logs.
- Post-installation
- The output should show how the cluster can be accessed through CLI and GUI.
- The
ocp-deploy folder created in step 1 will now contain several useful artifacts, including
.openshift_install.log containing the installation log.
- An
auth folder containing the kubeconfig to be used to access the cluster through CLI.
metadata.json containing cluster metadata.
- Retain the folder created in the above step as the metadata.json file in it is required to delete the cluster.
- A support license can be purchased from try.openshift.com after the cluster is installed.
Destroying an OpenShift Cluster
- Navigate to the folder where the
openshift-install binary and the cluster artifact directory are present (here, ocp-deploy).
cd <parent path of openshift-install binary and cluster artifact directory>
openshift-install destroy cluster --dir=ocp-deploy --log-level=debug
The log-level flag is optional but is recommended to be set to debug during manual installation for detailed logs.
- Optional: Delete the Workspace
- Log into cloud.ibm.com
- Expand the hamburger menu on the top left.
- Resource list
- Look for the Workspace which was specified during cluster installation and click the three dots against it.
- Delete
- Optional: Delete the Cloud credentials
ccoctl ibmcloud delete-service-id --credentials-requests-dir <path-to-directory-with-list-of-credentials-requests> --name <name>
#Containers,Kubernetes,andOpenShift