Use this module to install a WebSphere Liberty operator on your Red Hat OpenShift Container Platform on VPC landing zone.
For more information about the IBM WebSphere Liberty operator refer to the official documentation avaiable here
##############################################################################
# Config providers
##############################################################################
provider "ibm" {
ibmcloud_api_key = var.ibmcloud_api_key # pragma: allowlist secret
region = var.region
}
provider "helm" {
kubernetes {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
}
}
provider "kubernetes" {
host = data.ibm_container_cluster_config.cluster_config.host
token = data.ibm_container_cluster_config.cluster_config.token
}
##############################################################################
# IBM WebSphere Liberty operator deployment on the OCP cluster
##############################################################################
data "ibm_container_cluster_config" "cluster_config" {
cluster_name_id = var.cluster_id
config_dir = "${path.module}/kubeconfig"
endpoint_type = var.cluster_config_endpoint_type != "default" ? var.cluster_config_endpoint_type : null # null represents default
}
module "websphere_liberty_operator" {
# Replace "master" with a GIT release version to lock into a specific release
source = "https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator.git?ref=master"
cluster_id = var.cluster_id
add_ibm_operator_catalog = true
create_ws_liberty_operator_namespace = false
ws_liberty_operator_namespace = "ws-liberty-operator-namespace"
ws_liberty_operator_target_namespace = "openshift-operators"
cluster_config_endpoint_type = "default"
install_wslo_sampleapp = true
wslo_sampleapp_name = "sample-app"
wslo_sampleapp_namespace = "sample-app-namespace"
operator_helm_release_namespace = "liberty-operator-helm-release"
ws_liberty_operator_install_plan_approval = "Automatic"
}
locals {
websphere_liberty_operator_sampleapp_url = var.install_wslo_sampleapp == true ? "https://${module.websphere_liberty_operator.websphere_liberty_operator_sampleapp_url}" : null
}
output "websphere_liberty_operator_sample_app_url" {
description = "URL of the IBM WebSphere Liberty operator sample app if deployed."
value = local.websphere_liberty_operator_sampleapp_url
}
- IAM Services
- Kubernetes service
Viewer
platform accessManager
service access
- Kubernetes service
Name | Version |
---|---|
terraform | >= 1.3.0 |
external | >=2.2.3, <3.0.0 |
helm | >= 2.8.0, <3.0.0 |
ibm | >= 1.59.0, < 2.0.0 |
kubernetes | >= 2.16.1, <3.0.0 |
null | >= 3.2.1, < 4.0.0 |
time | >= 0.9.1, < 1.0.0 |
No modules.
Name | Description | Type | Default | Required |
---|---|---|---|---|
add_ibm_operator_catalog | Whether to configure the IBM Operator Catalog in the cluster before the IBM WebSphere Liberty operator is installed. Default is true . |
bool |
true |
no |
cluster_config_endpoint_type | Specify which type of endpoint to use for for cluster config access: 'default', 'private', 'vpe', 'link'. 'default' value will use the default endpoint of the cluster. | string |
"default" |
no |
cluster_id | Id of the target IBM Cloud OpenShift Cluster. | string |
n/a | yes |
create_ws_liberty_operator_namespace | Whether to create the namespace where the IBM WebSphere Liberty operator is deployed. Default is false . |
bool |
false |
no |
install_wslo_sampleapp | Whether to deploy the WebSphere Application Server Liberty sample application. Default is false . |
bool |
false |
no |
operator_helm_release_namespace | Namespace to deploy the helm releases. Default to liberty-operator-helm-release. | string |
"liberty-operator" |
no |
ws_liberty_operator_install_plan_approval | IBM WebSphere Liberty operator approval configuration for OLM upgrade. Set to 'Manual' to manually approve the operator upgrades. Default is Automatic . |
string |
"Automatic" |
no |
ws_liberty_operator_namespace | Namespace where the IBM WebSphere Liberty operator is deployed. Default is openshift-operators . |
string |
"openshift-operators" |
no |
ws_liberty_operator_target_namespace | Namespace that the the IBM WebSphere Liberty operator watches. Default is null , which means that the operator watches all the namespaces. |
string |
null |
no |
wslo_sampleapp_name | Application name to use for the WebSphere Application Server Liberty sample application. | string |
"websphereliberty-app-sample" |
no |
wslo_sampleapp_namespace | Namespace where the WebSphere Application Server Liberty sample application is deployed. | string |
"samplelibertyapp" |
no |
Name | Description |
---|---|
websphere_liberty_operator_sampleapp_url | WebSphere Application Server Liberty sample application URL. |
ws_liberty_operator_namespace | Namespace where the IBM WebSphere Liberty operator is installed. |
ws_liberty_operator_target_namespace | Namespace watched by the IBM WebSphere Liberty operator. |
You can report issues and request features for this module in GitHub issues in the module repo. See Report an issue or request a feature.
To set up your local development environment, see Local development setup in the project documentation.