ingress-nginx-helm/.github/workflows/perftest.yaml
James Strong 0f30cb04e4
Ci pin deps (#8720)
* pinning deps for CI

* update all the actions and pin them

* missed one

* update helm to another action

* typo on step

* typo on step

* Update .github/workflows/ci.yaml

Co-authored-by: Jintao Zhang <tao12345666333@163.com>

Co-authored-by: Jintao Zhang <tao12345666333@163.com>
2022-06-23 16:55:20 -07:00

70 lines
2.1 KiB
YAML

name: Performance Test
on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
tags:
description: 'K6 Load Test'
permissions:
contents: read
jobs:
k6_test_run:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Install K6
run: |
wget https://github.com/grafana/k6/releases/download/v0.38.2/k6-v0.38.2-linux-amd64.tar.gz
tar -xvf k6-v0.38.2-linux-amd64.tar.gz k6-v0.38.2-linux-amd64/k6
mv k6-v0.38.2-linux-amd64/k6 .
./k6
- name: Make dev-env
run: |
mkdir $HOME/.kube
make dev-env
podName=`kubectl -n ingress-nginx get po | grep -i controller | awk '{print $1}'`
if [[ -z ${podName} ]] ; then
sleep 5
fi
kubectl wait pod -n ingress-nginx --for condition=Ready $podName
kubectl get all -A
- name: Deploy workload
run: |
kubectl create deploy k6 --image kennethreitz/httpbin --port 80 && \
kubectl expose deploy k6 --port 80 && \
kubectl create ing k6 --class nginx \
--rule test.ingress-nginx-controller.ga/*=k6:80
podName=`kubectl get po | grep -i k6 | awk '{print $1}'`
if [[ -z ${podName} ]] ; then
sleep 5
fi
kubectl wait pod --for condition=Ready $podName
kubectl get all,secrets,ing
- name: Tune OS
run : |
sudo sysctl -A 2>/dev/null | egrep -i "local_port_range|tw_reuse|tcp_timestamps"
sudo sh -c "ulimit"
sudo sysctl -w net.ipv4.ip_local_port_range="1024 65535"
sudo sysctl -w net.ipv4.tcp_tw_reuse=1
sudo sysctl -w net.ipv4.tcp_timestamps=1
sudo sh -c "ulimit "
- name: Run smoke test
run: |
vmstat -at 5 | tee vmstat_report &
#./k6 login cloud -t $K6_TOKEN
#./k6 run -o cloud ./smoketest.js
./k6 run test/k6/smoketest.js
pkill vmstat
cat vmstat_report