K8s部署Minio
前言
minio相关技术文档、产品概述可前往官网查看,此处不在做详细介绍。
https://www.minio.org.cn/
根据minio官网的范本部署一个单节点单磁盘的minio服务端。
https://min.io/docs/minio/kubernetes/upstream/operations/installation.html
yaml文件
minio-pvc.yaml
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: minio-pvc
namespace: tools
spec:
accessModes:
- ReadWriteOnce
storageClassName: k8s-data
resources:
requests:
storage: 20Gi
minio-secret.yaml
user/pass 自行通过base64加密替换
apiVersion: v1
kind: Secret
metadata:
namespace: tools
name: minio-secret
labels:
app: minio-secret
name: minio-secret
data:
user: YWRtaW4=
pass: YWRtaW4=
type: Opaque
minio-deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio-deployment
namespace: tools
labels:
app: minio
name: minio
spec:
replicas: 1
revisionHistoryLimit: 3
selector:
matchLabels:
app: minio
name: minio
template:
metadata:
labels:
app: minio
name: minio
spec:
containers:
- name: minio
image: 10.194.24.53/tools/minio/minio:RELEASE.2023-08-23T10-07-06Z
imagePullPolicy: IfNotPresent
resources:
limits:
cpu: '2'
memory: '4Gi'
requests:
cpu: 100m
memory: 256Mi
env:
- name: MINIO_ACCESS_KEY
valueFrom:
secretKeyRef:
key: user
name: minio-secret
- name: MINIO_SECRET_KEY
valueFrom:
secretKeyRef:
key: pass
name: minio-secret
- name: TZ
value: Asia/Shanghai
- name: TIME_ZONE
value: Asia/Shanghai
command:
- /bin/bash
- -c
args:
- minio server /data --console-address :9090 --address :9000
ports:
- containerPort: 9090
name: console-address
- containerPort: 9000
name: address
volumeMounts:
- name: minio-data
mountPath: /data
- name: localtime
mountPath: /etc/localtime
volumes:
- name: minio-data
persistentVolumeClaim:
claimName: minio-pvc
- name: localtime
hostPath:
path: /etc/localtime
imagePullSecrets:
- name: hub
minio-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: minio-svc
namespace: tools
spec:
type: ClusterIP
ports:
- name: console-address
protocol: TCP
port: 9090
targetPort: 9090
# nodePort: 32307
- name: address
protocol: TCP
port: 9000
targetPort: 9000
# nodePort: 32308
selector:
app: minio
name: minio
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: minio-ing
namespace: tools
spec:
rules:
- host: web.minio.glj.com
http:
paths:
- backend:
service:
name: minio-svc
port:
number: 9090
pathType: Prefix
path: /