thanos部署(二) -- 对象存储mino

minio提供对象存储,其本身需要在块存储上,这里使用ceph作为块存储。

  1. 在ceph上创建pvc给minio使用,作为minio的存储后端:
    使用storageclass创建pvc:
# cat minio-pvc.yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: minio-pvc
  namespace: minio
spec:
  storageClassName: rook-ceph-block
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 50Gi
  1. 部署minio depolyment
    部署的mini使用上一步创建的pvc:minio-pvc作为/data;
    minio WEB的默认用户名/密码: minio/minio123
# cat minio-deploy.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: minio
  namespace: minio
spec:
  selector:
    matchLabels:
      app: minio
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: minio
    spec:
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: minio-pvc
      containers:
      - name: minio
        volumeMounts:
        - name: data
          mountPath: "/data"
        image: minio/minio:RELEASE.2021-04-18T19-26-29Z
        args:
        - server
        - /data
        env:
        - name: MINIO_ACCESS_KEY
          value: "minio"
        - name: MINIO_SECRET_KEY
          value: "minio123"
        ports:
        - containerPort: 9000
        readinessProbe:
          httpGet:
            path: /minio/health/ready
            port: 9000
          initialDelaySeconds: 90
          periodSeconds: 10
        livenessProbe:
          httpGet:
            path: /minio/health/live
            port: 9000
          initialDelaySeconds: 30
          periodSeconds: 10
  1. 部署minio service并提供NodePort(32600)
# cat minio-svc.yaml
apiVersion: v1
kind: Service
metadata:
  name: minio
  namespace: minio
spec:
  ports:
  - port: 9000
    targetPort: 9000
    nodePort: 32600
  selector:
    app: minio
  type: NodePort

使用NodePort:32600和上一步的用户名、密码就可以登录minio的dashboard:
thanos部署(二) -- 对象存储mino_第1张图片

  1. 在mino上创建bucket提供给thanos使用
    thanos部署(二) -- 对象存储mino_第2张图片

你可能感兴趣的:(thanos部署(二) -- 对象存储mino)