OpenEBS for MinIO
#
IntroductionMinIO is a high performance distributed object storage server, designed for large-scale private cloud infrastructure. MinIO is designed in a cloud-native manner to scale sustainably in multi-tenant environments. Orchestration platforms like Kubernetes provide a perfect cloud-native environment to deploy and scale MinIO.
MinIO can be provisioned with OpenEBS volumes using various OpenEBS storage engines such as Local PV, cStor, or Jiva based on the application requirement. The MinIO operator offers a seamless way to create and update highly available distributed MinIO clusters. MinIO operator brings native support for MinIO, Graphical Console for Admin and Users, and encryption to Kubernetes. It also offers MinIO tenant creation, management, upgrade, zone addition, and more.
Depending on the performance and high availability requirements of MinIO, you can select any of the storage engine to run MinIO with the following deployment options:
- For optimal performance, deploy MinIO with OpenEBS Local PV.
- If you would like to use storage layer capabilities like high availability, snapshots, incremental backups and restore and so forth, you can select OpenEBS cStor.
This document provides the instructions to setup MinIO operator using OpenEBS Local PV.
#
Deployment modelIn this tutorial, Local PV volume will be provisioned on the node where the application has scheduled and one of the unclaimed and active blockdevice available on the same node will be used to provision the MinIO Object storage. This blockdevice cannot be used by another application. If there are limited blockdevices attached to some of the nodes, then users can use nodeSelector
in the application YAML to provision application on a particular node where the available blockdevice is present.
#
Configuration workflow- Install OpenEBS
- Select OpenEBS storage engine
- Configure OpenEBS Local PV StorageClass
- Install the MinIO plugin
- Install the MinIO operator deployment
- Install the MinIO cluster
- Access MinIO console
#
Install OpenEBSIf OpenEBS is not installed in your K8s cluster, this can be done from here. If OpenEBS is already installed, go to the next step.
#
Select OpenEBS storage engineA storage engine is the data plane component of the IO path of a Persistent Volume. In CAS architecture, users can choose different data planes for different application workloads based on a configuration policy. OpenEBS provides different types of storage engines and chooses the right engine that suits your type of application requirements and storage available on your Kubernetes nodes. More information can be read from here.
In this document, it is mentioned about the installation of MinIO operator using OpenEBS Local PV device.
#
Configure OpenEBS Local PV StorageClassThere are 2 ways to use OpenEBS Local PV.
openebs-hostpath
- Using this option, it will create Kubernetes Persistent Volumes that will store the data into OS host path directory at: /var/openebs/<"minio-pv-name">/. Select this option, if you don’t have any additional block devices attached to Kubernetes nodes. You would like to customize the directory where data will be saved, create a new OpenEBS Local PV storage class using these instructions.openebs-device
- Using this option, it will create Kubernetes Local PVs using the block devices attached to the node. Select this option when you want to dedicate a complete block device on a node to a MinIO node. You can customize which devices will be discovered and managed by OpenEBS using the instructions here.
MinIO can provide the replication of data by itself in distributed mode. This method installs MinIO application, which is a StatefulSet kind. It requires a minimum of four (4) nodes to setup MinIO in distributed mode. A distributed MinIO setup with 'n' number of disks/storage has your data safe as long as n/2 or more disks/storage are online. Users should maintain a minimum (n/2 + 1) disks/storage to create new objects. So based on the requirement, the user can choose the appropriate OpenEBS storage engine to run MinIO in distributed mode. For more information on MinIO installation, see MinIO documentation.
The Storage Class openebs-device
has been chosen to deploy MinIO in the Kubernetes cluster.
#
Install the MinIO pluginThe MinIO operator offers MinIO Tenant (MinIO cluster) creation, management of cluster, upgrade, zone addition, and more. Install the MinIO operator plugin using the following command.
Note: Install kubectl minio
plugin using krew. Installation of krew can be done from here.
#
Install the MinIO operator deploymentLet’s get started by initializing the MinIO operator deployment. This is a one time process.
Verify the MinIO operator is successfully installed.
#
Install the MinIO clusterA tenant is a MinIO cluster created and managed by the operator. Before creating a tenant, please ensure you have requisite nodes and drives in place. In this guide, we are using 4 Nodes with one 100Gi block device attached per each node. Using the MinIO operator, the following command will generate a YAML file as per the given requirement and the file can be modified as per user specific requirements.
The above will create a YAML spec with 4 MinIO nodes with 100Gi volume. In this YAML file, we need to add the openebs-device
storage class to create the 100Gi persistent volume using the device attached to each node.
Note: Ensure that the image version used for the MinIO console is 0.4.6 or higher. Otherwise, pods will be in crashloopbackoff
state.
Add the following two changes to the tenant file created using the above command.
Add the following to spec.zones.volumeClaimTemplate.spec under Tenant kind.
An example snippet of the modified tenant YAML file.
Also, set
requestAutoCert: false
so that MinIO will run in http mode. In this document, we have used http communication for accessing MinIO. The following is a sample snippet of the modified section.
Apply the modified tenant YAML spec. The following command will install MinIO tenants under the default namespace.
Verify the MinIO cluster creation is successfully running under the default namespace.
Verify the MinIO persistent volume details.
Verify MinIO service status.
Now, MinIO has been installed successfully on your cluster.
Note: If the user needs to access MinIO outside the network, the service type can be changed or a new service should be added to use LoadBalancer
or create Ingress
resources for production deployment.
For ease of simplicity in testing the deployment, we are going to use NodePort
. Please be advised to consider using LoadBalancer or Ingress, instead of NodePort, for production deployment.
The minio
service will allow the user to access the console, and tenant1-console
will allow access to the Admin console. In this guide, we have changed the service type of the services mentioned above, and the following is the output after the modification.
#
Access MinIO consoleThere are 2 different console for User and Admin.
#
Access MinIO Admin consoleAn Admin can access MinIO and do the configuration changes such as creating an account, group, bucket, and its configuration, the setting of user-level permission, file-level permission, etc.
For Admin access, use <Node_External_Ip>:<NodePort_of_tenant1-console_service>
in your web browser.
Get the details of Node.
Now, access the MinIO service over the browser using the following way.
Note: Ensure Inbound Rules under VPC-> Security Groups are correctly configured to allow the traffic.
You should enter the Access key and Secret key to login into the admin console. These credentials can be obtained from the secret.
The following is a sample snippet of the output of the above command. It will show the Access key and Secret key in encoded form. The decoded value should be given in the web browser to login to the user console.
Decoding of the above credentials can be retrieved by following way.
Access key
Secret key
#
Access MinIO User consoleThe MinIO StatefulSet application is created using NodePort as the service type. To access MinIO over a web browser, use <Node_External_Ip>:<NodePort_of_minio_service>
this way.
Get the details of Node.
Now, access the MinIO service over the browser using the following way.
You should enter the Access key
and Secret key
to login into the user console. These credentials can be obtained from the secret.
The following is a sample snippet of the output of the above command. It will show the Access key and Secret key in encoded form. The decoded value should be given in the web browser to login to the user console.
Decoding of the above credentials can be retrieved by following way.
Access key
Secret key
#
See Also:OpenEBS use cases Understanding NDM Local PV concepts Local PV User guide