Difficulty: beginner
Estimated Time: 8-10 minutes

Pod is the smallest concept we have in Kubernetes and it is not represented by a single container. Pods consist of one or more containers.

You can think of a Namespace as a virtual cluster inside of your Kubernetes deployment. You can have multiple namespaces inside of a single Kubernetes cluster and each one of them is isolated from each other. As all pods run in a specifc namespace, they can help your team with the organisation, security and performance of your pods.

A Label is a key/value pair that is used to provide attributes to objects. It's good practice to leverage labels, as you'll be able to have a more granular control over what your pods are doing. Labels can be used to query specific objects.

A Volume serves data to the pod.

Pod

NOTE: Don’t use naked Pods (that is, Pods not bound to a ReplicaSet or Deployment) if you can avoid it. Naked Pods will not be rescheduled in the event of a node failure. For further information, refer to the Kubernetes Best Practices documentation.

Congratulations! You can start the next exercise in this series.

Pods

Step 1 of 6

Namespaces

Namespaces isolate pods to separate workloads from each other and to give you the capability of setting up resource constrainsts. You can map namespaces to the different application environments you might consider.

Discover Kubernetes namespaces

Let's take a look at the initial Kubernetes namespaces:

kubectl get namespace

By default, Kubernetes comes with a few predefined namespaces. We can see them here:

Namespaces

kube-system

This namespace has objects created by Kubernetes system:

kubectl get pods -n kube-system; echo

Pods inside of this namespace are needed to make Kubernetes work, such as controllers and add-ons natively integrated with Kubernetes which we will talk later on.

Note: Usually, each cloud provider will run specific implementation pods in this namespace too - so don't worry if the kube-system namespace differs between clusters/cloud providers.

kube-public

This namespace has a ConfigMap which contains the bootstrapping and certificate configuration for the Kubernetes cluster:

kubectl get pods -n kube-public; echo

You won't see anything running in this namespace, but we can see a cluster-info ConfigMap:

kubectl get configmap -n kube-public cluster-info -o yaml; echo

In addition, this namespace might be treated as a location used to run an object which should be visible and readable throughout the whole cluster.

default

All objects created without specifying a namespace will automatically be created in the default namespace.

This namespace is initially empty and doesn't contain any objects:

kubectl get pods -n default; echo

One thing to note about the default namespace is that it can't be deleted, unlike other namespaces within the Kubernetes cluster.