grafana/k6-operator is a Kubernetes operator for running distributed k6 tests in your cluster.
This Salesfloor repository is a fork of the original K6 Operator repository. Please refer to the original repository for common info about K6 Operator.
- Runner jobs send 'test_starttime' tag as a part of real time output
Steps to make a change available on SF Kubernetes:
- make a change in the repository
- build a new image
- push the image to ghrc.io/salesfloor docker registry
- install the updated K6 Operator to SF Kubernetes on Google Cloud
See below details on how to do it.
- Install docker and make sure docker daemon is running
- Install kubectl
- Install gcloud
- Authorize on google cloud
gcloud auth login- Connect to the 'Performance tests K6' project
gcloud container clusters get-credentials \
--project "perfomance-tests1-k6" \
--region "northamerica-northeast1" \
cluster-k6-tests- In your gitHub account (with access to Salesfloor organization) create Personal Access Token (Classic) and select access permissions:
read:packageswrite:packagesdelete:packages
Note! please select the soonest available token expiration option. As long as K6 Operator may need updating and re-installing rarely, there is no need for a non-expiring token.
- Set environment variables with the github token info
export GITHUB_USERNAME=<github-username> # the account where token is created
export GITHUB_EMAIL=<github-email>
export GITHUB_PACKAGES_TOKEN=<personal-access-token>- Login Docker to ghcr.io (to push images to ghcr.io/salesfloor/...)
make docker-login- Craete github-packages-secret secret on Kubernetes (so that Kubernetes can pull images from ghcr.io/salesfloor/...):
make kube-secretMake sure to update unit tests for your changes. To execute unit tests, use these commands:
make test-setup # only need to run once
make testmake docker-buildmake docker-pushmake deployTo delete K6 Operator use make delete command.
Note!
-
If
github-packages-secretis absent or has wrong infomake deploycommand will still finish successfully. But Initializer job on Kubernetes will show Image Pull Error. -
make deletecommand also deletesk6-operator-systemnamespace together with related secrets. So make sure to runmake kube-secretcommand again before usingmake deploynext time. -
Google Cloud Web interface is not quite transparent/clear in describing details of errors.
kubectl describe pod <pod-name>command is much more helpful in troubleshooting.
