-
Notifications
You must be signed in to change notification settings - Fork 1
Service: MinIO
The open source project MinIO offers an S3 compatible storage service. This tutorial walks you through using MinIO in Open Source Cloud as a service for managing buckets that can be accessed with AWS S3 compatible clients.
- If you have not already done so, sign up for an OSC account.
- AWS CLI or S3 compatible client
Click on the button "Create objstorage" and a dialog will be shown.
- Name: The name of the server instance
- RootUser: The admin user name
- RootPassword: The admin password
Wait for the server instance to be created. Once created a new card will be shown that contains the URL to the server.
For example https://demo-guide.minio-minio.auto.prod.osaas.io
This URL is the S3 endpoint that you will use. Now you are ready to create a storage bucket on this server.
We will now create a storage bucket in the storage service we created in step 1. First we will download and install the MinIO client using Homebrew.
% brew install minio/stable/mc
Create an alias for the storage service you created where <tenant> is the id of your tenant. Provide the admin username and password that you used when created the server instance.
% mc alias set guide https://<tenant>-guide.minio-minio.auto.prod.osaas.io root abC12345678
Added `guide` successfully.
Now we can create a bucket that we call tutorial
% mc mb guide/tutorial
To upload an image we have on local disk to the bucket we will the AWS command line tool as the storage service provides an S3 compatible interface.
% export AWS_ACCESS_KEY_ID=root
% export AWS_SECRET_ACCESS_KEY=abC12345678
% aws --endpoint-url https://<tenant>-guide.minio-minio.auto.prod.osaas.io \
s3 cp images.jpeg s3://tutorial/
upload: ./images.jpeg to s3://tutorial/images.jpeg
And when we list the content on this bucket we should find the file we just uploaded.
% aws --endpoint-url https://<tenant>-guide.minio-minio.auto.prod.osaas.io s3 ls s3://tutorial/
Be aware that removing a storage service means that the data will be lost.
To access an object in a bucket you can use the AWS CLI command presign to generate an HTTP url.
% aws --endpoint-url=https://demo-guide.minio-minio.auto.prod.osaas.io \
s3 presign s3://tutorial/images.jpeg
See the AWS CLI documentation on how to set the expiration time for the link.
To enable public (anonymous) read-only access to the contents of a bucket we can enable that using the mc command line tool.
% mc anonymous set download guide/tutorial
Now you can access the images.jpeg you uploaded directly in your browser https://demo-guide.minio-minio.auto.prod.osaas.io/tutorial/images.jpeg