0
0
Kubernetesdevops~20 mins

Creating custom namespaces in Kubernetes - Practice Exercises

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!
💻 Command Output
intermediate
1:30remaining
Output of Namespace Creation Command
What is the output of running this command in a Kubernetes cluster?

kubectl create namespace dev-team
Kubernetes
kubectl create namespace dev-team
Acommand not found: kubectl
BError from server (AlreadyExists): namespaces "dev-team" already exists
CNo resources found.
Dnamespace/dev-team created
Attempts:
2 left
💡 Hint
Think about what kubectl outputs when a namespace is successfully created.
🧠 Conceptual
intermediate
1:30remaining
Purpose of Kubernetes Namespaces
Which option best describes the purpose of creating custom namespaces in Kubernetes?
ATo create a backup of the cluster configuration
BTo increase the CPU and memory limits of pods automatically
CTo isolate resources and organize cluster objects logically
DTo deploy applications faster by skipping validations
Attempts:
2 left
💡 Hint
Think about how namespaces help manage resources in a shared environment.
Configuration
advanced
2:00remaining
Correct YAML for Custom Namespace
Which YAML configuration correctly creates a namespace named qa-environment?
A
apiVersion: v1
kind: Namespace
metadata:
  name: qa-environment
B
apiVersion: v1
kind: Namespace
metadata:
  namespace: qa-environment
C
apiVersion: v1
kind: Namespace
metadata:
  name: qa_environment
D
apiVersion: v1
kind: Namespace
metadata:
  name: qa-environment
spec:
  replicas: 3
Attempts:
2 left
💡 Hint
Check the correct field name under metadata for naming namespaces.
Troubleshoot
advanced
2:00remaining
Troubleshooting Namespace Creation Error
You run kubectl create namespace test-env but get this error:

Error from server (Forbidden): namespaces "test-env" is forbidden: User "developer" cannot create resource "namespaces" in API group "" at the cluster scope

What is the most likely cause?
AThe namespace 'test-env' already exists
BThe user 'developer' lacks permission to create namespaces cluster-wide
CThe kubectl command is misspelled
DThe Kubernetes API server is down
Attempts:
2 left
💡 Hint
Focus on the 'Forbidden' and 'cannot create resource' parts of the error.
🔀 Workflow
expert
2:30remaining
Namespace Creation and Resource Deployment Order
You want to deploy an application in a new namespace called staging. Which is the correct order of commands to achieve this?
A3,1,4,2
B1,3,4,2
C1,4,3,2
D3,4,1,2
Attempts:
2 left
💡 Hint
You must create the namespace before deploying resources into it.