0
0
Kubernetesdevops~10 mins

Default namespaces overview in Kubernetes - Step-by-Step Execution

Choose your learning style9 modes available
Process Flow - Default namespaces overview
Cluster starts
Create default namespaces
Namespaces available:
default
User pods
User deploys pods in 'default' namespace by default
When a Kubernetes cluster starts, it creates three default namespaces: default, kube-system, and kube-public. Each serves a specific purpose for organizing pods and resources.
Execution Sample
Kubernetes
kubectl get namespaces
NAME              STATUS   AGE
default           Active   10d
kube-system       Active   10d
kube-public       Active   10d
This command lists the default namespaces created automatically in a Kubernetes cluster.
Process Table
StepActionNamespaces PresentPurpose
1Cluster startsNoneNo namespaces exist yet
2Create default namespacesdefault, kube-system, kube-publicNamespaces created automatically
3User deploys pod without specifying namespacedefault, kube-system, kube-publicPod goes to 'default' namespace
4System pods startdefault, kube-system, kube-public'kube-system' holds system pods
5Public info accessibledefault, kube-system, kube-public'kube-public' holds public info
💡 All default namespaces created and ready for use
Status Tracker
VariableStartAfter Step 2After Step 3After Step 4Final
NamespacesNonedefault, kube-system, kube-publicdefault, kube-system, kube-publicdefault, kube-system, kube-publicdefault, kube-system, kube-public
Pod locationNoneNonedefaultdefaultdefault
Key Moments - 3 Insights
Why does a pod go to the 'default' namespace if I don't specify one?
Because Kubernetes automatically assigns pods to the 'default' namespace when no namespace is specified, as shown in step 3 of the execution_table.
What is the purpose of the 'kube-system' namespace?
'kube-system' holds system pods that manage the cluster itself, as indicated in step 4 of the execution_table.
Why is 'kube-public' namespace important?
'kube-public' contains resources that are readable by all users, useful for public cluster info, as shown in step 5.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution_table, at which step are the default namespaces created?
AStep 2
BStep 1
CStep 3
DStep 4
💡 Hint
Check the 'Namespaces Present' column to see when namespaces appear
According to variable_tracker, where is a pod placed after step 3?
A'kube-system' namespace
B'kube-public' namespace
C'default' namespace
DNo namespace assigned
💡 Hint
Look at 'Pod location' variable after step 3
If a user explicitly deploys a pod in 'kube-system', what changes in the execution_table?
APublic info appears at step 5
BPod location changes to 'kube-system' at step 3
CNamespaces change at step 2
DNo change in pod location
💡 Hint
Step 3 shows pod location; changing namespace affects this step
Concept Snapshot
Kubernetes creates three default namespaces automatically:
- default: for user pods without specified namespace
- kube-system: for system pods managing the cluster
- kube-public: for public cluster info
Pods go to 'default' if no namespace is given
Namespaces organize resources logically
Full Transcript
When a Kubernetes cluster starts, it automatically creates three namespaces: default, kube-system, and kube-public. The 'default' namespace is where user pods go if no namespace is specified. The 'kube-system' namespace holds system pods that manage the cluster. The 'kube-public' namespace contains resources accessible by all users. Using the command 'kubectl get namespaces' shows these namespaces. This organization helps keep cluster resources separated and manageable.