0
0
Kubernetesdevops~20 mins

Default namespaces overview in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Namespace Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the purpose of the 'kube-system' namespace in Kubernetes?

In Kubernetes, several default namespaces exist. What is the main role of the kube-system namespace?

AIt contains system components and services managed by Kubernetes itself.
BIt is used for user-created applications and workloads.
CIt stores temporary data and logs for debugging purposes.
DIt is reserved for network policies and ingress controllers only.
Attempts:
2 left
💡 Hint

Think about where Kubernetes keeps its own essential services.

💻 Command Output
intermediate
2:00remaining
Output of listing namespaces in a fresh Kubernetes cluster

What is the output of the command kubectl get namespaces immediately after installing a new Kubernetes cluster?

Kubernetes
kubectl get namespaces
A
NAME          STATUS   AGE
default       Active   1m
kube-system   Active   1m
kube-public   Active   1m
B
NAME          STATUS   AGE
default       Active   1m
user-space    Active   1m
kube-system   Active   1m
C
NAME          STATUS   AGE
default       Active   1m
kube-system   Active   1m
kube-public   Active   1m
kube-node-lease Active   1m
D
NAME          STATUS   AGE
default       Active   1m
kube-public   Active   1m
kube-node-lease Active   1m
Attempts:
2 left
💡 Hint

Remember the default namespaces Kubernetes creates for system and node management.

Configuration
advanced
2:00remaining
Effect of creating a pod without specifying a namespace

If you create a pod using kubectl apply -f pod.yaml and the pod manifest does not specify a namespace, where will the pod be created?

AIn a new namespace named after the pod.
BIn the <code>default</code> namespace.
CIn the <code>kube-system</code> namespace.
DThe command will fail due to missing namespace.
Attempts:
2 left
💡 Hint

Think about Kubernetes' default behavior when no namespace is given.

Troubleshoot
advanced
2:00remaining
Why can't a pod in 'default' namespace access a service in 'kube-system' namespace without specifying namespace?

You have a pod in the default namespace trying to access a service named dns-service in the kube-system namespace using just dns-service as the hostname. Why does this fail?

ABecause the service <code>dns-service</code> does not exist in <code>kube-system</code>.
BBecause services in <code>kube-system</code> are blocked by default network policies.
CBecause pods in <code>default</code> cannot communicate with pods in <code>kube-system</code> at all.
DBecause DNS resolution in Kubernetes requires the full service name including namespace for cross-namespace access.
Attempts:
2 left
💡 Hint

Think about how Kubernetes DNS resolves service names across namespaces.

Best Practice
expert
2:00remaining
Recommended namespace usage for multi-team Kubernetes cluster

You manage a Kubernetes cluster shared by multiple teams. What is the best practice regarding namespaces to isolate team workloads?

ACreate a separate namespace for each team to isolate resources and apply team-specific policies.
BUse the <code>default</code> namespace for all teams to simplify management.
CCreate namespaces only for system components and put all teams in one namespace.
DAvoid namespaces and use labels on pods to separate teams.
Attempts:
2 left
💡 Hint

Think about how namespaces help with resource isolation and access control.