Skip to content

Commit

Permalink
Merge pull request #52 from cloud-native-toolkit/update-mas-cleanup
Browse files Browse the repository at this point in the history
Updates cleanup and samples for v1 release
  • Loading branch information
tcskill authored Nov 16, 2022
2 parents 10a0843 + 10c2ca0 commit 76ebd17
Show file tree
Hide file tree
Showing 22 changed files with 232 additions and 76 deletions.
71 changes: 2 additions & 69 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Experimental- MAS automation operator
# MAS automation operator

**Defaults to latest v8.8 of MAS**

Expand Down Expand Up @@ -37,71 +37,4 @@ Current list of MAS components supported with this operator install as well as r

### CHANGE LOG

v0.12.4 - v0.12.11
- Implementents github workflow automation in module and bundle to automate build/push to quay

v0.12.3
- Removes Masauto API (functionality moved to Core api)

v0.12.2
- Separates DB for manage and monitor/iot

v0.11.4
- Simplifies the spec for manage add-on deployment

v0.11.3
- Updates operator catalog source sample

v0.11.2
- Updates CP4D sample CRs
- Updates bundle for deployment to quay.io

v0.11.1
- Multiple updates to prepare for release

v0.10.2
- Adds bundle for OLM and custom catalog deployment

v0.9.4
- Service account and rbac updates for multi namespaces

v0.9.0
- Adds Predict deployment

v0.8.2
- Adds Core api (masauto still there for the moment but will be removed)
- Updated CP4D playbook for suite config
- Updated sample CRs

v0.8.1
- Adds read of entitlement key from secret now in all playbooks
- updates samples to support entitlment key secret

v0.8.0
- Adds Health Predict & Utilities deployment

v0.7.0
- Adds CP4D deployment (foundation)
- Adds CP4D services: wsl, wml, spark, aiopenscale, wd

v0.6.0
- Adds AppConnect deployment
- can read secret for ibm-entitlement-key from operator secret OR can pass in CR supports both now

v0.5.0
- Adds Monitor deployment
- Sets reconcile period

v0.4.0
- Adds IoT deployment

v0.3.0
- Adds Manage and DB2 deployment
- start adding sample CR's in the config/samples directory

v0.2.0
- First working version with Core

v0.1.0
- Sets up initial operator scaffolding
- Adds initial core api
See the changelog.md in this repository
73 changes: 73 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
### CHANGE LOG
v1.0.0
- Updates destroy scrip
- Adds comments for requirements prior to running each CR

v0.12.4 - v0.12.11
- Implementents github workflow automation in module and bundle to automate build/push to quay

v0.12.3
- Removes Masauto API (functionality moved to Core api)

v0.12.2
- Separates DB for manage and monitor/iot

v0.11.4
- Simplifies the spec for manage add-on deployment

v0.11.3
- Updates operator catalog source sample

v0.11.2
- Updates CP4D sample CRs
- Updates bundle for deployment to quay.io

v0.11.1
- Multiple updates to prepare for release

v0.10.2
- Adds bundle for OLM and custom catalog deployment

v0.9.4
- Service account and rbac updates for multi namespaces

v0.9.0
- Adds Predict deployment

v0.8.2
- Adds Core api (masauto still there for the moment but will be removed)
- Updated CP4D playbook for suite config
- Updated sample CRs

v0.8.1
- Adds read of entitlement key from secret now in all playbooks
- updates samples to support entitlment key secret

v0.8.0
- Adds Health Predict & Utilities deployment

v0.7.0
- Adds CP4D deployment (foundation)
- Adds CP4D services: wsl, wml, spark, aiopenscale, wd

v0.6.0
- Adds AppConnect deployment
- can read secret for ibm-entitlement-key from operator secret OR can pass in CR supports both now

v0.5.0
- Adds Monitor deployment
- Sets reconcile period

v0.4.0
- Adds IoT deployment

v0.3.0
- Adds Manage and DB2 deployment
- start adding sample CR's in the config/samples directory

