Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions image/cli/mascli/functions/gitops_suite_app_config
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,27 @@ function gitops_suite_app_config() {
fi
fi

if [[ "${MAS_APP_ID}" == "monitor" ]]; then
if [[ -n "$MAS_APPWS_SPEC" ]]; then

# While we wait for Monitor StorageClass name to be made configurable (see https://jsw.ibm.com/browse/MASCORE-14484), hard-code it to use generated(efs)
# This will look up and use EFS instance with creation token "efs-${CLUSTER_NAME}-${MAS_INSTANCE_ID}-monitor-main" now created by gitops-efs in fvtsaas runs
# Once Monitor supports storage class name configuration, MONITOR_STORAGE_CLASS_NAME should be looked up from the workspace spec
# MONITOR_STORAGE_CLASS_PATH="<set this once we know what the path to the storage class name property will be>"
MONITOR_STORAGE_CLASS_NAME="generated(efs)"


STORAGE_CLASS_DEFINITIONS=$(generate_storage_class_def "${MONITOR_STORAGE_CLASS_NAME}" "${CLUSTER_ID}" "${MAS_INSTANCE_ID}" ${MAS_APP_ID} "main" "${STORAGE_CLASS_DEFINITIONS}") || exit 1

# For now, Monitor expects there to be a StorageClass named exactly "efs", so we are going to override the name generated by the generate_storage_class_def function call above
STORAGE_CLASS_DEFINITIONS=$(echo "$STORAGE_CLASS_DEFINITIONS" | yq eval 'with_entries(.key = "efs")')

# Once Monitor supports storage class name configuration, replace generated(efs) in MAS_APPWS_SPEC with name of generated storage class
# MONITOR_STORAGE_CLASS=$(generate_storage_class_name "${MONITOR_STORAGE_CLASS_NAME}" "${CLUSTER_ID}" "${MAS_INSTANCE_ID}" ${MAS_APP_ID} "main")
# MAS_APPWS_SPEC=$(echo "${MAS_APPWS_SPEC}" | yq ${MONITOR_STORAGE_CLASS_PATH}' = "'${MONITOR_STORAGE_CLASS}'"')
fi
fi

# Generate ArgoApps
# ---------------------------------------------------------------------------
echo
Expand Down
9 changes: 9 additions & 0 deletions tekton/src/tasks/gitops/gitops-deprovision-efs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,15 @@ spec:
--skip-delete-storage-class \
|| exit 1

mas gitops-deprovision-efs -c $CLUSTER_NAME -m $MAS_INSTANCE_ID \
--cloud-provider $CLOUD_PROVIDER \
--aws-region $SM_AWS_REGION \
--aws-secret-key $SM_AWS_SECRET_ACCESS_KEY \
--aws-access-key $SM_AWS_ACCESS_KEY_ID \
--efs-unique-id "efs-${CLUSTER_NAME}-${MAS_INSTANCE_ID}-monitor-main" \
--skip-delete-storage-class \
|| exit 1

command:
- /bin/sh
- -c
Expand Down
10 changes: 10 additions & 0 deletions tekton/src/tasks/gitops/gitops-efs.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ spec:
--skip-create-storage-class \
|| exit 1


mas gitops-efs -c $CLUSTER_NAME -m $MAS_INSTANCE_ID \
--cloud-provider $CLOUD_PROVIDER \
--aws-region $SM_AWS_REGION \
--aws-secret-key $SM_AWS_SECRET_ACCESS_KEY \
--aws-access-key $SM_AWS_ACCESS_KEY_ID \
--creation-token-prefix "" \
--efs-unique-id "efs-${CLUSTER_NAME}-${MAS_INSTANCE_ID}-monitor-main" \
--skip-create-storage-class \
|| exit 1
command:
- /bin/sh
- -c
Expand Down
Loading