Skip to content

Commit

Permalink
added yaml files for minio server deployment with k8s
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitrii Ustiugov <dmitrii.ustiugov@ed.ac.uk>
  • Loading branch information
ustiugov committed Feb 22, 2021
1 parent e3a51fe commit 49e6a83
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
44 changes: 44 additions & 0 deletions configs/storage/minio/deployment.yaml
Original file line number Diff line number Diff line change
@@ -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"

16 changes: 16 additions & 0 deletions configs/storage/minio/pv-claim.yaml
Original file line number Diff line number Diff line change
@@ -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
24 changes: 24 additions & 0 deletions configs/storage/minio/pv.yaml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions configs/storage/minio/service.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 49e6a83

Please sign in to comment.