Skip to content

Commit

Permalink
fix workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kmrmt committed Dec 13, 2024
1 parent 55a7bba commit cde7e3c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
10 changes: 10 additions & 0 deletions .github/actions/setup-e2e/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ inputs:
description: "If minikube is not required, set this to true and set require_k3d to false"
required: false
default: "false"
require_kind:
description: "If kind is not required, set this to true and set require_k3d to false"
required: false
default: "false"
ingress_port:
description: 'If it is not "0", ingress will be exposed to the specified port'
required: false
Expand Down Expand Up @@ -91,6 +95,12 @@ runs:
run: |
make minikube/install
make minikube/start
- name: Setup kind environment
if: ${{ inputs.require_kind == 'true' }}
shell: bash
run: |
make kind/install
make kind/vs/start
- name: Check Kubernetes cluster
shell: bash
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ jobs:
uses: ./.github/actions/setup-e2e
with:
require_k3d: "false"
require_minikube: "true"
require_kind: "true"
- name: Deploy Vald
id: deploy_vald
uses: ./.github/actions/e2e-deploy-vald
Expand Down
11 changes: 1 addition & 10 deletions Makefile.d/e2e.mk
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,12 @@ e2e/actions/run/job: \
## run GitHub Actions E2E test (Stream CRUD with read replica )
e2e/actions/run/readreplica: \
hack/benchmark/assets/dataset/$(E2E_DATASET_NAME) \
kind/vs/restart \
k8s/metrics/metrics-server/deploy
helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server -n kube-system
kind/vs/restart
kubectl wait -n kube-system --for=condition=Available deployment/metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
sleep 2
kubectl wait -n kube-system --for=condition=Ready pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
kubectl wait -n kube-system --for=condition=ContainersReady pod -l app.kubernetes.io/name=metrics-server --timeout=$(E2E_WAIT_FOR_START_TIMEOUT)
sleep 3
mkdir -p $(TEMP_DIR)/csi-driver-hostpath \
&& 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 \
&& cd $(TEMP_DIR)/csi-driver-hostpath \
&& deploy/kubernetes-latest/deploy.sh \
&& kubectl apply -f ./examples/csi-storageclass.yaml \
&& kubectl apply -f ././examples/csi-pvc.yaml \
&& rm -rf $(TEMP_DIR)/csi-driver-hostpath
$(MAKE) k8s/vald/deploy \
HELM_VALUES=$(ROOTDIR)/.github/helm/values/values-readreplica.yaml
sleep 20
Expand Down
19 changes: 15 additions & 4 deletions Makefile.d/kind.mk
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ kind/restart: \
kind/stop \
kind/start


.PHONY: kind/cluster/start
## start kind (kubernetes in docker) multi node cluster
kind/cluster/start:
Expand Down Expand Up @@ -80,18 +79,30 @@ kind/cluster/restart: \
kind/vs/start: \
$(BINDIR)/docker
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 -
@make kind/vs/login

kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotclasses.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshotcontents.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/client/config/crd/snapshot.storage.k8s.io_volumesnapshots.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/rbac-snapshot-controller.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes-csi/external-snapshotter/$(SNAPSHOTTER_VERSION)/deploy/kubernetes/snapshot-controller/setup-snapshot-controller.yaml

@make kind/vs/login
mkdir -p $(TEMP_DIR)/csi-driver-hostpath \
&& 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 \
&& cd $(TEMP_DIR)/csi-driver-hostpath \
&& deploy/kubernetes-latest/deploy.sh \
&& kubectl apply -f ./examples/csi-storageclass.yaml \
&& kubectl apply -f ././examples/csi-pvc.yaml \
&& rm -rf $(TEMP_DIR)/csi-driver-hostpath

@make k8s/metrics/metrics-server/deploy
helm upgrade --install --set args={--kubelet-insecure-tls} metrics-server metrics-server/metrics-server -n kube-system
sleep $(K8S_SLEEP_DURATION_FOR_WAIT_COMMAND)

.PHONY: kind/vs/stop
## stop kind (kubernetes in docker) cluster with volume snapshot
kind/vs/stop:
kind/vs/stop: \
$(BINDIR)/docker
kind delete cluster --name $(NAME)-vs

.PHONY: kind/vs/login
Expand All @@ -103,4 +114,4 @@ kind/vs/login:
## restart kind (kubernetes in docker) cluster with volume snapshot
kind/vs/restart: \
kind/vs/stop \
kind/vs/start
kind/vs/start

0 comments on commit cde7e3c

Please sign in to comment.