k8s 部署minio
部署NFS
mkdir /nfs_data/minio_data
chmod -R 777 /nfs_data/minio_data
创建命名空间minio
kubectl create ns minio
Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
namespace: minio
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio
image: minio/minio:latest
imagePullPolicy: IfNotPresent
command:
- /bin/sh
- -c
- minio server /data --console-address ":5000"
ports:
- name: data
containerPort: 9000
protocol: "TCP"
- name: console
containerPort: 5000
protocol: "TCP"
resources:
requests:
memory: 128Mi
cpu: 50m
limits:
memory: 128Mi
cpu: 100m
volumeMounts:
- mountPath: /data
name: data
volumes:
- nfs:
server: 192.168.1.3
path: /nfs_data/minio_data
name: data
service暴露端口
apiVersion: v1
kind: Service
metadata:
name: minio
namespace: minio
spec:
type: NodePort
ports:
- name: data
port: 9000
targetPort: 9000
protocol: TCP
nodePort: 29000
- name: console
port: 5000
targetPort: 5000
protocol: TCP
nodePort: 29001
selector:
app: minio
访问minio
http://192.168.1.4:29001/
默认账号/密码:minioadmin/minioadmin