Skip to content

Commit

Permalink
hoge
Browse files Browse the repository at this point in the history
  • Loading branch information
peng225 committed Jun 14, 2024
1 parent 286a69b commit 41dd90e
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 17 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/deploy-rook-ceph-on-two-k8s-clusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ jobs:
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
25 changes: 11 additions & 14 deletions test/e2e/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ launch-minikube:
--extra-config=kubeadm.node-name=$(NODE_NAME) \
--extra-config=kubelet.hostname-override=$(NODE_NAME) \
-p $(PROFILE)
# To prevent rook installation timeout, pull the image in advance.
$(MINIKUBE) -p $(PROFILE) ssh -- docker pull quay.io/ceph/ceph:v17.2.6
# $(SUDO) chown -R $$USER $$HOME/.kube $(MINIKUBE_HOME)/.minikube
# $(SUDO) chmod -R a+r $$HOME/.kube $(MINIKUBE_HOME)/.minikube
# $(SUDO) find $(MINIKUBE_HOME)/.minikube -name id_rsa -exec chmod 600 {} ';'
Expand Down Expand Up @@ -168,7 +170,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 \
Expand All @@ -178,7 +180,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
Expand Down Expand Up @@ -207,23 +209,18 @@ image-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 -
$(MINIKUBE) -p $(PROFILE) image load controller:latest

$(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 -
$(MINIKUBE) -p $(PROFILE) image load controller:latest

$(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:
Expand Down
56 changes: 56 additions & 0 deletions test/e2e/testdata/persistentvolumes.yaml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 41dd90e

Please sign in to comment.