Skip to content

Commit 6bba642

Browse files
committed
use kind
1 parent 0473919 commit 6bba642

File tree

4 files changed

+51
-8
lines changed

4 files changed

+51
-8
lines changed

.github/workflows/e2e.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ jobs:
304304
timeout-minutes: 60
305305
container:
306306
image: ghcr.io/vdaas/vald/vald-ci-container:${{ needs.detect-ci-container.outputs.TAG }}
307-
options: "--net host --add-host host.docker.internal:host-gateway"
307+
options: "--add-host host.docker.internal:host-gateway"
308308
steps:
309309
- uses: actions/checkout@v4
310310
- name: Set Git config

Makefile.d/e2e.mk

+12-3
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,21 @@ e2e/actions/run/job: \
145145
## run GitHub Actions E2E test (Stream CRUD with read replica )
146146
e2e/actions/run/readreplica: \
147147
hack/benchmark/assets/dataset/$(E2E_DATASET_NAME) \
148-
minikube/restart
148+
kind/vs/restart \
149+
k8s/metrics/metrics-server/deploy
150+
helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server -n kube-system
149151
kubectl wait -n kube-system --for=condition=Available deployment/metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
150152
sleep 2
151-
kubectl wait -n kube-system --for=condition=Ready pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
152-
kubectl wait -n kube-system --for=condition=ContainersReady pod -l k8s-app=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
153+
kubectl wait -n kube-system --for=condition=Ready pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
154+
kubectl wait -n kube-system --for=condition=ContainersReady pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
153155
sleep 3
156+
mkdir -p $(TEMP_DIR)/csi-driver-hostpath \
157+
&& curl -fsSL https://github.com/kubernetes-csi/csi-driver-host-path/archive/refs/tags/v1.15.0.tar.gz | tar zxf - -C $(TEMP_DIR)/csi-driver-hostpath --strip-components 1 \
158+
&& cd $(TEMP_DIR)/csi-driver-hostpath \
159+
&& deploy/kubernetes-latest/deploy.sh \
160+
&& kubectl apply -f ./examples/csi-storageclass.yaml \
161+
&& kubectl apply -f ././examples/csi-pvc.yaml \
162+
&& rm -rf $(TEMP_DIR)/csi-driver-hostpath
154163
$(MAKE) k8s/vald/deploy \
155164
HELM_VALUES=$(ROOTDIR)/.github/helm/values/values-readreplica.yaml
156165
sleep 20

Makefile.d/kind.mk

+37-3
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
17+
SNAPSHOTTER_VERSION=v8.2.0
18+
1619
.PHONY: kind/install
1720
## install KinD
1821
kind/install: $(BINDIR)/kind
@@ -25,7 +28,8 @@ $(BINDIR)/kind:
2528

2629
.PHONY: kind/start
2730
## start kind (kubernetes in docker) cluster
28-
kind/start:
31+
kind/start: \
32+
$(BINDIR)/docker
2933
kind create cluster --name $(NAME)
3034
@make kind/login
3135

@@ -36,7 +40,8 @@ kind/login:
3640

3741
.PHONY: kind/stop
3842
## stop kind (kubernetes in docker) cluster
39-
kind/stop:
43+
kind/stop: \
44+
$(BINDIR)/docker
4045
kind delete cluster --name $(NAME)
4146

4247
.PHONY: kind/restart
@@ -54,7 +59,6 @@ kind/cluster/start:
5459
kubectl apply -f https://projectcontour.io/quickstart/operator.yaml
5560
kubectl apply -f https://projectcontour.io/quickstart/contour-custom-resource.yaml
5661

57-
5862
.PHONY: kind/cluster/stop
5963
## stop kind (kubernetes in docker) multi node cluster
6064
kind/cluster/stop:
@@ -70,3 +74,33 @@ kind/cluster/login:
7074
kind/cluster/restart: \
7175
kind/cluster/stop \
7276
kind/cluster/start
77+
78+
.PHONY: kind/vs/start
79+
## start kind (kubernetes in docker) cluster with volume snapshot
80+
kind/vs/start: \
81+
$(BINDIR)/docker
82+
sed -e 's/apiServerAddress: "127.0.0.1"/apiServerAddress: "$(shell grep host.docker.internal /etc/hosts | cut -f1)"/' $(ROOTDIR)/k8s/debug/kind/e2e.yaml | kind create cluster --name $(NAME)-vs --config -
83+
84+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
85+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
86+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
87+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
88+
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml
89+
90+
@make kind/vs/login
91+
92+
.PHONY: kind/vs/stop
93+
## stop kind (kubernetes in docker) cluster with volume snapshot
94+
kind/vs/stop:
95+
kind delete cluster --name $(NAME)-vs
96+
97+
.PHONY: kind/vs/login
98+
## login command for kind (kubernetes in docker) cluster with volume snapshot
99+
kind/vs/login:
100+
kubectl cluster-info --context kind-$(NAME)-vs
101+
102+
.PHONY: kind/vs/restart
103+
## restart kind (kubernetes in docker) cluster with volume snapshot
104+
kind/vs/restart: \
105+
kind/vs/stop \
106+
kind/vs/start

Makefile.d/minikube.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ $(BINDIR)/minikube:
2727
.PHONY: minikube/start
2828
minikube/start: \
2929
$(BINDIR)/docker
30-
minikube start --driver=docker --force
30+
minikube start --driver=docker --force --alsologtostderr -v=1
3131
minikube addons enable volumesnapshots
3232
minikube addons enable csi-hostpath-driver
3333
minikube addons disable storage-provisioner

0 commit comments

Comments
 (0)