DEV Community

DarkEdges
DarkEdges

Posted on

deploying a minio service to kubernetes

Here are the basic steps to getting a minio tenant deployed inot kubernetes. There are some pre-requisites tasks to be deployed (and will not be covered in this article) including

Add Helm Respository

Lets start by installing the helm repository



helm repo add minio-operator https://operator.min.io
helm repo update


Enter fullscreen mode Exit fullscreen mode

Create the minio operator

Now lets create the minio operator that we will use later to create the tenant.

Create a file minio-operator.yaml



console:
  ingress:
    enabled: true
    ingressClassName: "nginx"
    annotations:
      cert-manager.io/cluster-issuer: vault-issuer
    tls:
    - hosts:
      - ui-operator-7f000101.nip.io
      secretName: minio-console-tls
    host: ui-operator-7f000101.nip.io
    path: /
    pathType: Prefix
    number: 9090


Enter fullscreen mode Exit fullscreen mode

and deploy it using



helm upgrade --install operator minio-operator/operator --namespace minio-operator --create-namespace -f minio-operator.yaml


Enter fullscreen mode Exit fullscreen mode

Confirm it is running by checking the output of kubectl get pods -n minio-operator which should be similair to



NAME                              READY   STATUS    RESTARTS   AGE                                          
console-7fcfdb8d98-8kwxd          1/1     Running   0          137m                                         
minio-operator-69986bb674-8qdg6   1/1     Running   0          137m                                         
minio-operator-69986bb674-pz8rc   1/1     Running   0          137m


Enter fullscreen mode Exit fullscreen mode

we can get the jwt required to access the console by using the following command.



kubectl get secret/console-sa-secret -n minio-operator -o go-template='{{.data.token | base64decode}}' 


Enter fullscreen mode Exit fullscreen mode

Open a web browser to ui-operator-7f000101.nip.io and use the jwt collected before.

Congrats the minio operator has been deployed and lets create a tenant.

Add a tenant

Create a file minio-tenant.yaml




secrets:
  name: fido-env-configuration
  accessKey: admin
  secretKey: passw0rd
tenant:
  name: fido
  configuration:
    name: fido-env-configuration
  pools: 
    - servers: 1
      name: pool
      size: 200Mi
      volumesPerServer: 1
ingress:
  api:
    enabled: true
    ingressClassName: "nginx"
    annotations:
      cert-manager.io/cluster-issuer: vault-issuer
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    tls:
    - hosts:
      - api-fido-7f000101.nip.io
      secretName: fido-minio-api-tls
    host: api-fido-7f000101.nip.io
    path: /
    pathType: Prefix
  console:
    enabled: true
    ingressClassName: "nginx"
    annotations:
      cert-manager.io/cluster-issuer: vault-issuer
      nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    tls:
    - hosts:
      - ui-fido-7f000101.nip.io
      secretName: fido-minio-console-tls
    host: ui-fido-7f000101.nip.io
    path: /
    pathType: Prefix


Enter fullscreen mode Exit fullscreen mode

and deploy it using



helm upgrade --install --namespace minio-fido --create-namespace minio-fido minio-operator/tenant -f minio-tenant.yaml


Enter fullscreen mode Exit fullscreen mode

confirm it is running using kubectl get pods -n minio-fido which should be similair to



NAME          READY   STATUS    RESTARTS   AGE
fido-pool-0   2/2     Running   0          68m


Enter fullscreen mode Exit fullscreen mode

Open a web browser to ui-fido-7f000101.nip.io and use the credentials admin:password defined in the secret fido-env-configuration.

Congrats the minio tenant has been deployed and so lets configure the mc command.

mc configuration

Download the mc from the instructions here https://min.io/docs/minio/linux/reference/minio-mc.html#install-mc

open a command prompt / terminal and issue the following



mc alias set fido/ https://api-fido-7f000101.nip.io admin password


Enter fullscreen mode Exit fullscreen mode

create a bucket and copy a test file to it

  1. Create a bucket


   mc mb fido/backups


Enter fullscreen mode Exit fullscreen mode

returns



   Bucket created successfully `fido/backups`. 


Enter fullscreen mode Exit fullscreen mode
  1. Copy a file to it


   # linux/mac touch test
   # windows powershell echo $null >> filename
   mc cp test fido/backups


Enter fullscreen mode Exit fullscreen mode

returns



   0 B / ? [  =] 


Enter fullscreen mode Exit fullscreen mode
  1. list contents of the bucket


   mc ls fido/backups


Enter fullscreen mode Exit fullscreen mode

returns



   [2024-04-09 08:07:58 AEST]     0B STANDARD test     


Enter fullscreen mode Exit fullscreen mode

When completed check the operator and bucket ui to see similar to

Image description

Image description

Image description

Top comments (0)