Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
a76cbc6
[patch] add support to additional-infrastructure on gitops
Hita-Pandya Dec 18, 2025
422fee1
[patch] update ibm-mas-instance-base.yml
Hita-Pandya Dec 18, 2025
86e0471
[patch] update example in ibm-mas-instance-base.yml
Hita-Pandya Dec 22, 2025
8fe5bd5
[patch] update instance-base.yml
Hita-Pandya Dec 22, 2025
e362fbc
[patch] update cr for additional infrastructure
Hita-Pandya Dec 23, 2025
f732c09
[patch] update template to uninstall add-on
Hita-Pandya Dec 29, 2025
ccfe982
[patch] assign default value to instances
Hita-Pandya Dec 29, 2025
8dda604
[patch] update template to handle uninstall case
Hita-Pandya Dec 29, 2025
3757c3a
[patch] add changes to fix uninstall case
Hita-Pandya Dec 30, 2025
6ea30dc
[patch] add case to delete the CR
Hita-Pandya Dec 30, 2025
9f34eb6
[patch] add files to delete addon
Hita-Pandya Dec 30, 2025
50e6b43
[patch] remove prune condition
Hita-Pandya Dec 30, 2025
7f2c699
[patch] update template to uninstall
Hita-Pandya Jan 2, 2026
0922517
[patch] did changes for testing
Hita-Pandya Jan 6, 2026
9d2d402
[patch] update template
Hita-Pandya Jan 6, 2026
c8008c8
[patch] update template
Hita-Pandya Jan 6, 2026
2cb3bac
[patch] add service account for addon cleanup
caroazad Jan 8, 2026
1e40c07
[patch] change naming
caroazad Jan 8, 2026
3639337
[patch] fix failing addon lookup
caroazad Jan 8, 2026
005950d
[patch] fix syntax error
caroazad Jan 8, 2026
be7809c
[patch] specify api group
caroazad Jan 8, 2026
9863eab
[patch] job structure
caroazad Jan 8, 2026
4438299
[patch] add debug/test
caroazad Jan 8, 2026
a725a0b
[patch] add resource limits
caroazad Jan 9, 2026
59dbc35
[patch] add network policy for cleanup job
caroazad Jan 9, 2026
2a24bee
[patch] add instance id to name of network policy
caroazad Jan 9, 2026
c941457
[patch] update template to fix uninstall case
Hita-Pandya Jan 12, 2026
6cbcab5
[patch] update template
Hita-Pandya Jan 12, 2026
8fac86c
[patch] update template
Hita-Pandya Jan 12, 2026
52d39b2
[patch] update template
Hita-Pandya Jan 12, 2026
f938e9a
[patch] update template to fix uninstall case
Hita-Pandya Jan 12, 2026
74a3001
[patch] update template for testing
Hita-Pandya Jan 12, 2026
4bfa358
[patch] update template
Hita-Pandya Jan 12, 2026
72274f6
[patch] add echo for testing
Hita-Pandya Jan 12, 2026
066e62c
[patch] add echo for testing
Hita-Pandya Jan 12, 2026
f284fb1
[patch] update cli image
Hita-Pandya Jan 12, 2026
a06df7b
[patch] update network policy
Hita-Pandya Jan 12, 2026
3937574
[patch] update changes for testing
Hita-Pandya Jan 12, 2026
6514e0f
[patch] update sync wave
Hita-Pandya Jan 12, 2026
be72581
[patch] update changes for testing
Hita-Pandya Jan 13, 2026
3ed9fb9
[patch] update changes for testing
Hita-Pandya Jan 13, 2026
06bfd47
[patch] update changes for testing
Hita-Pandya Jan 13, 2026
899828c
[patch] merge to master
Hita-Pandya Jan 20, 2026
56ff31a
[patch] add support to additional resources on gitops
Hita-Pandya Jan 20, 2026
22ad9f3
[patch] add condition
Hita-Pandya Jan 20, 2026
7ed5df7
[patch] update indentation
Hita-Pandya Jan 20, 2026
221d0d5
[patch] correct indentation
Hita-Pandya Jan 20, 2026
bcf531a
[patch] fix argo issue
Hita-Pandya Jan 20, 2026
3ed3cf2
[patch] update condition fore clean up job
Hita-Pandya Jan 21, 2026
b248258
[patch] update condition for clean up job
Hita-Pandya Jan 21, 2026
21e6b2a
[patch] update clean up job
Hita-Pandya Jan 21, 2026
eec8113
[patch] update condition
Hita-Pandya Jan 21, 2026
a4c36f6
[patch] add post delete hook value
Hita-Pandya Jan 21, 2026
aed092f
[patch] add support to uninstall additional resources
Hita-Pandya Jan 22, 2026
bc9ff69
[patch] update condition
Hita-Pandya Jan 22, 2026
b034aec
[patch] add delete policy
Hita-Pandya Jan 22, 2026
fe5fadd
[patch] fix indentation issue
Hita-Pandya Jan 22, 2026
54764f9
[patch] update changes to clean up network policy
Hita-Pandya Jan 22, 2026
d6acfca
[patch] remove hook
Hita-Pandya Jan 22, 2026
3a8f695
[patch] remove condition
Hita-Pandya Jan 22, 2026
e28a71f
[patch] remove hook
Hita-Pandya Jan 22, 2026
75f83c4
[patch] remove condition for testing
Hita-Pandya Jan 22, 2026
e3874f5
[patch] update sequece for testing
Hita-Pandya Jan 22, 2026
10ab365
[patch] update network policies
Hita-Pandya Jan 22, 2026
1de3207
[patch] add generic addon
Hita-Pandya Jan 22, 2026
f307990
[patch] add support to delete cr for clean up
Hita-Pandya Jan 23, 2026
9c11775
[patch] update condition
Hita-Pandya Jan 23, 2026
7ff7cd8
[patch] update condition
Hita-Pandya Jan 23, 2026
12fbf0a
[patch] update condition
Hita-Pandya Jan 23, 2026
ddc478a
[patch] fix lint issue
Hita-Pandya Jan 23, 2026
0251474
Merge branch 'main' into MASCORE-10502
Hita-Pandya Jan 23, 2026
e8d8937
[patch] update the condition
Hita-Pandya Jan 23, 2026
d75c4c8
[patch] add support to delete addon cr
Hita-Pandya Jan 23, 2026
5ecd162
[patch] revert changes for testing
Hita-Pandya Jan 23, 2026
33f32e7
Add finzilizers
whitfiea Jan 23, 2026
33251ab
update file
whitfiea Jan 23, 2026
69026be
delete file
whitfiea Jan 23, 2026
41bfcae
remove hook delete
whitfiea Jan 23, 2026
15efb02
[patch] fix resouce name
Hita-Pandya Jan 23, 2026
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
10 changes: 10 additions & 0 deletions example-config/dev/cluster1/instance1/ibm-mas-instance-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,13 @@ instance:
sm:
aws_access_key_id: "<path:arn:aws:secretsmanager:us-east-1:xxxxxxxxxxxx:secret:dev/cluster1/aws#sm_aws_access_key_id>"
aws_secret_access_key: "<path:arn:aws:secretsmanager:us-east-1:xxxxxxxxxxxx:secret:dev/cluster1/aws#sm_aws_secret_access_key>"

