3/9/2021 Running minio in minikube · GitHub
Instantly share code, notes, and snippets.
balamurugana / running-minio-in-minikube.md
Last active 15 days ago
Star
Code Revisions 2 Stars 1 Forks 1
Running minio in minikube
running-minio-in-minikube.md
Prerequisites:
Run minikube with kvm driver by $ minikube start --vm-driver kvm
Minio FS mode:
1. Deploy minio in fs mode with below yaml in a file like $ kubectl create -f my-
minio-fs.yaml
## Create persistent volume claim for minio to store data.
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: my-minio-fs-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
## Run minio fs deployment.
apiVersion: extensions/v1
kind: Deployment
metadata:
name: my-minio-fs
spec:
strategy:
type: Recreate
https://gist.github.com/balamurugana/c59e868a36bb8a549fe863d22d6f0678 1/4
3/9/2021 Running minio in minikube · GitHub
template:
metadata:
labels:
app: my-minio-fs
spec:
volumes:
- name: data
persistentVolumeClaim:
claimName: my-minio-fs-pvc
containers:
- name: my-minio-fs
volumeMounts:
- name: data
mountPath: "/data"
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
args:
- server
- /data
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
ports:
- containerPort: 9000
hostPort: 9000
2. To make the above deployment accessible from outside network, run below
command
$ kubectl expose deployment/my-minio-fs --type="NodePort" --port 9000
3. Run below command to know the port the above service exposed.
kubectl get services/my-minio-fs -o go-template='{{(index .spec.ports 0).node
4. Use this port in the endpoint http://minikube:<EXPOSED-PORT>
Minio Dist-XL mode:
1. Deploy minio in dist-xl mode with below yaml in a file like $ kubectl create -f my-
minio-dist-xl.yaml
## Create headless service to StatefulSet to work.
apiVersion: v1
https://gist.github.com/balamurugana/c59e868a36bb8a549fe863d22d6f0678 2/4
3/9/2021 Running minio in minikube · GitHub
kind: Service
metadata:
name: my-minio-dist-xl-headless
labels:
app: my-minio-dist-xl-headless
spec:
ports:
- port: 9000
name: my-minio-dist-xl
clusterIP: None
selector:
app: my-minio-dist-xl-headless
---
apiVersion: apps/v1beta2
kind: StatefulSet
metadata:
name: my-minio-dist-xl
spec:
serviceName: "my-minio-dist-xl-headless"
replicas: 4
selector:
matchLabels:
app: my-minio-dist-xl-app
template:
metadata:
labels:
app: my-minio-dist-xl-app
spec:
containers:
- name: my-minio-dist-xl
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
image: minio/minio:RELEASE.2017-11-22T19-55-46Z
args:
- server
- http://my-minio-dist-xl-0.my-minio-dist-xl-headless.default.svc.clu
- http://my-minio-dist-xl-1.my-minio-dist-xl-headless.default.svc.clu
- http://my-minio-dist-xl-2.my-minio-dist-xl-headless.default.svc.clu
- http://my-minio-dist-xl-3.my-minio-dist-xl-headless.default.svc.clu
ports:
- containerPort: 9000
name: my-minio-dist-xl
volumeMounts:
- name: data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: data
https://gist.github.com/balamurugana/c59e868a36bb8a549fe863d22d6f0678 3/4
3/9/2021 Running minio in minikube · GitHub
spec:
accessModes: [ "ReadWriteOnce" ]
resources:
requests:
storage: 1Gi
2. To make the above deployment accessible from outside network, run below yaml
kubectl create -f my-minio-dist-xl-service.yaml
apiVersion: v1
kind: Service
metadata:
name: my-minio-dist-xl
spec:
type: NodePort
ports:
- port: 9000
selector:
app: my-minio-dist-xl
3. Run below command to know the port the above service exposed.
kubectl get services/my-minio-dist-xl -o go-template='{{(index .spec.ports 0)
4. Use this port in the endpoint http://minikube:<EXPOSED-PORT>
saadzimat430 commented on 28 Apr
Hi, first thanks for the effort for sharing this.
I followed the steps, Minio and its pods/services seem to be created successfully. But when I launch the
service, I get redirected to minio/console Github page. How can I open Minio dashboard and create
tenants?
balamurugana commented on 28 Apr Owner Author
@saadzimat430 Please open an issue in respective project to get appropriate help.
https://gist.github.com/balamurugana/c59e868a36bb8a549fe863d22d6f0678 4/4