Last active
November 23, 2021 14:44
-
-
Save nitisht/ded3bd58e1269c6490c07547cb3ab066 to your computer and use it in GitHub Desktop.
Create a distributed Minio deployment based on StatefulSets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: v1 | |
kind: Service | |
metadata: | |
name: minio | |
labels: | |
app: minio | |
spec: | |
clusterIP: None | |
ports: | |
- port: 9000 | |
name: minio | |
selector: | |
app: minio | |
--- | |
apiVersion: apps/v1alpha1 | |
kind: PetSet | |
metadata: | |
name: minio | |
spec: | |
serviceName: "minio" | |
replicas: 4 | |
template: | |
metadata: | |
annotations: | |
pod.alpha.kubernetes.io/initialized: "true" | |
labels: | |
app: minio | |
spec: | |
containers: | |
- name: minio | |
env: | |
- name: MINIO_ACCESS_KEY | |
value: "minio" | |
- name: MINIO_SECRET_KEY | |
value: "minio123" | |
image: minio/minio | |
command: ["minio"] | |
args: ["server", "http://minio-0.minio.default.svc.cluster.local/data", "http://minio-1.minio.default.svc.cluster.local/data", "http://minio-2.minio.default.svc.cluster.local/data", "http://minio-3.minio.default.svc.cluster.local/data"] | |
ports: | |
- containerPort: 9000 | |
hostPort: 9000 | |
# These volume mounts are persistent. Each pod in the PetSet | |
# gets a volume mounted based on this field. | |
volumeMounts: | |
- name: data | |
mountPath: /data | |
# These are converted to volume claims by the controller | |
# and mounted at the paths mentioned above. | |
volumeClaimTemplates: | |
- metadata: | |
name: data | |
annotations: | |
volume.alpha.kubernetes.io/storage-class: anything | |
spec: | |
accessModes: [ "ReadWriteOnce" ] | |
resources: | |
requests: | |
storage: 10Gi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment