Question
How can I access the S3 bucket in my Nubus/OpenDesk Environment?
Advance notice
Please keep in mind, that the prefix (ums-) possibly needs to be adjusted depending on the environment
Answer
By default, OpenDesk and Nubus are deployed with their own minio instance. Nevertheless, for various reasons it’s recommended to use your own instance / external object storage.
To make this guide universally applicable, we will focus on using a local s3 client like rclone, expecting proper permissions / firewall settings for external ones.
BUCKET=$(kubectl get -n ${NAMESPACE?} configmap ums-portal-consumer -o jsonpath='{.data.OBJECT_STORAGE_BUCKET}')
ENDPOINT=$(kubectl get -n ${NAMESPACE?} configmap ums-portal-consumer -o jsonpath='{.data.OBJECT_STORAGE_ENDPOINT}')
ACCESS_KEY=$(kubectl get -n ${NAMESPACE?} secret ums-portal-consumer-object-storage -o jsonpath='{.data.access_key_id}' | base64 -d)
SECRET_KEY=$(kubectl get -n ${NAMESPACE?} secret ums-portal-consumer-object-storage -o jsonpath='{.data.secret_access_key}' | base64 -d)
rclone copy ":s3:${BUCKET}/portal-data/groups" . \
--s3-provider Minio \
--s3-endpoint "$ENDPOINT" \
--s3-access-key-id "$ACCESS_KEY" \
--s3-secret-access-key "$SECRET_KEY" \
--s3-force-path-style -P