2021-01-29 19:22:43 +08:00
|
|
|
name: Chaos Test
|
|
|
|
|
2021-04-02 15:26:24 +08:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
paths-ignore:
|
|
|
|
- 'docs/**'
|
2021-01-29 19:22:43 +08:00
|
|
|
|
|
|
|
jobs:
|
2021-02-20 14:03:10 +08:00
|
|
|
chaos-test:
|
2021-01-29 19:22:43 +08:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- name: setup go
|
|
|
|
uses: actions/setup-go@v2.1.3
|
|
|
|
with:
|
|
|
|
go-version: "1.14"
|
|
|
|
|
|
|
|
- name: Creating minikube cluster
|
|
|
|
run: |
|
2021-02-08 10:33:06 +08:00
|
|
|
bash ./t/chaos/setup_chaos_utils.sh start_minikube
|
2021-03-03 13:40:33 +08:00
|
|
|
wget https://raw.githubusercontent.com/apache/apisix-docker/master/alpine-local/Dockerfile
|
|
|
|
mkdir logs
|
|
|
|
docker build -t apache/apisix:alpine-local --build-arg APISIX_PATH=. -f Dockerfile .
|
|
|
|
minikube cache add apache/apisix:alpine-local -v 7 --alsologtostderr
|
2021-01-29 19:22:43 +08:00
|
|
|
|
|
|
|
- name: Print cluster information
|
|
|
|
run: |
|
|
|
|
kubectl config view
|
|
|
|
kubectl cluster-info
|
|
|
|
kubectl get nodes
|
|
|
|
kubectl get pods -n kube-system
|
|
|
|
kubectl version
|
|
|
|
|
|
|
|
- name: Deploy Etcd Operator
|
|
|
|
run: |
|
2021-01-31 22:36:32 +08:00
|
|
|
git clone https://github.com/api7/etcd-operator.git --depth 1
|
2021-01-29 19:22:43 +08:00
|
|
|
bash etcd-operator/example/rbac/create_role.sh
|
|
|
|
kubectl create -f etcd-operator/example/deployment.yaml
|
2021-02-08 10:33:06 +08:00
|
|
|
bash ./t/chaos/setup_chaos_utils.sh ensure_pods_ready etcd-operator "True" 30
|
2021-01-29 19:22:43 +08:00
|
|
|
kubectl create -f etcd-operator/example/example-etcd-cluster.yaml
|
2021-02-08 10:33:06 +08:00
|
|
|
bash ./t/chaos/setup_chaos_utils.sh ensure_pods_ready etcd "True True True" 30
|
2021-01-29 19:22:43 +08:00
|
|
|
|
|
|
|
- name: Deploy APISIX
|
|
|
|
run: |
|
2021-02-08 10:33:06 +08:00
|
|
|
bash ./t/chaos/setup_chaos_utils.sh modify_config
|
2021-01-29 19:22:43 +08:00
|
|
|
kubectl create configmap apisix-gw-config.yaml --from-file=./conf/config.yaml
|
|
|
|
kubectl apply -f ./kubernetes/deployment.yaml
|
|
|
|
kubectl apply -f ./kubernetes/service.yaml
|
2021-02-08 10:33:06 +08:00
|
|
|
bash ./t/chaos/setup_chaos_utils.sh ensure_pods_ready apisix-gw "True" 30
|
2021-02-22 11:49:43 +08:00
|
|
|
kubectl apply -f https://raw.githubusercontent.com/istio/istio/master/samples/httpbin/httpbin.yaml
|
|
|
|
bash ./t/chaos/setup_chaos_utils.sh ensure_pods_ready httpbin "True" 30
|
2021-01-29 19:22:43 +08:00
|
|
|
nohup kubectl port-forward svc/apisix-gw-lb 9080:9080 >/dev/null 2>&1 &
|
|
|
|
|
|
|
|
- name: Deploy Chaos mesh
|
|
|
|
run: |
|
|
|
|
curl -sSL https://mirrors.chaos-mesh.org/v1.1.1/install.sh | bash
|
|
|
|
|
|
|
|
- name: run test
|
|
|
|
working-directory: ./t/chaos
|
|
|
|
run: go test -v
|