https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator
Installs a WebSphere Liberty operator on your Red Hat OpenShift Container Platform on VPC landing zone.
https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator
core-team deployable-architecture ibm-cloud terraform terraform-module websphere-liberty-operator
Last synced: about 2 months ago
JSON representation
Installs a WebSphere Liberty operator on your Red Hat OpenShift Container Platform on VPC landing zone.
- Host: GitHub
- URL: https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator
- Owner: terraform-ibm-modules
- License: apache-2.0
- Created: 2024-01-30T09:16:32.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-12-24T16:22:41.000Z (5 months ago)
- Last Synced: 2024-12-26T15:04:12.708Z (5 months ago)
- Topics: core-team, deployable-architecture, ibm-cloud, terraform, terraform-module, websphere-liberty-operator
- Language: HCL
- Size: 549 KB
- Stars: 0
- Watchers: 17
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# WebSphere Liberty on Red Hat OpenShift Container Platform module
[-green)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[](https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator/releases/latest)
[](https://github.com/pre-commit/pre-commit)
[](https://renovatebot.com/)
[](https://github.com/semantic-release/semantic-release)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](https://www.ibm.com/docs/en/was-liberty/core?topic=container-running-websphere-liberty-operator)
## Overview
* [terraform-ibm-websphere-liberty-operator](#terraform-ibm-websphere-liberty-operator)
* [Examples](./examples)
* [Complete example for Websphere Liberty operator](./examples/complete)
* [Contributing](#contributing)## terraform-ibm-websphere-liberty-operator
### Usage
```hcl
##############################################################################
# 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
}
```### Required IAM access policies
- IAM Services
- **Kubernetes** service
- `Viewer` platform access
- `Manager` service access### Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 1.3.0 |
| [external](#requirement\_external) | >=2.2.3, <3.0.0 |
| [helm](#requirement\_helm) | >= 2.8.0, <3.0.0 |
| [ibm](#requirement\_ibm) | >= 1.59.0, < 2.0.0 |
| [kubernetes](#requirement\_kubernetes) | >= 2.16.1, <3.0.0 |
| [null](#requirement\_null) | >= 3.2.1, < 4.0.0 |
| [time](#requirement\_time) | >= 0.9.1, < 1.0.0 |### Modules
No modules.
### Resources
| Name | Type |
|------|------|
| [helm_release.ibm_operator_catalog](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.websphere_liberty_operator](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.websphere_liberty_operator_group](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [helm_release.websphere_liberty_operator_sampleapp](https://registry.terraform.io/providers/hashicorp/helm/latest/docs/resources/release) | resource |
| [kubernetes_namespace.helm_release_operator_namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [kubernetes_namespace.websphere_liberty_operator_namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [kubernetes_namespace.websphere_liberty_sampleapp_namespace](https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs/resources/namespace) | resource |
| [null_resource.confirm_websphere_liberty_operator_operational](https://registry.terraform.io/providers/hashicorp/null/latest/docs/resources/resource) | resource |
| [time_sleep.wait_catalog](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [time_sleep.wait_sampleapp](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [time_sleep.wait_websphere_liberty_operator](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource |
| [external_external.websphere_liberty_operator_sampleapp_url](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source |
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/ibm-cloud/ibm/latest/docs/data-sources/container_cluster_config) | data source |### Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [add\_ibm\_operator\_catalog](#input\_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](#input\_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](#input\_cluster\_id) | Id of the target IBM Cloud OpenShift Cluster. | `string` | n/a | yes |
| [create\_ws\_liberty\_operator\_namespace](#input\_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](#input\_install\_wslo\_sampleapp) | Whether to deploy the WebSphere Application Server Liberty sample application. Default is `false`. | `bool` | `false` | no |
| [operator\_helm\_release\_namespace](#input\_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](#input\_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](#input\_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](#input\_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](#input\_wslo\_sampleapp\_name) | Application name to use for the WebSphere Application Server Liberty sample application. | `string` | `"websphereliberty-app-sample"` | no |
| [wslo\_sampleapp\_namespace](#input\_wslo\_sampleapp\_namespace) | Namespace where the WebSphere Application Server Liberty sample application is deployed. | `string` | `"samplelibertyapp"` | no |### Outputs
| Name | Description |
|------|-------------|
| [websphere\_liberty\_operator\_sampleapp\_url](#output\_websphere\_liberty\_operator\_sampleapp\_url) | WebSphere Application Server Liberty sample application URL. |
| [ws\_liberty\_operator\_namespace](#output\_ws\_liberty\_operator\_namespace) | Namespace where the IBM WebSphere Liberty operator is installed. |
| [ws\_liberty\_operator\_target\_namespace](#output\_ws\_liberty\_operator\_target\_namespace) | Namespace watched by the IBM WebSphere Liberty operator. |## Contributing
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](https://github.com/terraform-ibm-modules/.github/blob/main/.github/SUPPORT.md).
To set up your local development environment, see [Local development setup](https://terraform-ibm-modules.github.io/documentation/#/local-dev-setup) in the project documentation.