Kubernetes - Namespaces đ
Description đ
Namespaces
provides a mechanism for isolating groups of resources within a single cluster.
- Names of resources need to be unique within a namespace, but not across namespaces.
- Intended for use in environments with many users spread across multiple teams, or projects.
- Can be used to set a resource quota
Basic Commands
đ
- list current
namespaces
kubectl get namespace
- create a
namespace
kubectl create namespace <namespace-name>
- delete a
namespace
kubectl delete namespace <namespace-name>
- get all resources in a
namespace
kubectl get all --namespace <namespace-name>
Examples đ§Š
-
sample
namespace
definitionapiVersion: v1 kind: Namespace metadata: name: dev # defined a rescource quota for the namespace spec: hard: pods: "10" requests.cpu: "4" requests.memory: 5GI limits.cpu: "10" limits.memory: 10Gi