DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Because the DevOps movement has redefined engineering responsibilities, SREs now have to become stewards of observability strategy.

Apache Cassandra combines the benefits of major NoSQL databases to support data management needs not covered by traditional RDBMS vendors.

The software you build is only as secure as the code that powers it. Learn how malicious code creeps into your software supply chain.

Generative AI has transformed nearly every industry. How can you leverage GenAI to improve your productivity and efficiency?

Related

  • Distributed Cloud Architecture for Resilient Systems: Rethink Your Approach To Resilient Cloud Services
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two
  • Auto-Scaling a Spring Boot Native App With Nomad

Trending

  • Analyzing Techniques to Provision Access via IDAM Models During Emergency and Disaster Response
  • Navigating Change Management: A Guide for Engineers
  • How to Introduce a New API Quickly Using Micronaut
  • Memory-Optimized Tables: Implementation Strategies for SQL Server
  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Private S3 Storage With MinIO on Alibaba Cloud Kubernetes

Private S3 Storage With MinIO on Alibaba Cloud Kubernetes

In this article, we explore private, S3-compatible storage server, MinIO, on Alibaba Cloud Container Service Kubernetes.

By 
Viachaslau Matsukevich user avatar
Viachaslau Matsukevich
·
Feb. 22, 22 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
10.5K Views

Join the DZone community and get the full member experience.

Join For Free

In this article, we will explore the private S3-compatible storage server MinIO on Alibaba Cloud Container Service Kubernetes and its installation.  We will expose MinIO web UI to the internet and make MinIO API available for MC CLI in the Cloud Shell.

MinIO is an open-source, high-performance, S3-compatible object storage. It allows for building AWS S3-compatible data infrastructure.

Alibaba Cloud Container Service Kubernetes is a managed Kubernetes service available on Alibaba Cloud.

Helm is a package manager for Kubernetes. Helm Charts helps you manage Kubernetes applications.

Prerequisites

  • Access to Alibaba Cloud console
  • Deployed Alibaba Kubernetes cluster

Let's get started with installation!

Install Helm Release

For this guideline, we will use Cloud Shell. You need to login to Alibaba Cloud Console then navigate to "Container Service - Kubernetes", select "more" at the right side of your cluster, and click on "Open Cloud Shell."

Open Cloud Shell
Cloud Shell is a nice way to access your Kubernetes cluster.

Helm binary is already installed in Cloud Shell. 

Firstly, we will add the MinIO Helm chart repository.

helm repo add minio https://charts.min.io/


Then we need to install the MinIO chart with a set of parameters:

helm install --namespace default --set rootUser=miniouser,rootPassword=miniopass123 my-minio minio/minio --set persistence.size=20Gi --set persistence.storageClass=alicloud-disk-ssd --set replicas=5 --set resources.requests.memory=1Gi


Let's break down arguments in that command:

  • --namespace default means that we are specifying the default namespace.
  • rootUser=miniouser,rootPassword=miniopass123 is defining username and password.
  • my-minio is a custom name of the Helm release that we are going to install.
  • minio/minio is the Helm chart that we are going to use.
  • --set persistence.size=20Gi: For this tutorial, we are going to use the minimum size of the disk on Alibaba Cloud which is 20 GB, the default value is 500 GB. This argument is optional.
  • --set persistence.storageClass=alicloud-disk-ssd: You must set up the storage class name of your cloud provider. Without it, the persistence volume claim will be in "Pending" status forever.
  • --set replicas=5 means only 5 MinIO containers will be deployed and 5 corresponding disks will be created. By default, it will deploy 16. 4, which is the minimum amount needed for MinIO servers to create a cluster. This argument is optional.
  • --set resources.requests.memory=1Gi: MinIO container will ask for 1GB of RAM from Kubernetes nodes. The default value is 16 GB for each container. This argument is optional.

Here is the expected output from the helm install command:

Expected Output from the Helm install command

To get a sense of resources being deployed we can navigate to Alibaba Cloud console UI.

Overview of pods deployed:

MinIO pods

MinIO pods

Overview of services created. Service "my-minio"  with port 9000 exposed will be used for API access. "my-minio-console" service with port 9001 exposed will be used for web UI access.

MinIO Services

MinIO Services

In the secrets section, you can double-check that the credentials we defined in the helm install command were created as secrets.

Double-check credentials

Expose MinIO Externally

To access MinIO UI we need to expose it with Ingress. In order to do that, we need to navigate to the Ingress menu of the cluster and click on Create. Then we need to provide a custom name and domain. In the following example, I'm going to use a domain created by AliCloud. After that, we just need to select the my-minio-console service from a drop-down menu.

Expose MinIO Externally

Welcome to the MinIO Console

Open the URL you defined in Ingress and MinIO UI will appear!

Welcome to the MinIO Console

Welcome to the MinIO console

MinIO dashboard:

MinIO dashboard

Let's create our first bucket. Navigate to the Buckets section of the left menu and click on Create Bucket button on the right side. In the pop-up menu, you need to define the Bucket Name and enable optional parameters like Versioning.

Create a Bucket

After our very first bucket is created we can upload a new file. 

Upload a new file

By the way, you can preview text files if needed right into the MinIO web page.

From MinIO UI you can manage users, and define policies. 

Manage users, define policies

Here is a MinIO Raw Policy example. It is compatible with AWS S3 and shares the same syntax.

MinIO Raw Policy example

In MinIO UI you can set up LDAP or Open ID integration.

Set up LDAP or Open ID integration

MinIO CLI

Let's explore MinIO Command Line Interface capabilities.

To use MinIO CLI we need to create a service account. Navigate to the Service Accounts in the left menu and click on Create Service Account.  Copy credentials.

New Service Account Created

To play around with MinIO CLI we will use a Cloud Shell.

Install MC CLI

Download the MinIO MC client with the following command:

wget https://dl.min.io/client/mc/release/linux-amd64/mc chmod +x mc


Expose MinIO API locally

Since we did not expose MinIO API to the internet, we will use the kubectl port-forward feature to get access to the MinIO API port on localhost.

To access MinIO from localhost, run the below commands:

 export POD_NAME=$(kubectl get pods --namespace default -l "release=my-minio" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward $POD_NAME 9000 --namespace default

Access MinIO from localhost


To confirm that port-forwarding is working, we will create another session in the Cloud Shell and run the following command:

netstat -tunlpa | grep 9000

Confirm port-forwarding is working

MC CLI Login

You can now access the MinIO server at http://localhost:9000. Follow the below steps to connect to the MinIO server with the MC client:

/mc alias set minio http://localhost:9000 --api S3v4


When prompted, provide the Access Key and Secret key of your service account that you created in the MinIO console and you will be able to list files in MinIO buckets with the ./mc ls minio command.

List files in MinIO buckets


Now we have a private S3 bucket deployed on top of Alibaba Cloud-managed Kubernetes service.

MinIO Kubernetes AWS Alibaba Cloud Cloud Command-line interface

Opinions expressed by DZone contributors are their own.

Related

  • Distributed Cloud Architecture for Resilient Systems: Rethink Your Approach To Resilient Cloud Services
  • Keep Your Application Secrets Secret
  • Dynatrace Perform: Day Two
  • Auto-Scaling a Spring Boot Native App With Nomad

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!