# Additional Resources Configuration Example
additional_resources:
instances:
- name: instance-name-1
cost: 100
reasonCode: 101
- name: instance-name-2
cost: 250
reasonCode: 102
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ rules:
- "config.mas.ibm.com"
resources:
- "*"
- verbs:
- delete
- get
- list
- watch
apiGroups:
- addons.mas.ibm.com
resources:
- genericaddons

---
kind: ServiceAccount
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{{- if .Values.additional_resources }}
---
apiVersion: addons.mas.ibm.com/v1
kind: GenericAddon
metadata:
name: "{{ .Values.instance_id }}-addons-additional-resources"
namespace: mas-{{ .Values.instance_id }}-core
annotations:
argocd.argoproj.io/sync-wave: "559"
labels:
mas.ibm.com/configScope: system
mas.ibm.com/instanceId: {{ .Values.instance_id }}
{{- if .Values.custom_labels }}
{{ .Values.custom_labels | toYaml | indent 4 }}
{{- end }}
spec:
displayName: "{{ .Values.instance_id }}-AdditionalResources"
addonType: additional-resources
config:
addonIdentifier: {{ .Values.instance_id }}
instances:
{{- if .Values.additional_resources.instances }}
{{- range .Values.additional_resources.instances }}
- name: {{ .name }}
cost: {{ .cost }}
reasonCode: {{ .reasonCode }}
{{- end }}
{{- else }}
[]
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{{- if .Values.use_postdelete_hooks }}

{{- /*
Use the build/bin/set-cli-image-digest.sh script to update this value across all charts.
*/}}
{{- $_cli_image_digest := "sha256:55b5d6dd185503f14c112836a9a4899347d28e7b6545e0b9cf21d87f9526fb40" }}

{{- $_addon_type := "additional-resources" }}
{{- $_addon_cr_name := printf "%s-addons-%s" .Values.instance_id $_addon_type }}

{{ $job_name := printf "postdelete-delete-cr-job-%s" $_addon_cr_name }}

# NOTE: depends on resources created in ibm-mas-suite chart (01-postdelete-crs-resources)
# The values below must align with the values in that file
{{ $role_name := "postdelete-delete-cr-r" }}
{{ $sa_name := "postdelete-delete-cr-sa" }}
{{ $rb_name := "postdelete-delete-cr-rb" }}
{{ $np_name := "postdelete-delete-cr-np" }}
{{ $job_label := "postdelete-delete-cr-job" }}
{{ $ns := printf "mas-%s-core" .Values.instance_id }}

