Since Local controller support one node only, deploy standalone mode.
Using local persistent volume instead of hostpath.
Signed-off-by: Chen, Tingjie <tingjie.chen@intel.com>
Change-Id: I91eaa7c14fdd112a8232e655b571ddeddfe5ccec
--- /dev/null
+#!/bin/bash
+
+# Make sure 64GB+ free space.
+
+echo "s"|sudo -S mkdir /mnt/minio
+
+# Create local-storage persistent volume first since not support dynamic provisioning.
+kubectl create -f local-pv.yaml
+
+# Create storage class for local-storage
+kubectl create -f local-sc.yaml
+
+# Create persistent volume claim for minio server
+kubectl create -f local-pvc.yaml
+
+# Create deployment of MinIO server
+kubectl create -f minio-deployment.yaml
+
+# Create service for MinIO
+kubectl create -f minio-service.yaml
+
--- /dev/null
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+ name: minio-pv
+spec:
+ capacity:
+ storage: 64Gi
+ volumeMode: Filesystem
+ accessModes:
+ - ReadWriteOnce
+ persistentVolumeReclaimPolicy: Delete
+ storageClassName: local-storage
+ local:
+ path: /mnt/minio
+ nodeAffinity:
+ required:
+ nodeSelectorTerms:
+ - matchExpressions:
+ - key: kubernetes.io/os
+ operator: In
+ values:
+ - linux
+
--- /dev/null
+kind: PersistentVolumeClaim
+apiVersion: v1
+metadata:
+ name: minio-local-claim
+spec:
+ accessModes:
+ - ReadWriteOnce
+ resources:
+ requests:
+ storage: 64Gi
+ storageClassName: local-storage
+
--- /dev/null
+kind: StorageClass
+apiVersion: storage.k8s.io/v1
+metadata:
+ name: local-storage
+provisioner: kubernetes.io/no-provisioner
+volumeBindingMode: WaitForFirstConsumer
+
--- /dev/null
+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-local-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: "ICN-ACCESSKEYID"
+ - name: MINIO_SECRET_KEY
+ value: "ICN-SECRETACCESSKEY"
+ ports:
+ - containerPort: 9000
+ hostPort: 9000
+ # Mount the volume into the pod
+ volumeMounts:
+ - name: storage # must match the volume name, above
+ mountPath: "/storage"
+
--- /dev/null
+apiVersion: v1
+kind: Service
+metadata:
+ name: minio-service
+spec:
+ type: LoadBalancer
+ ports:
+ - port: 9000
+ targetPort: 9000
+ protocol: TCP
+ selector:
+ app: minio
+