Your own S3 bucket on a raspberry pi!

MinIO is a high-performance, S3-compatible object storage solution that runs seamlessly in Kubernetes. Itโ€™s a great alternative to AWS S3 for self-hosted environments and is ideal for cloud-native applications. In this guide, weโ€™ll set up MinIO in a Kubernetes cluster, ensuring high availability and persistence.


๐Ÿ“Œ Prerequisites

Before proceeding, ensure you have the following:

  • A running Kubernetes cluster (K3s, MicroK8s, or any standard K8s distribution).
  • kubectl configured to interact with the cluster.
  • Helm installed (for easy deployment).
  • A Persistent Storage solution (like NFS, Longhorn, or local PersistentVolumes).

๐Ÿ› ๏ธ Step 1: Create a Namespace for MinIO

First, weโ€™ll create a dedicated namespace for MinIO to keep things organized:

1
kubectl create namespace minio

โš™๏ธ Step 2: Deploy MinIO Using Helm

Weโ€™ll use Helm to deploy MinIO in a simple, scalable, and manageable way.

๐Ÿ”น Add the MinIO Helm Repository

1
2
helm repo add minio https://charts.min.io/
helm repo update

๐Ÿ”น Install MinIO

1
2
3
4
5
6
helm install minio minio/minio \
--namespace minio \
--set accessKey="admin" \
--set secretKey="supersecret" \
--set persistence.enabled=true \
--set persistence.size=10Gi

๐Ÿ”น This command does the following:

  • Installs MinIO in the minio namespace.
  • Sets access credentials (you can change these).
  • Enables persistent storage with a 10Gi volume.

๐Ÿ” Step 3: Verify MinIO Deployment

Check if MinIO is running:

1
kubectl get pods -n minio

You should see something like this:

1
2
NAME                    READY   STATUS    RESTARTS   AGE
minio-5b6f8b5f6d-xyz 1/1 Running 0 1m

To check logs:

1
kubectl logs -n minio -l app=minio

๐ŸŒ Step 4: Expose MinIO

๐Ÿ”น Using a LoadBalancer (if available)

1
kubectl expose deployment minio --type=LoadBalancer --port=9000 -n minio

If youโ€™re using an Ingress Controller like Traefik or Nginx, create an Ingress resource to access MinIO via a domain:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minio-ingress
namespace: minio
annotations:
kubernetes.io/ingress.class: "traefik"
spec:
rules:
- host: minio.yourdomain.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: minio
port:
number: 9000

Then apply it:

1
kubectl apply -f minio-ingress.yaml

Make sure your DNS (GoDaddy, Cloudflare, etc.) points minio.yourdomain.com to your clusterโ€™s external IP.


๐Ÿ”‘ Step 5: Access MinIO Web UI

Once MinIO is exposed, access it via:

๐Ÿ”— http://minio.yourdomain.com

Use the credentials you set (admin / supersecret).


๐ŸŽฏ Step 6: Configure a MinIO Bucket

To create a bucket via kubectl:

1
2
kubectl exec -n minio -it $(kubectl get pods -n minio -l app=minio -o jsonpath="{.items[0].metadata.name}") -- mc alias set local http://minio:9000 admin supersecret
kubectl exec -n minio -it $(kubectl get pods -n minio -l app=minio -o jsonpath="{.items[0].metadata.name}") -- mc mb local/mybucket

Now you have a bucket named mybucket ready to use.


๐Ÿš€ Conclusion

Youโ€™ve successfully deployed MinIO in Kubernetes! ๐ŸŽ‰

โœ… MinIO is running on your cluster
โœ… Itโ€™s accessible via Ingress (or LoadBalancer)
โœ… You can store and retrieve objects using the MinIO API

Now you can integrate MinIO with your apps, use it for backups, or replace AWS S3 in your workflows.

๐Ÿ”ฅ Next Steps:

  • Secure MinIO using TLS with cert-manager.
  • Set up MinIO in Distributed Mode for High Availability.
  • Integrate MinIO with external services like PostgreSQL, Redis, and more.

Happy coding! ๐Ÿš€๐Ÿ’ก

, , ,
© 2025 Daily Geek All Rights Reserved.
Theme by hiero