Namespaces

Last updated 5 months ago

Now that you have a working cluster connected to your Kubernetic client you can continue with handling the namespaces.

Namespaces is a way to virtually split an existing cluster to separate environments. Most objects inside Kubernetes act inside a specific namespace, which means when you switch namespace a fresh environment will be provided.

Go to screen Settings > Namespaces

List Namespaces

You will see there your existing namespaces. Kubernetes creates an active "default" namespace automatically which is where your objects act on by default. It also creates a "kube-system" namespace where all cluster's management objects are stored (e.g. A DNS service).

Settings > Namespaces: Manage namespaces

Creating Namespace

Let's create a namespace:

  • Fill name: kubernetic-tutorial

  • Click Add Namespace button

To create a namespace using kubectl CLI:

kubectl create namespace kubernetic-tutorial

Switching Namespace

The active namespace can be seen on the top menu bar, you can switch to the new namespace by selecting the name:

Switching Namespace

Namespace selection affects only Kubernetic. In order to see the selected namespace using kubectl you need to configure the command properly.

e.g. to see the pods of kubernetic-tutorial namespace:

kubectl get pods --namespace kubernetic-tutorial

Deleting Namespace

Namespaces can be deleted from the menu:

Settings > Namespaces Menu

A confirmation dialog is shown before deleting the namespace:

Settings > Namespace deletion confirmation

To delete a namespace using kubectl CLI:

kubectl delete namespace kubernetic-tutorial

Deletion of a namespace propagates the deletion of all resources under that namespace.