Velero Setup Pre-requisites – MinIO Installation

Velero is an open-source tool that allows you to backup and restore your kubernetes cluster resources. In this series of blogs, we will look at the procedure of installing Velero in an air-gapped TKGi environment including the pre-requisites.

Velero uses an object storage backend to store backup data and associated artifacts. MinIO is an open-source S3-compatible object storage system that can be used with Velero.

If the requirement is to backup PV data as well, then we will also need to install a volume backup solution. List of supported providers for various clouds can be found here.

In this installation series, we will be using the MinIO and Velero vSphere Plugin. This blog will cover the installation and setup procedure for MinIO.

MinIO Installation

I will be using a CentOS VM to install MinIO on. You can choose any linux flavour and choose your binaries accordingly.

Step 1 – Download the Binary

Download the binary and move it to your system’s /usr/local/bin directory.

wget https://dl.min.io/server/minio/release/linux-amd64/minio
chmod +x minio
sudo mv minio /usr/local/bin/

Step 2 – User and Group Creation

Create a group named “minio-user” and add user “minio-user” into the “minio-user” group created.

Step 3 – Creating the service file

Create a service file under /usr/lib/systemd/system/minio.service and copy the following content into the file.

[Unit]
Description=MinIO
Documentation=https://min.io/docs/minio/linux/index.html
Wants=network-online.target
After=network-online.target
AssertFileIsExecutable=/usr/local/bin/minio

[Service]
WorkingDirectory=/usr/local

User=minio-user
Group=minio-user
ProtectProc=invisible

EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "if [ -z \"${MINIO_VOLUMES}\" ]; then echo \"Variable MINIO_VOLUMES not set in /etc/default/minio\"; exit 1; fi"
ExecStart=/usr/local/bin/minio server $MINIO_OPTS $MINIO_VOLUMES

# MinIO RELEASE.2023-05-04T21-44-30Z adds support for Type=notify (https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type=)
# This may improve systemctl setups where other services use `After=minio.server`
# Uncomment the line to enable the functionality
# Type=notify

# Let systemd restart this service always
Restart=always

# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536

# Specifies the maximum number of threads this process can create
TasksMax=infinity

# Disable timeout logic and wait until process is stopped
TimeoutStopSec=infinity
SendSIGKILL=no

[Install]
WantedBy=multi-user.target

# Built for ${project.name}-${project.version} (${project.name})

Step 4 – Object Storage Path creation

Create a directory where your objects (buckets) will be created and stored. Modify the permissions of that directory to be owned by minio-user as shown in the screenshot below.

mkdir <yourdirectorypath>/minio
chown minio-user:minio-user <yourdirectorypath>/minio

Step 5 – Environment Variables file creation for installation

Create the environment variables at /etc/default/minio accordingly before starting the service.

# MINIO_ROOT_USER and MINIO_ROOT_PASSWORD sets the root account for the MinIO server.
# This user has unrestricted permissions to perform S3 and administrative API operations on any resource in the deployment.
# Omit to use the default values 'minioadmin:minioadmin'.
# MinIO recommends setting non-default values as a best practice, regardless of environment

MINIO_ROOT_USER=myminioadmin
MINIO_ROOT_PASSWORD=minio-secret-key-change-me

# MINIO_VOLUMES sets the storage volume or path to use for the MinIO server.

MINIO_VOLUMES="<yourdirectorypath>"

# MINIO_OPTS sets any additional commandline options to pass to the MinIO server.
# For example, `--console-address :9001` sets the MinIO Console listen port
MINIO_OPTS="--console-address :9001"

You can now start the service using the following commands.

sudo systemctl start minio.service
sudo systemctl enable minio.service

You can check the status using the “systemctl status” command.

Your UI should be accessible now at the address of your VM and port 9001 (http://<your-vm-ip>:9001).

You can now create a bucket using the “Create Bucket +” option.

That’s it for the MinIO installation. We will look at the other pre-requisites in the next blog of this series.

Please follow and like my content:

One comment

Leave a Reply

Your email address will not be published. Required fields are marked *

error

Enjoy this blog? Please spread the word :)