---
apiVersion: batch/v1
kind: Job
metadata:
name: {{ $job_name }}
namespace: {{ $ns }}
annotations:
argocd.argoproj.io/hook: PostDelete
argocd.argoproj.io/hook-delete-policy: BeforeHookCreation
{{- if .Values.custom_labels }}
labels:
{{ .Values.custom_labels | toYaml | indent 4 }}
{{- end }}
spec:
template:
metadata:
labels:
app: {{ $job_label }}
{{- if .Values.custom_labels }}
{{ .Values.custom_labels | toYaml | indent 8 }}
{{- end }}
spec:
containers:
- name: run
image: {{ .Values.cli_image_repo | default "quay.io/ibmmas/cli" }}@{{ $_cli_image_digest }}
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: 200m
memory: 512Mi
requests:
cpu: 10m
memory: 64Mi
env:
- name: CR_NAMESPACE
value: {{ $ns }}
- name: CR_NAME
value: {{ $_addon_cr_name }}
- name: CR_API_VERSION
value: addons.mas.ibm.com/v1
- name: CR_KIND
value: GenericAddon
command:
- /bin/sh
- -c
- |
set -e
function delete_oc_resource(){
RESOURCE=$1
NAMESPACE=$2
echo
echo "------------------------------------------------------------------"
echo "Check if resource $RESOURCE is present in namespace $NAMESPACE "
# don't want a non-zero rc from oc delete to cause the job to fail
# so, temporarily set +e
set +e
RESOURCE_NAME=$(oc get $RESOURCE -n $NAMESPACE -o=jsonpath="{.metadata.name}")
set -e
if [[ -z "${RESOURCE_NAME}" ]]; then
echo "$RESOURCE not found, skipping"
return 0
fi
echo "oc delete resource $RESOURCE in namespace $NAMESPACE "
# don't want a non-zero rc from oc delete to cause the job to fail (since we then want to try patching out the finalizers)
# so, temporarily set +e
set +e
oc delete $RESOURCE -n $NAMESPACE --timeout=300s --wait=true
return_code=$?
set -e
echo "Verify that resource $RESOURCE is now absent in namespace $NAMESPACE "
# don't want a non-zero rc from oc delete to cause the job to fail
# so, temporarily set +e
set +e
RESOURCE_NAME=$(oc get $RESOURCE -n $NAMESPACE -o=jsonpath="{.metadata.name}")
set -e
if [[ -n "${RESOURCE_NAME}" ]]; then
echo "$RESOURCE still present, failing job"
exit 1
fi
echo "... verified"
return 0

}
delete_oc_resource "${CR_KIND} ${CR_NAME}" "${CR_NAMESPACE}"
restartPolicy: Never
serviceAccountName: {{ $sa_name }}
backoffLimit: 4
{{- end }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ if or (not (empty .Values.allow_list)) (.Values.enhanced_dr) (.Values.extensions) (.Values.additional_vpn) (.Values.application_configuration) (not (empty .Values.ibm_db2u_databases)) (.Values.cluster_nonshared) }}
{{ if or (not (empty .Values.allow_list)) (.Values.enhanced_dr) (.Values.extensions) (.Values.additional_vpn) (.Values.application_configuration) (not (empty .Values.ibm_db2u_databases)) (.Values.cluster_nonshared) (.Values.additional_resources) }}
---
# IBM Maximo Operator Catalog
apiVersion: argoproj.io/v1alpha1
Expand All @@ -20,6 +20,8 @@ metadata:
argocd.argoproj.io/sync-options: PruneLast=true
finalizers:
- resources-finalizer.argocd.argoproj.io
- post-delete-finalizer.argocd.argoproj.io
- post-delete-finalizer.argocd.argoproj.io/cleanup
spec:
project: "{{ .Values.argo.projects.apps }}"
destination:
Expand All @@ -44,6 +46,10 @@ spec:
additional_vpn: {{ .Values.additional_vpn }}
cluster_nonshared: {{ .Values.cluster_nonshared }}
application_configuration: {{ .Values.application_configuration }}
use_postdelete_hooks: {{ .Values.use_postdelete_hooks | default true }}
{{- if .Values.additional_resources }}
additional_resources: {{ .Values.additional_resources | toYaml | nindent 14 }}
{{- end }}
databases:
{{- range $val := .Values.ibm_db2u_databases }}
{{- if and (contains "sdb" $val.db2_instance_name) ($val.replica_db) }}
Expand Down Expand Up @@ -80,4 +86,4 @@ spec:
syncOptions:
- CreateNamespace=true
- RespectIgnoreDifferences=true
{{ end }}
{{ end }}
Loading