Deploy a new OpenShift Cluster on PowerVS from within another OpenShift, running the setup from a pod.
- Create a paid IBM Cloud Account.
- Create an API key.
- Add a new instance of an Object Storage Service (or reuse any existing one):
- Create a new bucket.
- Create a new credential with HMAC enabled.
- Create and upload (or just upload if you already have it) the required .ova images.
- Add a new instance of the Power Virtual Service.
- Create a private network and create a support ticket to enable connectivity between the VMs within this private network. Take a look at this video to learn how to create a new support ticket.
- Create the boot images.
NOTE: Details about the checklist steps can be found here.
- Create an account at RedHat portal
- Go to bit.ly/ocp-secrets and copy the pull secret.
- Paste the secret in the ocp-secrets file:
cluster-configuration/ocp-secrets
Set the required variables by setting its values in the following files
cluster-configuration/ocp-variables
NOTE: you can use the PowerVS Actions to get the necessary information to fill in the variables.
The variables you need to set are the following:
IBMCLOUD_API_KEY=
IBMCLOUD_REGION=
IBMCLOUD_ZONE=
POWERVS_INSTANCE_ID=
BASTION_IMAGE_NAME=
RHCOS_IMAGE_NAME=
PROCESSOR_TYPE=
SYSTEM_TYPE=
PRIVATE_NETWORK_NAME=
CLUSTER_DOMAIN=
STORAGE_CLASS_NAME=
PVC_SIZE=
In you need to set a proxy for the application running from within the pod, add the following variables (you can set the same value for both):
HTTP_PROXY=
HTTPS_PROXY=
You can get the proxy information set as part of your cluster using:
oc get proxy/cluster -o template --template {{.spec.httpProxy}}
oc get proxy/cluster -o template --template {{.spec.httpsProxy}}
IMPORTANT: if you are using a RHEL image for the bastion, you must add the following variables and its respectives values in the aforementioned variables file:
RHEL_SUBS_USERNAME=
RHEL_SUBS_PASSWORD=
ACTION=apply; OCP_VERSION=4.6; NEW_CLUSTER=$(./deploy.sh $ACTION $OCP_VERSION); \
cd ./clusters/$NEW_CLUSTER; \
oc new-project $NEW_CLUSTER --description="OCP Cluster on PowerVS" \
--display-name="OCP on PowerVS - $NEW_CLUSTER"; \
oc create -f ./secret.yaml; \
oc create -f ./pvc.yaml; \
oc create -f ./ocp-cluster.yaml
CLUSTER_ID=<SET ME>
ACTION=destroy; CLUSTER=$CLUSTER_ID; \
./deploy.sh $ACTION $CLUSTER; \
cd ./clusters/$CLUSTER_ID; \
oc delete -f ./ocp-cluster.yaml; \
oc create -f ./ocp-cluster.yaml; \
oc delete -f ./secret.yaml; \
oc delete -f ./pvc.yaml; \
oc delete project $CLUSTER_ID
Example:
# tree -L 2
.
|-- ocp-46-20210112-104034-b16efae55f
|-- ocp-cluster.yaml
|-- pvc.yaml
`-- secret.yaml
`-- ocp-46-20210112-104320-cebd1c0900
|-- ocp-cluster.yaml
|-- pvc.yaml
`-- secret.yaml
CLUSTER_ID=ocp-46-20210112-104034-b16efae55f
ACTION=destroy; CLUSTER=$CLUSTER_ID; \
./deploy.sh $ACTION $CLUSTER; \
cd ./clusters/$CLUSTER_ID; \
oc delete -f ./ocp-cluster.yaml; \ # deletes the first deployment, which created the cluster.
oc create -f ./ocp-cluster.yaml; \ # deploys a new pod to delete the cluster.
oc delete -f ./secret.yaml; \ # deletes the secrets created
oc delete -f ./pvc.yaml; \ # deletes the PVC allocated (you can ignore this step)
oc delete project $CLUSTER_ID # deletes the project create for deploying this cluster