From 176ce6e68587014b215c147fbf2c7520f14d5cee Mon Sep 17 00:00:00 2001 From: Shinya Hayashi Date: Fri, 14 Jun 2024 06:00:02 +0000 Subject: [PATCH] hoge --- .../deploy-rook-ceph-on-two-k8s-clusters.yaml | 10 ++-- .github/workflows/e2e.yaml | 1 - test/e2e/Makefile | 25 +++------ test/e2e/testdata/persistentvolumes.yaml | 56 +++++++++++++++++++ 4 files changed, 71 insertions(+), 21 deletions(-) create mode 100644 test/e2e/testdata/persistentvolumes.yaml diff --git a/.github/workflows/deploy-rook-ceph-on-two-k8s-clusters.yaml b/.github/workflows/deploy-rook-ceph-on-two-k8s-clusters.yaml index 82f6cd14..2782f6c3 100644 --- a/.github/workflows/deploy-rook-ceph-on-two-k8s-clusters.yaml +++ b/.github/workflows/deploy-rook-ceph-on-two-k8s-clusters.yaml @@ -57,17 +57,19 @@ jobs: - run: |- make -C test/e2e setup ln -s $(pwd)/test/e2e/bin/kubectl-1.28.3 test/e2e/bin/kubectl - - run: make -C test/e2e image-build - run: |- make -C test/e2e launch-minikube PROFILE=profile1 make -C test/e2e launch-minikube PROFILE=profile2 + - run: |- + make -C test/e2e image-build PROFILE=profile1 + make -C test/e2e image-build PROFILE=profile2 - name: "Deploy primary Rook/Ceph cluster" run: |- ./test/e2e/bin/kubectl config use-context profile1 make -C test/e2e launch-single-rook-ceph PROFILE=profile1 - make -C test/e2e setup-single-components + make -C test/e2e setup-single-components PROFILE=profile1 - name: "Deploy secondary Rook/Ceph cluster" run: |- ./test/e2e/bin/kubectl config use-context profile2 - make -C test/e2e launch-single-rook-ceph PROFILE=profile1 - make -C test/e2e setup-single-components + make -C test/e2e launch-single-rook-ceph PROFILE=profile2 + make -C test/e2e setup-single-components PROFILE=profile2 diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 9d684fd8..f9328040 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -55,5 +55,4 @@ jobs: sudo modprobe -a kvm sudo modprobe -a kvm_amd - run: make -C test/e2e setup - - run: make -C test/e2e image-build - run: make -C test/e2e test diff --git a/test/e2e/Makefile b/test/e2e/Makefile index 12a14c4d..de4a5d9a 100644 --- a/test/e2e/Makefile +++ b/test/e2e/Makefile @@ -34,6 +34,7 @@ setup: .PHONY: test test: $(MAKE) launch-minikube + $(MAKE) image-build $(MAKE) launch-rook-ceph $(MAKE) setup-components $(MAKE) do_test @@ -168,7 +169,7 @@ launch-rook-ceph: create-loop-dev .PHONY: launch-single-rook-ceph launch-single-rook-ceph: create-loop-dev - $(HELM) upgrade --install --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \ + $(HELM) upgrade --install --timeout 10m --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \ --create-namespace --namespace $(CEPH_CLUSTER1_NAMESPACE) -f testdata/values.yaml --wait \ rook-ceph rook-ceph sed \ @@ -178,7 +179,7 @@ launch-single-rook-ceph: create-loop-dev testdata/persistentvolumes-template.yaml \ > testdata/persistentvolumes.yaml $(KUBECTL) apply -f testdata/persistentvolumes.yaml - $(HELM) upgrade --install --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \ + $(HELM) upgrade --install --timeout 10m --version $(ROOK_CHART_VERSION) --repo https://charts.rook.io/release \ --namespace $(CEPH_CLUSTER1_NAMESPACE) -f testdata/values-cluster.yaml --wait rook-ceph-cluster rook-ceph-cluster free -h df -h @@ -203,27 +204,19 @@ delete-rook-ceph: .PHONY: image-build image-build: + eval $$($(MINIKUBE) -p $(PROFILE) docker-env) $(MAKE) -C ../.. docker-build .PHONY: setup-components setup-components: - # We can't use `minikube image load` due to a minikube's problem. - # ref. https://github.com/kubernetes/minikube/issues/17785 - docker save controller:latest | $(SUDO) ctr -n k8s.io images import - - - $(HELM) upgrade --install mantle-cluster-wide ../../charts/mantle-cluster-wide/ --wait - $(HELM) upgrade --install --namespace=$(CEPH_CLUSTER1_NAMESPACE) mantle ../../charts/mantle/ --wait - $(HELM) upgrade --install --namespace=$(CEPH_CLUSTER2_NAMESPACE) mantle2 ../../charts/mantle/ --wait + $(HELM) upgrade --install --timeout 10m mantle-cluster-wide ../../charts/mantle-cluster-wide/ --wait + $(HELM) upgrade --install --timeout 10m --namespace=$(CEPH_CLUSTER1_NAMESPACE) mantle ../../charts/mantle/ --wait + $(HELM) upgrade --install --timeout 10m --namespace=$(CEPH_CLUSTER2_NAMESPACE) mantle2 ../../charts/mantle/ --wait .PHONY: setup-single-components setup-single-components: - $(MAKE) -C ../.. docker-build - # We can't use `minikube image load` due to a minikube's problem. - # ref. https://github.com/kubernetes/minikube/issues/17785 - docker save controller:latest | $(SUDO) ctr -n k8s.io images import - - - $(HELM) upgrade --install mantle-cluster-wide ../../charts/mantle-cluster-wide/ --wait - $(HELM) upgrade --install --namespace=$(CEPH_CLUSTER1_NAMESPACE) mantle ../../charts/mantle/ --wait + $(HELM) upgrade --install --timeout 10m mantle-cluster-wide ../../charts/mantle-cluster-wide/ --wait + $(HELM) upgrade --install --timeout 10m --namespace=$(CEPH_CLUSTER1_NAMESPACE) mantle ../../charts/mantle/ --wait .PHONY: delete-components delete-components: diff --git a/test/e2e/testdata/persistentvolumes.yaml b/test/e2e/testdata/persistentvolumes.yaml new file mode 100644 index 00000000..0cd41f1d --- /dev/null +++ b/test/e2e/testdata/persistentvolumes.yaml @@ -0,0 +1,56 @@ +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: manual +provisioner: kubernetes.io/no-provisioner +volumeBindingMode: WaitForFirstConsumer +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: local-osd2 + labels: + type: local-osd2 +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + volumeMode: Block + local: + path: /dev/loop1 + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - minikube-worker +--- +kind: PersistentVolume +apiVersion: v1 +metadata: + name: local-osd + labels: + type: local-osd +spec: + storageClassName: manual + capacity: + storage: 5Gi + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + volumeMode: Block + local: + path: /dev/loop0 + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - minikube-worker