From 49e6a830c4031d2a1bf95e09f6bf7f2b656dfba0 Mon Sep 17 00:00:00 2001 From: Dmitrii Ustiugov Date: Thu, 21 Jan 2021 14:13:20 -0700 Subject: [PATCH] added yaml files for minio server deployment with k8s Signed-off-by: Dmitrii Ustiugov --- configs/storage/minio/deployment.yaml | 44 +++++++++++++++++++++++++++ configs/storage/minio/pv-claim.yaml | 16 ++++++++++ configs/storage/minio/pv.yaml | 24 +++++++++++++++ configs/storage/minio/service.yaml | 12 ++++++++ 4 files changed, 96 insertions(+) create mode 100644 configs/storage/minio/deployment.yaml create mode 100644 configs/storage/minio/pv-claim.yaml create mode 100644 configs/storage/minio/pv.yaml create mode 100644 configs/storage/minio/service.yaml diff --git a/configs/storage/minio/deployment.yaml b/configs/storage/minio/deployment.yaml new file mode 100644 index 000000000..f8825cce7 --- /dev/null +++ b/configs/storage/minio/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 # for k8s versions before 1.9.0 use apps/v1beta2 and before 1.8.0 use extensions/v1beta1 +kind: Deployment +metadata: + # This name uniquely identifies the Deployment + name: minio-deployment +spec: + selector: + matchLabels: + app: minio + strategy: + type: Recreate + template: + metadata: + labels: + # Label is used as selector in the service. + app: minio + spec: + # Refer to the PVC created earlier + volumes: + - name: storage + persistentVolumeClaim: + # Name of the PVC created earlier + claimName: minio-pv-claim + containers: + - name: minio + # Pulls the default Minio image from Docker Hub + image: minio/minio:latest + args: + - server + - /storage + env: + # Minio access key and secret key + - name: MINIO_ACCESS_KEY + value: "minio" + - name: MINIO_SECRET_KEY + value: "minio123" + ports: + - containerPort: 9000 + hostPort: 9000 + # Mount the volume into the pod + volumeMounts: + - name: storage # must match the volume name, above + mountPath: "/storage" + diff --git a/configs/storage/minio/pv-claim.yaml b/configs/storage/minio/pv-claim.yaml new file mode 100644 index 000000000..4dcae5df2 --- /dev/null +++ b/configs/storage/minio/pv-claim.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + # This name uniquely identifies the PVC. Will be used in deployment below. + name: minio-pv-claim + labels: + app: minio-storage-claim +spec: + # Read more about access modes here: http://kubernetes.io/docs/user-guide/persistent-volumes/#access-modes + accessModes: + - ReadWriteOnce + storageClassName: local-storage + resources: + # This is the request for storage. Should be available in the cluster. + requests: + storage: 100Gi diff --git a/configs/storage/minio/pv.yaml b/configs/storage/minio/pv.yaml new file mode 100644 index 000000000..f2a36eef0 --- /dev/null +++ b/configs/storage/minio/pv.yaml @@ -0,0 +1,24 @@ +apiVersion: v1 +kind: PersistentVolume +metadata: + name: minio-pv +spec: + capacity: + storage: 100Gi + volumeMode: Filesystem + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Delete + storageClassName: local-storage + local: + # FIXME: Need a better way to assign local storage + path: /minio + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + # FIXME: need a better way to name a node + - node-0.ustiugov-qv89540.rperf-pg0.utah.cloudlab.us diff --git a/configs/storage/minio/service.yaml b/configs/storage/minio/service.yaml new file mode 100644 index 000000000..109937d57 --- /dev/null +++ b/configs/storage/minio/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: minio-service +spec: + clusterIP: 10.96.0.46 + ports: + - port: 9000 + targetPort: 9000 + protocol: TCP + selector: + app: minio