Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First version of module #3

Merged
merged 31 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
11000b1
feat: first draft
vbontempi Jan 31, 2024
e6bd3d7
feat: second draft
vbontempi Feb 1, 2024
79122fd
feat: added script to retrieve and output sample app url
vbontempi Feb 2, 2024
8c807ba
feat: da ibm catalog (#1)
rajatagarwal-ibm Feb 2, 2024
f47c201
feat: added example and test and extension
vbontempi Feb 2, 2024
d49b581
feat: added sleep before reading sampleapp URL
vbontempi Feb 2, 2024
49e6319
Merge branch 'main' of https://github.com/terraform-ibm-modules/terra…
vbontempi Feb 5, 2024
93d761a
feat: adjusted prtest conf
vbontempi Feb 5, 2024
ea2b285
feat: removed subnets from basic test output
vbontempi Feb 5, 2024
39f20f0
fixed: moved basic example to complete folder SKIP UPGRADE TEST
vbontempi Feb 5, 2024
fa9bdee
fix: removed pub gw from complete test cluster
vbontempi Feb 5, 2024
67b7602
feat: added back LBs in complete test
vbontempi Feb 6, 2024
ab1023a
fix: test to validate SCC scan
vbontempi Feb 6, 2024
e32fa0e
feat: reference architecture (#5)
rajatagarwal-ibm Feb 6, 2024
6e41c16
feat: added cleanup hooks and addressed PR comments
vbontempi Feb 6, 2024
1de4d69
Merge branch 'add_liberty_operator_support' of https://github.com/ter…
vbontempi Feb 6, 2024
fcbd7be
fix: fixed description on GH setting
vbontempi Feb 6, 2024
5a8f948
feat: set default images path and version
vbontempi Feb 7, 2024
787e674
fix: PR comments
vbontempi Feb 7, 2024
378e037
test: extension tests (#6)
rajatagarwal-ibm Feb 8, 2024
5842df6
fix: addressing comments of PR
vbontempi Feb 8, 2024
a9635c4
Fix extension tests (#7)
rajatagarwal-ibm Feb 8, 2024
7ef5358
catalog onboarding (#10)
rajatagarwal-ibm Feb 8, 2024
8993651
fix: making SLZ test with public nw access
vbontempi Feb 8, 2024
65f844a
fix: fixed override json
vbontempi Feb 8, 2024
0a4b705
fix: reduced override json to vpc settings only
vbontempi Feb 8, 2024
bc31c82
fix: fixed override json
vbontempi Feb 8, 2024
579742a
fix: setting custom override json
vbontempi Feb 8, 2024
4c7240b
fix: setting reduced override json
vbontempi Feb 8, 2024
c668e71
fix: setting custom override json
vbontempi Feb 8, 2024
1f1f9f4
fix: setting custom override json
vbontempi Feb 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repository:

# Uncomment this description property
# and update the description to the current repo description.
# description: ""
description: "This module installs a WebSphere® Liberty operator and create an instance of WebSphere Liberty operator on IBM Cloud Red Hat OpenShift cluster on VPC Gen2."

# Use a comma-separated list of topics to set on the repo (ensure not to use any caps in the topic string).
topics: terraform, ibm-cloud, terraform-module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Action for follow up PR:

Add these topics: websphere-liberty-operator, core-team

(NOTE: core-team should only be added if our team own this, which may not be the case)

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,4 @@ terraform.rc

# Visual Studio Code
.vscode/
*.code-workspace
52 changes: 45 additions & 7 deletions README.md
vbontempi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
<!-- Update the title -->
# Terraform Modules Template Project
# WebSphere Liberty operator on Red Hat OpenShift VPC cluster module
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# WebSphere Liberty operator on Red Hat OpenShift VPC cluster module
# WebSphere Liberty on Red Hat OpenShift Container Platform module

Trying for a title that's not too unwieldy but adheres to naming guidelines.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Action for follow up PR


<!--
Update status and "latest release" badges:
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
-->
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[![Implemented (No quality checks)](https://img.shields.io/badge/Status-Implemented%20(No%20quality%20checks)-yellowgreen)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-websphere-liberty-operator/releases/latest)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

<!-- Add a description of module(s) in this repo -->
TODO: Replace me with description of the module(s) in this repo
Use this module to install a WebSphere® Liberty operator and create an instance of WebSphere Liberty operator on IBM Cloud Red Hat OpenShift cluster on VPC Gen2.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need to check the trademarks and naming guidelines. I'm not sure how Liberty fits into

For Websphere we probably want to use

  • IBM® WebSphere Application Server for IBM Cloud® on first use
  • and WebSphere Application Server on subsequent uses.

do we still say Gen2? Or are we installing this on the landing zone? If SLZ, then use the name Red Hat OpenShift Container Platform on VPC landing zone.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I go this answer about names:

The official name for the WAS Liberty product is "WebSphere Application Server Liberty" but the operator content has always called the operator "WebSphere Liberty operator" or "IBM WebSphere Liberty operator" (no WAS).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Action for follow up PR


For more information about the 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)

<!-- Below content is automatically populated via pre-commit hook -->
<!-- BEGIN OVERVIEW HOOK -->
## Overview
* [terraform-ibm-websphere-liberty-operator](#terraform-ibm-websphere-liberty-operator)
* [Examples](./examples)
* [Basic example](./examples/basic)
* [Complete example](./examples/complete)
* [Contributing](#contributing)
<!-- END OVERVIEW HOOK -->
Expand Down Expand Up @@ -89,22 +89,60 @@ statement instead the previous block.
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0, <1.6.0 |
| <a name="requirement_external"></a> [external](#requirement\_external) | >=2.2.3 |
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.8.0 |
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.59.0 |
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.16.1 |
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2.1 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |

### Modules

No modules.

### Resources

No 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

No inputs.
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_add_ibm_operator_catalog"></a> [add\_ibm\_operator\_catalog](#input\_add\_ibm\_operator\_catalog) | Flag to configure the IBM Operator Catalog in the cluster before installing the WebSphere Liberty Operator. Default is true | `bool` | `true` | no |
| <a name="input_cluster_config_endpoint_type"></a> [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 |
| <a name="input_cluster_id"></a> [cluster\_id](#input\_cluster\_id) | Id of the target IBM Cloud OpenShift Cluster | `string` | n/a | yes |
| <a name="input_create_ws_liberty_operator_namespace"></a> [create\_ws\_liberty\_operator\_namespace](#input\_create\_ws\_liberty\_operator\_namespace) | Flag to create the namespace where to deploy the WebSphere Liberty Operator. Default to false | `bool` | `false` | no |
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | APIkey that's associated with the account to use | `string` | `null` | no |
| <a name="input_install_wslo_sampleapp"></a> [install\_wslo\_sampleapp](#input\_install\_wslo\_sampleapp) | Flag to deploy the WebSphere Liberty sample application. Default to false | `bool` | `false` | no |
| <a name="input_operator_helm_release_namespace"></a> [operator\_helm\_release\_namespace](#input\_operator\_helm\_release\_namespace) | Namespace to deploy the helm releases. Default to liberty-operator-helm-release | `string` | `"liberty-operator-helm-release"` | no |
| <a name="input_region"></a> [region](#input\_region) | Cluster region | `string` | n/a | yes |
| <a name="input_ws_liberty_operator_namespace"></a> [ws\_liberty\_operator\_namespace](#input\_ws\_liberty\_operator\_namespace) | Namespace to install the WebSphere Liberty Operator. Default to openshift-operators | `string` | `"openshift-operators"` | no |
| <a name="input_ws_liberty_operator_target_namespace"></a> [ws\_liberty\_operator\_target\_namespace](#input\_ws\_liberty\_operator\_target\_namespace) | Namespace to be watched by the WebSphere Liberty Operator. Default to null (operator to watch all namespaces) | `string` | `null` | no |
| <a name="input_wslo_sampleapp_image"></a> [wslo\_sampleapp\_image](#input\_wslo\_sampleapp\_image) | Image path to pull the WebSphere Liberty sample application | `string` | `"icr.io/appcafe/open-liberty/samples/getting-started@sha256:e22dd56a05e44618a10d275d3ff07a38eb364c0f04f86ffe9618d83dd5467860"` | no |
| <a name="input_wslo_sampleapp_name"></a> [wslo\_sampleapp\_name](#input\_wslo\_sampleapp\_name) | Application name to use for the WebSphere Liberty sample application | `string` | `"websphereliberty-app-sample"` | no |
| <a name="input_wslo_sampleapp_namespace"></a> [wslo\_sampleapp\_namespace](#input\_wslo\_sampleapp\_namespace) | Namespace to deploy the WebSphere Liberty sample application | `string` | `"samplelibertyapp"` | no |

### Outputs

No outputs.
| Name | Description |
|------|-------------|
| <a name="output_websphere_liberty_operator_sampleapp_url"></a> [websphere\_liberty\_operator\_sampleapp\_url](#output\_websphere\_liberty\_operator\_sampleapp\_url) | WebSphere Liberty sample application URL |
| <a name="output_ws_liberty_operator_namespace"></a> [ws\_liberty\_operator\_namespace](#output\_ws\_liberty\_operator\_namespace) | Namespace where the WebSphere Liberty operator is installed |
| <a name="output_ws_liberty_operator_target_namespace"></a> [ws\_liberty\_operator\_target\_namespace](#output\_ws\_liberty\_operator\_target\_namespace) | Namespace watched by the WebSphere Liberty operator |
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

<!-- Leave this section as is so that your module has a link to local development environment set up steps for contributors to follow -->
Expand Down
23 changes: 23 additions & 0 deletions chart/ibm-operator-catalog/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions chart/ibm-operator-catalog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: ibm-websphere-liberty-operator
description: A Helm chart to configure the Operator Catalog source for the IBM operator catalog
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: operators.coreos.com/v1alpha1
kind: CatalogSource
metadata:
name: ibm-operator-catalog
namespace: openshift-marketplace
spec:
displayName: IBM Operator Catalog
publisher: IBM
sourceType: grpc
image: '{{ .Values.image.path }}:{{ required "IBM Operator catalog version must be provided" .Values.image.version }}'
updateStrategy:
registryPoll:
interval: 45m
5 changes: 5 additions & 0 deletions chart/ibm-operator-catalog/values.yaml
vbontempi marked this conversation as resolved.
Show resolved Hide resolved
vbontempi marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
path: "icr.io/cpopen/ibm-operator-catalog"
version: "v1.25-20240202.161709-9DAF3E648@sha256:92e28be4af60f68c656f52b2445aafcc052fcd0390479b868c5b0ba2d465a25a"
23 changes: 23 additions & 0 deletions chart/websphere-liberty-operator-group/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions chart/websphere-liberty-operator-group/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: ibm-websphere-liberty-operator
description: A Helm chart to configure the Operator Group for the IBM WebSphere Liberty Operator
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: operators.coreos.com/v1alpha2
kind: OperatorGroup
metadata:
name: ibm-websphere-liberty
namespace: {{ .Values.operatornamespace }}
spec:
targetNamespaces:
- {{ .Values.operatortargetnamespace }}
5 changes: 5 additions & 0 deletions chart/websphere-liberty-operator-group/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

operatornamespace: openshift-operators
operatortargetnamespace: openshift-operators
15 changes: 15 additions & 0 deletions chart/websphere-liberty-operator-sampleapp/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: ibm-websphere-liberty-operator-sampleapp
description: A Helm chart to a sample application for the IBM WebSphere Liberty Operator
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: liberty.websphere.ibm.com/v1
kind: WebSphereLibertyApplication
metadata:
name: {{ .Values.application.name }}
namespace: {{ .Values.application.namespace }}
spec:
license:
accept: true
edition: IBM WebSphere Application Server
productEntitlementSource: Standalone
applicationImage: >-
{{ .Values.application.image.path }}:{{ required "Liberty sample app version must be provided" .Values.application.image.version }}
manageTLS: true
expose: true
6 changes: 6 additions & 0 deletions chart/websphere-liberty-operator-sampleapp/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
application:
name: websphereliberty-app-sample
namespace: samplelibertyapp
image:
path: "icr.io/appcafe/open-liberty/samples/getting-started"
version: "latest@sha256:d735c2ceae5945a0f20adcbcb04e55472d2520b6d1abb6d3049c8521234d3b7a"
23 changes: 23 additions & 0 deletions chart/websphere-liberty-operator/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
15 changes: 15 additions & 0 deletions chart/websphere-liberty-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v2
name: ibm-websphere-liberty-operator
description: A Helm chart to configure the Subscription for the IBM WebSphere Liberty Operator
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.1

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "1.0.0"
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

## Needed to delete resources (CSVs and installPlans) created by the OLM outside of the Terraform scope

operator_names=( "ibm-websphere-liberty" )

echo "Fetching and deleting CSVs and installPlans for IBM WebSphere Liberty Operator"

for i in "${operator_names[@]}"
do
CSV=$(kubectl get subscription "$i" -o jsonpath="{$.status.installedCSV}" -n "$1")

if [ -n "$CSV" ]
then
echo "Deleting CSV ${CSV}"
kubectl delete csv "$CSV" -n "$1"
fi

IP=$(kubectl get installPlan -n "$1" | grep "${i}" | awk '{print $1}')

if [ -n "$IP" ]
then
echo "Deleting installPlan ${IP}"
kubectl delete installPlan "$IP" -n "$1"
fi
done
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# ibm-websphere-liberty-operator-subscription.yaml
apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
name: ibm-websphere-liberty
namespace: {{ .Values.operatornamespace }}
spec:
installPlanApproval: Manual
name: ibm-websphere-liberty
source: ibm-operator-catalog
sourceNamespace: openshift-marketplace
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# The OLM created csv objects on the cluster during install - there is a need to clean up csv created by the OLM, in addition to removing the subscription
# See https://olm.operatorframework.io/docs/tasks/uninstall-operator/#combine-steps-2-and-3 for context

apiVersion: v1
kind: ConfigMap
metadata:
name: wslo-uninstall-scripts
namespace: {{ .Values.operatornamespace }}
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "3"
data:
uninstall-operator-resources.sh: |-
{{ .Files.Get "scripts/uninstall-operator-resources.sh" | indent 4}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# The OLM created csv objects on the cluster during install - there is a need to clean up csv created by the OLM, in addition to removing the subscription
# See https://olm.operatorframework.io/docs/tasks/uninstall-operator/#combine-steps-2-and-3 for context

kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: wslo-uninstall-hook-role-binding-edit
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "2"
subjects:
- kind: ServiceAccount
name: wslo-uninstall-hook-role-sa
namespace: {{ .Values.operatornamespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aggregate-olm-edit
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: wslo-uninstall-hook-role-binding-view
annotations:
"helm.sh/hook": pre-delete
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded,hook-failed
"helm.sh/hook-weight": "2"
subjects:
- kind: ServiceAccount
name: wslo-uninstall-hook-role-sa
namespace: {{ .Values.operatornamespace }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: aggregate-olm-view
Loading