kubernetes-101-namespaces
Before jumping into Kubernetes resources, let's take a look over a very important concept called Namespace.
Namespaces are a way to separate cluster resources.
Namespace-based scoping is applicable only for certain types of objects (e.g. Pods Deployments, Services, etc.) and not for cluster-wide objects (e.g. StorageClass, Nodes, PersistentVolumes, etc.).
🔸 Retrieve all defined namespaces.
>> kubectl get namespace
If none specified, the resources are created in the 'default' namespace.
🔸 Create a new namespace called 'test'.
>> kubectl create namespace test
🔸 Create a pod in the newly created namespace.
>> kubectl run nginx-pod –-image=nginx –n test
We'll talk about the pod object a lot more in the later posts.
For now, you only need to know that they are resources that can be grouped into different namespaces.
🔸 Retrieve all pods in the 'test' namespace.
>> kubectl get pods –n test
Check out new-spike.net for other articles on Kubernetes and much more!