Difficulty: beginner
Estimated Time: 8-10 minutes

Pod is the smallest concept we have in Kubernetes. It is not a container. Pods consist of one or more containers.

Namespaces - You can think of namespace as a virtual cluster inside of you Kubernetes cluster. You can have multiples namespaces inside of a single Kubernetes cluster and they are isolated from each other. They can help your team with organisation, security and performance. Pods are running on namespaces

Label is a metadata to identify information. It can be used for queries.

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. Fro further information in Best Practices

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

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Pods

Step 1 of 6

Namespaces

Namespaces isolates pods to separate workloads from each other and it gives you the capability of setting up resource constrainsts on it. It could fit with environment segregation.

Discover Kubernetes namespaces

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

kubectl get namespace

By default, Kubernetes comes with three 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 works, 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 just contains a configmap which has the bootstrapping and certificate information of the K8s cluster:

kubectl get pods -n kube-public; echo

You don'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 addtion, this namespace might be treated as a namespace to run any object which should be visible and readable throughout the whole cluster since it is visible and readable from all parts of the Kubernetes cluster.

default

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

This namespace is 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.