Skip to content

Instantly share code, notes, and snippets.

@harshavardhana
Created June 8, 2020 02:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harshavardhana/bab9dc72498846625eb18f67ca2fc901 to your computer and use it in GitHub Desktop.
Save harshavardhana/bab9dc72498846625eb18f67ca2fc901 to your computer and use it in GitHub Desktop.
## Create service of minio dist xl StatefulSet.
apiVersion: v1
kind: Service
metadata:
name: minio
spec:
type: NodePort
ports:
- port: 9000
selector:
app: minio-app
## Create headless service to StatefulSet to work.
apiVersion: v1
kind: Service
metadata:
name: minio-headless
labels:
app: minio-headless
spec:
ports:
- port: 9000
clusterIP: None
selector:
app: minio-app
---
## Run minio dist xl StatefulSet.
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: minio
spec:
serviceName: "minio-headless"
replicas: 4
selector:
matchLabels:
app: minio-app
template:
metadata:
labels:
app: minio-app
spec:
containers:
- name: minio
env:
- name: MINIO_ACCESS_KEY
value: "minio"
- name: MINIO_SECRET_KEY
value: "minio123"
image: minio/minio:latest
imagePullPolicy: Always
args:
- server
- http://minio-0.minio-headless.default.svc.cluster.local/data
- http://minio-1.minio-headless.default.svc.cluster.local/data
- http://minio-2.minio-headless.default.svc.cluster.local/data
- http://minio-3.minio-headless.default.svc.cluster.local/data
ports:
- containerPort: 9000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment