βΈοΈNamespaces
Describe about What is Namespaces ?
It like a house that group all of the component such as Pod
Service
and we can create the separate rule of each house .
In Kubernetes there are 3 namespaces that are created automatically when we first set up
kube-system
default
kube-public
kube-system
It is the namespace that store all configuration about the K8s system , this namespace will not allow the normal user to access
default
It is normal namespace when everytime you created new pod it will create in this namespace
kube-public
It is namespace that stored resoure and everyone can access
Noted:
When we would like to access service across namespace the DNS is
<service_name>.<namespace>.svc.cluster.local orange = domain
Why we need to isolate namespace ?
Ans: Because we can determine the Resource Quota
for each namespace
CheatSheet Command
Change default name space:
kubectl config set-context $(kubectl config current-context) --namespace=<namespace_name>
Get namespace:
kubectl get ns
Get pod specify namespace :
kubectl get po -n research
Create pod specify namespace:
kubectl run <pod_name> --image=<image_name> -n <namespace_name>
Last updated