Provision a new team development OpenShift cluster that is preconfigured with the IBM Cloud Operator, CodeReady Workspaces, and CodeReady Pipelines.
This Terraform template does the following actions:
- Create an OpenShift cluster on IBM Cloud.
- Install the IBM Cloud Operator into the cluster.
- Install the CodeReady Workspaces Operator into the cluster.
- Create an instance of Eclipse Che (team editing environment) inside of the cluster.
- Install the CodeReady Pipelines Operator into the cluster.
- Create an IBM Cloud account.
- Install the IBM Cloud CLI.
- Install the OpenShift CLI.
- Download Terraform binary. Extract the file and keep the binary in path
ex- /usr/local/bin
. - Download IBM Cloud Provider plug-in. Extract the file and keep the binary in path in the same directory where you placed Terraform binary in the previous step. You can also build the binary yourself. For more information, see the Terraform provider documentation.
- Ensure that the kubectl CLI
is configured to access your cluster.
To run this project locally, complete the following steps:
- Clone this project.
- You can override default values that are in your
variables.tf
file.- Alternatively, you can supply these values by using the command line or environment variables.
You can use IBM Cloud Schematics to deploy this Terraform template in the cloud without having a local terraform configuration. Just use this link:
Export the following environment variables:
TF_VAR_ibmcloud_api_key
- your IBM Cloud API key
On OS X, enter the following command into your terminal, and replace the <value>
characters with the actual values (be sure to remove the <>
):
export TF_VAR_ibmcloud_api_key=<value>
After installation, more configuration is needed to take advantage of the tools installed into your cluster.
After your cluster is created and the IBM Cloud Operator is installed, you must finish configuration of the IBM Cloud Operator before it can be used to create or bind services on IBM Cloud.
Before installing the operator, complete these steps:
- Log in to your IBM cloud account by using the IBM Cloud CLI:
ibmcloud login
- Set a default target environment for your resources with the following command:
ibmcloud target --cf -g default
- To specify a different IBM Cloud ResourceGroup other than
default
, use the following command:
ibmcloud target -g <resource-group>
Note that the org
and space
must be included, even if you do not plan to instantiate any Cloud Foundry services.
- Configure the operator by running the following script:
curl -sL https://raw.githubusercontent.com/IBM/cloud-operators/master/hack/config-operator.sh | bash
The script creates an IBM Cloud API Key and stores it in a Kubernetes secret that can be accessed by the operator. The script also sets defaults, such as the resource group and region that are used to provision IBM Cloud services. You can always override the defaults in the Service custom resource. If you prefer to create the secret and the defaults manually, see the IBM Cloud Operator documentation.
After the development cluster Terraform template is finished running, you get an OpenShift cluster that already has the CodeReady Workspaces Operator installed, and has already created a CheCluster instance.
To see the URL for the CodeReady Workspaces instance, do either of the following steps:
- View the Terraform logs to locate the direct URL to the CodeReady Workspaces instance.
- Open the OpenShift Dashboard, navigate to the
codeready-workspaces
project, and then find thecodeready
deployment to see the URL route that is associated with the CheCluster instance.
IAM#[email protected]
. This format is not compatible with the CodeReady Workspaces runtime. The username should be an alphanumeric text string without any special characters and without the IAM#
prefix.
Variable Name | Description | Default Value |
---|---|---|
resource_group_name | Existing resource group where the IBM Kubernetes Service cluster is provisioned. Use ibmcloud resource groups or visit https://cloud.ibm.com/account/resource-groups to see a list of available resource groups. |
|
private_vlan_id | Existing private VLAN ID for cluster creation. Use ibmcloud ks vlan ls --zone <zone> or visit https://cloud.ibm.com/classic/network/vlans to see a list of available private VLANs. If you do not have any existing VLANs, leave this field blank. |
|
public_vlan_id | Existing public VLAN ID for cluster creation. Use ibmcloud ks vlan ls --zone <zone> or visit https://cloud.ibm.com/classic/network/vlans to see a list of available public VLANs. If you do not have any existing VLANs, leave this field blank. |
|
vlan_datacenter | Data center for VLANs that are defined in private_vlan_number and public_vlan_number . Use ibmcloud ks zone ls --provider classic to see a list of available data centers. The data center should be within the cluster's region. |
|
cluster_machine_type | Machine type for the cluster worker nodes (b3c.4x16 is minimum for OpenShift). Use ibmcloud ks flavors --zone <zone> to see the available flavors. |
b3c.4x16 |
cluster_worker_count | Number of worker nodes for the cluster. | 3 |
cluster_hardware | Level of hardware isolation for your worker node. Use dedicated to have available physical resources that are dedicated to you only, or use shared to allow physical resources to be shared with other IBM customers. |
shared |
cluster_name | Name of the cluster. | |
cluster_version | OpenShift version to install. Use ibmcloud ks versions --show-version OpenShift to see a list of OpenShift versions. |
4.3_openshift |
cluster_region | IBM Cloud region for the cluster installation. Use ibmcloud regions to see a list of regions. |