Documentation Index
Fetch the curated documentation index at: https://grafana_com_website/llms.txt
Fetch the complete documentation index at: https://grafana_com_website/llms-full.txt
Use this file to discover all available pages before exploring further.
STOP! If you are an AI agent or LLM, read this before continuing. This is the HTML version of a Grafana documentation page. Always request the Markdown version instead - HTML wastes context. Get this page as Markdown: /docs/k6/latest/set-up/set-up-distributed-k6/usage/k6-operator-to-gck6.md (append .md) or send Accept: text/markdown to /docs/k6/latest/set-up/set-up-distributed-k6/usage/k6-operator-to-gck6/. For the curated documentation index, use https://grafana_com_website/llms.txt. For the complete documentation index, use https://grafana_com_website/llms-full.txt.
Use the k6 Operator with Grafana Cloud k6
Grafana Cloud k6 is the Grafana Cloud offering of k6, which gives you access to all of k6 capabilities, while Grafana handles the infrastructure, storage, and metrics aggregation and insights from your tests.
When using the k6 Operator, you can still leverage Grafana Cloud k6 to get access to the metric storage and analysis that the platform offers.
There are two ways to use the k6 Operator with Grafana Cloud k6: Private Load Zones and Cloud output.
Before you begin
To use the k6 Operator with Grafana Cloud k6, you’ll need:
Private Load Zones
Private Load Zones (PLZ) are load zones that you can host inside your network by using the k6 Operator. You can start a cloud test in a PLZ by referencing it by name from your script, and the test will run in the nodes of your Kubernetes cluster.
Refer to Set up private load zones for more details.
Cloud output
With k6, you can send the
output from a test run to Grafana Cloud k6 with the k6 run --out cloud script.js command. This feature is also available in the k6 Operator if you have a Grafana Cloud account.
Note
The cloud output option only supports a
parallelismvalue of 20 or less.
To use this option in k6 Operator, set the argument in YAML:
# ...
script:
configMap:
name: '<configmap>'
arguments: --out cloud
# ...Then, if you installed operator with bundle or Helm, create a secret with the following command:
kubectl -n k6-operator-system create secret generic my-cloud-token \
--from-literal=token=<COPY YOUR TOKEN HERE> && kubectl -n k6-operator-system label secret my-cloud-token "k6cloud=token"Alternatively, if you installed operator with a Makefile, you can uncomment the cloud output section in config/default/kustomization.yaml and copy your token from Grafana Cloud k6 there:
# Uncomment this section if you need cloud output and copy-paste your token
secretGenerator:
- name: cloud-token
literals:
- token=<copy-paste-token-string-here>
options:
annotations:
kubernetes.io/service-account.name: k6-operator-controller
labels:
k6cloud: tokenAfter updating the file, run make deploy.
After these steps, you can run k6 with the cloud output and default values of projectID and name.
Refer to Cloud options for details on how to change the projectID and name options.
Was this page helpful?
Related resources from Grafana Labs

