Keeping all K6 kubernetes operator resources scoped to a single namespace?

At my company we have a large cluster with tons of permissions blocking creating a bunch of random resources.

I’m wanting to test the k6 on k8s, but I want all required resources to be scoped to a particular namespace. Is this possible?

Running the makefile, this wasn’t clear, but it attempts to create new namespaces and a ton of resources despite the docs on k6 just saying to be in the proper namespace before running.

Hi @schachte, welcome to the forum :tada:

Do you mean that you want k6-operator itself to be deployed in some specific namespace? By default the operator and its resources are deployed to k6-operator-system namespace. While the tests will be deployed to whatever namespace you specify in your K6 resource(s).

Of course, it’s possible to change k6-operator-system namespace to something else. E.g. you can do it with kustomizations used by make deploy or even with manual replacement in bundle.yaml. Btw, Makefile is no longer the only way to deploy the operator, see Readme.

Hope that helps!

Thanks! I did manually replace the namespace to my own, but there were a bunch of permission failures I got with cluster role bindings and cluster roles. Are these required? These are scoped outside the namespace.

@schachte yes, they’re required: that’s what allows the operator to watch the resources in the cluster. Those resources are non-namespaced (docs), i.e. not tied to any namespace.

Do I understand correctly that you have only limited access to your cluster?

This issue might be related:

Hi, FWIW, I’m having some success using a vcluster ( I’m in the same boat where we have only a namespace that we have full access to and very limited to no cluster wide permissions. I was able to install a vcluster in the namespace and then using the vcluster I was able to install with make deploy and let it keep the defaults.

1 Like