apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: ai-control-chat-minio
  namespace: aegida-services
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 2Gi
---
apiVersion: v1
kind: Service
metadata:
  name: ai-control-chat-minio
  namespace: aegida-services
spec:
  type: ClusterIP
  ports:
    - name: api
      port: 9000
      targetPort: api
    - name: console
      port: 9001
      targetPort: console
  selector:
    app: ai-control-chat-minio
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: ai-control-chat-minio
  namespace: aegida-services
spec:
  replicas: 1
  selector:
    matchLabels:
      app: ai-control-chat-minio
  template:
    metadata:
      labels:
        app: ai-control-chat-minio
    spec:
      containers:
        - name: minio
          image: minio/minio:RELEASE.2025-04-22T22-12-26Z
          args:
            - server
            - /data
            - --console-address
            - :9001
          ports:
            - name: api
              containerPort: 9000
            - name: console
              containerPort: 9001
          env:
            - name: MINIO_ROOT_USER
              valueFrom:
                secretKeyRef:
                  name: ai-control-chat-secrets
                  key: MINIO_ROOT_USER
            - name: MINIO_ROOT_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: ai-control-chat-secrets
                  key: MINIO_ROOT_PASSWORD
          readinessProbe:
            httpGet:
              path: /minio/health/ready
              port: api
            initialDelaySeconds: 5
            periodSeconds: 5
          livenessProbe:
            httpGet:
              path: /minio/health/live
              port: api
            initialDelaySeconds: 15
            periodSeconds: 10
          volumeMounts:
            - name: data
              mountPath: /data
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: ai-control-chat-minio
