Skip to content

A condensed demo setup of everything you need to get k6 running seriously on k8s

License

Notifications You must be signed in to change notification settings

deepshore/k6-testkit-resources

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k6-testkit-resources

A condensed demo setup of everything you need to get k6 running seriously on k8s

what you will need

prepare environment

  • clone this repo and open a terminal with prerequisites installed.
  • install elasticsearch crds and operator via
    • kubectl create -f https://download.elastic.co/downloads/eck/2.6.1/crds.yaml and
    • kubectl apply -f https://download.elastic.co/downloads/eck/2.6.1/operator.yaml
  • OPTIONAL: install grafana operator via
    • kubectl create -k grafana-operator/overlays/cluster_scoped
  • create a namespace kubectl create ns k6demo
  • switch context kubectl config set-context --current --namespace k6demo
  • issue a [token with scope repo:read] (https://github.com/settings/tokens/new?scopes=read:packages)
  • export the token in your shell export CR_PAT=YOUR_TOKEN
  • create a secret to allow k8s to pull from our repository by
kubectl create secret docker-registry github-registry \
--docker-server=https://ghcr.io \
--docker-username=unset \
--docker-password=$CR_PAT \
[email protected] \
-n k6demo
  • setup an elastic node kubectl apply -f resources/k6_elasticsearch.yaml

  • check elasticsearch with kubectl wait --for=jsonpath='{.status.phase}'=Ready elasticsearch metrics-db

  • setup a kibana node kubectl apply -f resources/k6_kibana.yaml

  • check kibana with kubectl wait --for=jsonpath='{.status.health}'=green kibana metrics-ui

  • port forward kubectl port-forward service/metrics-ui-kb-http 5601

  • open kibana in browser and login with elastic and the password you obtain with this command kubectl get secret metrics-db-es-elastic-user -o=jsonpath='{.data.elastic}' | base64 --decode; echo

  • import the saved objects located in kibana folder via Kibana Stack Management

  • Check Kibana Dashboards

  • done. you have a complete k8s based k6 testing environment.

  • OPTIONAL: you can additionally spin up a grafana node now

run tests

  • kubectl apply -f resources
  • kubectl wait --for=jsonpath='{.status.stage}'=finished k6 k6-test-by-deepshore
  • now check that dashboard again

preview

dashboard

About

A condensed demo setup of everything you need to get k6 running seriously on k8s

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published