'Where I can see "set context" for change kubernetes namespace in Intellij IDEA?

In official tutorial saying about changing namespace by cliking on namespace item and set context enter image description here

But I can't see in my version 2020.3

enter image description here



Solution 1:[1]

A namespace is a part of a Kubernetes context, other ones are cluster and user credentials. So essentially a Kubernetes context is a shortcut which gives you a quick access to a namespace in your cluster. For the screenshot you posted, default namespace has a context created for it (usual scenario), but other namespaces do not have a context.

If you want to create a context for another namespace, please use kubectl config set-context command in a terminal. Cloud Code doesn't support this operation via UI or Kubernetes Explorer since it's normally rarely used. Contexts are normally created automatically when you start a cluster like minikube or GKE.

Solution 2:[2]

Note that for the Kubernetes plugin (which I prefer over the google cloud intellij plugin) you can change the kubernetes context in the Services section by right clicking the current context you're on, selecting contexts from the dropdown menu and picking one of the contexts listed there:

enter image description here

You'll have to add your google-cloud cluster to your local kubectl's contexts by updating your local ~/.kube/config file as explained in the Google Cloud documentation.

Note that changing contexts from the command line will not update IntelliJ, you have to do it from that menu. I'm using Intellij IDEA 2022.1 Ultimate Edition

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2