v0.2.0
- First working version with Core

v0.1.0
- Sets up initial operator scaffolding
- Adds initial core api
5 changes: 5 additions & 0 deletions config/samples/sample_appcon_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds AppConnect to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: AppCon
metadata:
Expand Down
7 changes: 7 additions & 0 deletions config/samples/sample_cp4d_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
#
# Note: Install Foundation first then other components
#
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
5 changes: 5 additions & 0 deletions config/samples/sample_cp4d_wsl_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - CP4D Foundation is installed
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
8 changes: 8 additions & 0 deletions config/samples/sample_hpu_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Adds HP&U latest release to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - Health is installed
# - CP4D/WSL
# - AppConnect
#
apiVersion: masauto.ibm.com/v1alpha1
kind: HPU
metadata:
Expand Down
5 changes: 5 additions & 0 deletions config/samples/sample_iot_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Add IoT latest application to an existing MAS Core 8.8.x installation
#
# Dependencies:
# - Core is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: IoT
metadata:
Expand Down
5 changes: 5 additions & 0 deletions config/samples/sample_manage_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Add Manage latest application to an existing MAS Core 8.8.x installation
#
# Dependencies:
# - Core
#
apiVersion: masauto.ibm.com/v1alpha1
kind: Manage
metadata:
Expand Down
8 changes: 8 additions & 0 deletions config/samples/sample_monitor_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Adds Monitor latest release to an existing MAS Core 8.8.x + IoT 8.5.x installation
#
# Monitor will be configured to use the same db2 instance that IoT is using
#
# Dependencies:
# - Core is installed
# - IoT is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: Monitor
metadata:
Expand Down
10 changes: 10 additions & 0 deletions config/samples/sample_predict_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# Adds Predict latest release to an existing MAS v8.8.x installation
#
# Predict will be deployed and configured. Note this app has several dependencies
#
# Dependencies:
# - CP4D Foundation
# - CP4D Services: wsl, wml, spark, aiopenscale
# - Maximo Monitor
# - Maximo Health
#
apiVersion: masauto.ibm.com/v1alpha1
kind: Predict
metadata:
Expand Down
45 changes: 38 additions & 7 deletions mas-destroy-core.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@ BASNAME="ibm-common-services"
SLSNAME="$2"
MONGONAME="$3"

