Skip to content

Service: MinIO

Jonas Birmé edited this page Jul 5, 2024 · 18 revisions

Getting started

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.

Prerequisites

  • If you have not already done so, sign up for an OSC account.
  • AWS CLI or S3 compatible client

Step 1: Install CLI

You will be using the CLI to create the service instances for this solution.

  1. If not already installed on your machine, download and install NodeJS
  2. Install OSC CLI using NodeJS package manager
% npm install -g @osaas/cli
  1. Verify that it is installed
% osc --version
0.11.2

Step 2: Setup secrets

Create two service secrets in the MinIO service in the OSC web user interface.

  • user=guide
  • password=guidepassword123

The user and password to just serve as an example.

Step 3: Create storage service

Create a storage service with this command in your terminal. We will refer to the service secrets created in step 2.

% osc create minio-minio guide \
  -o RootUser="{{secrets.user}}" \
  -o RootPassword="{{secrets.password}}"

Step 4: Create a bucket

We will now create a storage bucket in the storage service we created in step 3. 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.

% mc alias set guide https://<tenant>-guide.minio-minio.auto.prod.osaas.io guide guidepassword123
Added `guide` successfully.

Now we can create a bucket that we call tutorial

% mc mb guide/tutorial

Step 5: Access bucket using AWS S3 client

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=guide
% export AWS_SECRET_ACCESS_KEY=guidepassword123
% 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.

Clone this wiki locally