From ebb5a9730ed067a79f1e81e3fe2db85692d0719f Mon Sep 17 00:00:00 2001 From: Roger Yao Date: Tue, 3 Dec 2024 09:49:15 +0800 Subject: [PATCH] Deploy MinIO/NFS on control node https://github.com/longhorn/longhorn/issues/8425 Signed-off-by: Roger Yao --- e2e/README.md | 4 ++-- manager/integration/README.md | 4 ++-- .../backupstores/minio-backupstore.yaml | 21 +++++++++++++++++++ .../deploy/backupstores/nfs-backupstore.yaml | 21 +++++++++++++++++++ pipelines/utilities/install_backupstores.sh | 4 ++-- test_framework/scripts/longhorn-setup.sh | 4 ++-- 6 files changed, 50 insertions(+), 8 deletions(-) diff --git a/e2e/README.md b/e2e/README.md index e2933e0924..0d33040837 100644 --- a/e2e/README.md +++ b/e2e/README.md @@ -16,8 +16,8 @@ curl -sSfL https://raw.githubusercontent.com/longhorn/longhorn/master/scripts/en 1. Deploy all backupstore servers (including `NFS` server and `Minio` as s3 server) for test purposes. ``` -kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml \ - -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/nfs-backupstore.yaml +kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/minio-backupstore.yaml \ + -f https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/nfs-backupstore.yaml ``` 1. Expose Longhorn API: diff --git a/manager/integration/README.md b/manager/integration/README.md index 77fcef7cf5..c4f2d318d4 100644 --- a/manager/integration/README.md +++ b/manager/integration/README.md @@ -18,8 +18,8 @@ Requirement: Run the test: 1. Deploy all backupstore servers(including `NFS` server and `Minio` as s3 server) for test purposes. ``` -kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml \ - -f https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/nfs-backupstore.yaml +kubectl create -f https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/minio-backupstore.yaml \ + -f https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/nfs-backupstore.yaml ``` 2. Deploy the test script to the Kubernetes cluster. ``` diff --git a/manager/integration/deploy/backupstores/minio-backupstore.yaml b/manager/integration/deploy/backupstores/minio-backupstore.yaml index 2ff8d59c1a..398bc6a765 100644 --- a/manager/integration/deploy/backupstores/minio-backupstore.yaml +++ b/manager/integration/deploy/backupstores/minio-backupstore.yaml @@ -41,6 +41,27 @@ spec: labels: app: longhorn-test-minio spec: + nodeSelector: + node-role.kubernetes.io/control-plane: "true" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoExecute" + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoExecute" + - key: "node-role.kubernetes.io/etcd" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/etcd" + operator: "Exists" + effect: "NoExecute" volumes: - name: minio-volume emptyDir: {} diff --git a/manager/integration/deploy/backupstores/nfs-backupstore.yaml b/manager/integration/deploy/backupstores/nfs-backupstore.yaml index 0cacca8edc..548cb7b884 100644 --- a/manager/integration/deploy/backupstores/nfs-backupstore.yaml +++ b/manager/integration/deploy/backupstores/nfs-backupstore.yaml @@ -14,6 +14,27 @@ spec: labels: app: longhorn-test-nfs spec: + nodeSelector: + node-role.kubernetes.io/control-plane: "true" + tolerations: + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/master" + operator: "Exists" + effect: "NoExecute" + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/control-plane" + operator: "Exists" + effect: "NoExecute" + - key: "node-role.kubernetes.io/etcd" + operator: "Exists" + effect: "NoSchedule" + - key: "node-role.kubernetes.io/etcd" + operator: "Exists" + effect: "NoExecute" volumes: - name: nfs-volume emptyDir: {} diff --git a/pipelines/utilities/install_backupstores.sh b/pipelines/utilities/install_backupstores.sh index 7f043e8a8d..9ad06e8938 100755 --- a/pipelines/utilities/install_backupstores.sh +++ b/pipelines/utilities/install_backupstores.sh @@ -1,6 +1,6 @@ install_backupstores(){ - MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml" - NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/nfs-backupstore.yaml" + MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/minio-backupstore.yaml" + NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/nfs-backupstore.yaml" kubectl create -f ${MINIO_BACKUPSTORE_URL} \ -f ${NFS_BACKUPSTORE_URL} } \ No newline at end of file diff --git a/test_framework/scripts/longhorn-setup.sh b/test_framework/scripts/longhorn-setup.sh index 56f4937872..3e1dd35f2f 100755 --- a/test_framework/scripts/longhorn-setup.sh +++ b/test_framework/scripts/longhorn-setup.sh @@ -331,8 +331,8 @@ create_longhorn_namespace(){ install_backupstores(){ - MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/minio-backupstore.yaml" - NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn/master/deploy/backupstores/nfs-backupstore.yaml" + MINIO_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/minio-backupstore.yaml" + NFS_BACKUPSTORE_URL="https://raw.githubusercontent.com/longhorn/longhorn-tests/master/manager/integration/deploy/backupstores/nfs-backupstore.yaml" kubectl create -f ${MINIO_BACKUPSTORE_URL} \ -f ${NFS_BACKUPSTORE_URL} }