diff --git a/test/minio/minio.yaml b/test/minio/minio.yaml new file mode 100644 index 0000000000..6ae7878b97 --- /dev/null +++ b/test/minio/minio.yaml @@ -0,0 +1,135 @@ +# Copyright 2017 the Velero contributors. +# SPDX-FileCopyrightText: The RamenDR authors +# +# SPDX-License-Identifier: Apache-2.0 + +--- +apiVersion: v1 +kind: Namespace +metadata: + name: minio +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + namespace: minio + name: minio-config-pvc + labels: + component: minio +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: "rook-ceph-block" + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + namespace: minio + name: minio-storage-pvc + labels: + component: minio +spec: + accessModes: ["ReadWriteOnce"] + storageClassName: "rook-ceph-block" + resources: + requests: + storage: 10Gi +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + namespace: minio + name: minio + labels: + component: minio +spec: + strategy: + type: Recreate + selector: + matchLabels: + component: minio + template: + metadata: + labels: + component: minio + spec: + volumes: + - name: storage + persistentVolumeClaim: + claimName: minio-storage-pvc + readOnly: false + - name: config + persistentVolumeClaim: + claimName: minio-config-pvc + readOnly: false + containers: + - name: minio + image: minio/minio:latest + imagePullPolicy: IfNotPresent + args: + - server + - /storage + - --config-dir=/config + env: + - name: MINIO_ACCESS_KEY + value: "minio" + - name: MINIO_SECRET_KEY + value: "minio123" + ports: + - containerPort: 9000 + hostPort: 9000 + volumeMounts: + - name: storage + mountPath: "/storage" + - name: config + mountPath: "/config" +--- +apiVersion: v1 +kind: Service +metadata: + namespace: minio + name: minio + labels: + component: minio +spec: + type: NodePort + ports: + - port: 9000 + targetPort: 9000 + protocol: TCP + nodePort: 30000 + selector: + component: minio +--- +apiVersion: batch/v1 +kind: Job +metadata: + namespace: minio + name: minio-setup + labels: + component: minio +spec: + template: + metadata: + name: minio-setup + spec: + restartPolicy: OnFailure + volumes: + - name: config + persistentVolumeClaim: + claimName: minio-config-pvc + readOnly: false + containers: + - name: mc + image: minio/mc:latest + imagePullPolicy: IfNotPresent + command: + - /bin/sh + - -c + - "mc --config-dir=/config config host add ramen http://minio:9000 + minio minio123 && mc --config-dir=/config mb -p ramen/bucket" + volumeMounts: + - name: config + mountPath: "/config" diff --git a/test/minio/start b/test/minio/start new file mode 100755 index 0000000000..89296fa2c3 --- /dev/null +++ b/test/minio/start @@ -0,0 +1,26 @@ +#!/usr/bin/env -S python3 -u + +# SPDX-FileCopyrightText: The RamenDR authors +# +# SPDX-License-Identifier: Apache-2.0 + +import sys + +import drenv + +if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} cluster") + sys.exit(1) + +cluster = sys.argv[1] + +drenv.log_progress("Deploying minio") +drenv.kubectl("apply", "--filename", "minio/minio.yaml", profile=cluster) + +drenv.log_progress("Waiting until minio is rolled out") +drenv.kubectl( + "rollout", "status", "deployment/minio", + "--namespace", "minio", + "--timeout", "180s", + profile=cluster, +) diff --git a/test/regional-dr.yaml b/test/regional-dr.yaml index dcd33f5bec..c93f1b19cb 100644 --- a/test/regional-dr.yaml +++ b/test/regional-dr.yaml @@ -12,6 +12,7 @@ profiles: scripts: - file: olm/start - file: rook/start + - file: minio/start - name: "dr2" network: default extra_disks: 1 @@ -19,6 +20,7 @@ profiles: scripts: - file: olm/start - file: rook/start + - file: minio/start - name: "hub" network: default scripts: