How can I access a global preview environment with "kubectl"?

I have access to global preview environments from the Okteto UI, but I get a permission error when using the Okteto CLI or “kubectl” against a global preview environment.
How can I fix this?

1 Like

This is not possible with the default Okteto installation. We are working on a feature to fix it, but in the meantime, you can use a globalClusterRole to assign this cluster role to every Okteto user via a cluster role binding.

For example, you can use the default view cluster role in the globalClusterRole field:

globalClusterRole: view

This way, every Okteto user will have read access to all the okteto namespaces. You can also create your own cluster role with custom permissions arefer to it in the globalClusterRole field. The limitation is that users will have read access to all the namespaces, not just global previews. We are working on a feature to solve this limitation.

1 Like