#checks for params
if [ $# -ne 3 ]
then
echo "Usage: ./mas-destroy-core.sh <mas-suite-name> <sls-namespace> <mongo-namespace>"
exit 0
fi

NAMESPACE="mas-${SUITENAME}-core"

##
## MAS-Core cleanup script to remove installed resources from gitops deployment
##

# remove argo apps

#remove the CR from the MAS Automation operator
oc delete core masauto-core -n masauto-operator-system

#remove ibm common services
oc delete operandconfig common-service -n ibm-common-services
Expand All @@ -35,8 +42,24 @@ oc delete MutatingWebhookConfiguration cert-manager-webhook ibm-common-service-w
oc delete namespace services
oc delete nss --all

# remove core
oc delete suite ${SUITENAME} -n ${NAMESPACE}
# remove core suite - it will most likely hang so remove finalizer
oc delete suite ${SUITENAME} -n ${NAMESPACE} >/dev/null 2>&1 &
resp=$(kubectl get suite ${SUITENAME} -n ${NAMESPACE} --no-headers 2>/dev/null | wc -l)

if [[ "${resp}" != "0" ]]; then
echo "patching suite..."
kubectl patch suite/${SUITENAME} -p '{"metadata":{"finalizers":[]}}' --type=merge -n ${NAMESPACE} 2>/dev/null
fi

# remove core workspace - assume default install using masdev as workspace name
oc delete workspace ${SUITENAME}-masdev -n ${NAMESPACE} >/dev/null 2>&1 &
resp=$(kubectl get workspace ${SUITENAME}-masdev -n ${NAMESPACE} --no-headers 2>/dev/null | wc -l)

if [[ "${resp}" != "0" ]]; then
echo "patching workspace..."
kubectl patch workspace/${SUITENAME}-masdev -p '{"metadata":{"finalizers":[]}}' --type=merge -n ${NAMESPACE} 2>/dev/null
fi

oc delete csv ibm-mas.v8.8 -n ${NAMESPACE}

# remove truststore and dependencies
Expand Down Expand Up @@ -91,12 +114,12 @@ if [[ "${resp}" != "0" ]]; then
kubectl patch operandbindinfo/ibm-uds-bindinfo -p '{"metadata":{"finalizers":[]}}' --type=merge -n ibm-common-services 2>/dev/null
fi

oc delete operandrequest common-service -n ibm-common-services >/dev/null 2>&1 &
resp=$(kubectl get operandrequest/common-service -n ibm-common-services --no-headers 2>/dev/null | wc -l)
oc delete operandrequest common-service -n ${NAMESPACE} >/dev/null 2>&1 &
resp=$(kubectl get operandrequest/common-service -n ${NAMESPACE} --no-headers 2>/dev/null | wc -l)

if [[ "${resp}" != "0" ]]; then
echo "patching operandrequest common-service..."
kubectl patch operandrequest/common-service -p '{"metadata":{"finalizers":[]}}' --type=merge -n ibm-common-services 2>/dev/null
kubectl patch operandrequest/common-service -p '{"metadata":{"finalizers":[]}}' --type=merge -n ${NAMESPACE} 2>/dev/null
fi

oc delete operandrequest events-operator-request -n ibm-common-services >/dev/null 2>&1 &
Expand Down Expand Up @@ -131,6 +154,14 @@ if [[ "${resp}" != "0" ]]; then
kubectl patch operandregistry/common-service -p '{"metadata":{"finalizers":[]}}' --type=merge -n ibm-common-services 2>/dev/null
fi

oc delete slscfg ${SUITENAME}-sls-system -n ${NAMESPACE} >/dev/null 2>&1 &
resp=$(kubectl get slscfg/${SUITENAME}-sls-system -n ${NAMESPACE} --no-headers 2>/dev/null | wc -l)

if [[ "${resp}" != "0" ]]; then
echo "patching slscfg..."
kubectl patch slscfg/${SUITENAME}-sls-system -p '{"metadata":{"finalizers":[]}}' --type=merge -n ${NAMESPACE} 2>/dev/null
fi

# remove crd's
oc get crd -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep ibm.com | while read crd; do oc delete "crd/$crd"; done
oc get crd -o jsonpath='{range .items[*]}{.metadata.name}{"\n"}{end}' | grep cert-manager.io | while read crd; do oc delete "crd/$crd"; done
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_appcon_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds AppConnect to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: AppCon
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_cp4d_ai_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - CP4D Foundation is installed
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_cp4d_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_cp4d_spark_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - CP4D Foundation is installed
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_cp4d_wml_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - CP4D Foundation is installed
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_cp4d_wsl_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Adds CP4D to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - CP4D Foundation is installed
apiVersion: masauto.ibm.com/v1alpha1
kind: CP4D
metadata:
Expand Down
8 changes: 8 additions & 0 deletions samples/sample_hpu_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Adds HP&U latest release to an existing MAS Core 8.8.x
#
# Dependencies:
# - Core is installed
# - Health is installed
# - CP4D/WSL
# - AppConnect
#
apiVersion: masauto.ibm.com/v1alpha1
kind: HPU
metadata:
Expand Down
5 changes: 5 additions & 0 deletions samples/sample_iot_cr.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Add IoT latest application to an existing MAS Core 8.8.x installation
#
# Dependencies:
# - Core is installed
#
apiVersion: masauto.ibm.com/v1alpha1
kind: IoT
metadata:
Expand Down
Loading

0 comments on commit 76ebd17

Please sign in to comment.