Choose a Kubernetes namespace

Every Kubernetes or K3s connection has a default namespace, and each query tab remembers the namespace it was opened with. Change it from the namespace drop-down under the connection in the Explorer, or name a namespace directly in a query: get pods team-a.

Use * to list across all namespaces. In the drop-down it appears as All namespaces.

Pick a namespace in the Explorer

When you open a connection, DevOpsPad lists the cluster’s namespaces and shows them in the drop-down under the connection name. Choosing a namespace changes the scope for new tabs. Tabs you already opened keep their own namespace, so you can have staging and production side by side.

The current tab’s context and namespace appear in the toolbar above the editor, for example west / staging.

Set the default namespace

The default comes from the connection’s Namespace field. When you select a context in the connection dialog, DevOpsPad fills it with that context’s default namespace, or default if the context has none. An empty namespace is saved as *.

Edit the connection to change the default. See Connect to a cluster with a kubeconfig context.

Override the namespace in a query

The query format is get <resource> [namespace]. A namespace in the query takes priority over the tab’s scope:

get pods            # uses the tab's namespace
get pods team-a     # uses team-a
get pods *          # all namespaces
get nodes           # nodes are cluster-scoped; no namespace applies

nodes and namespaces are cluster-scoped, so any namespace is ignored for them. More examples are in List Kubernetes resources.

When you cannot list namespaces

Many teams grant access to one namespace only. Listing namespaces then fails with a permission error. DevOpsPad shows:

Namespace discovery is not permitted. You can still use the namespace saved in this connection.

Queries against the saved namespace keep working, and you can name any namespace you have access to in the query itself. Ask your administrator for list on namespaces if you want the drop-down populated. See Kubernetes permissions DevOpsPad needs.

Limits

  • Discovery stops at 10,000 namespaces. Larger clusters show an error asking you to enter a namespace in the connection settings.
  • Resource details, events and logs need a specific namespace for namespaced resources. Rows from an all-namespaces list carry their own namespace, so opening them works.

Frequently asked questions

Why does DevOpsPad say namespace discovery is not permitted?

Your account cannot list namespaces in the cluster. You can still query the namespace saved in the connection settings, or name a namespace directly in a query such as get pods team-a.