Difference between revisions of "Kubernetes namespaces"
Jump to navigation
Jump to search
↑ https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
(14 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
Kubernetes starts with four initial namespaces: <ref>https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/</ref> | Kubernetes starts with four initial namespaces: <ref>https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/</ref> | ||
− | * <code>default</code> is the default namespace for objects with no other namespace. | + | * <code>[[default]]</code> is the default namespace for objects with no other namespace. |
* <code>[[kube-system]]</code> for objects created by the Kubernetes system. | * <code>[[kube-system]]</code> for objects created by the Kubernetes system. | ||
* <code>[[kube-public]]</code> is created automatically and is readable by all users (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement. | * <code>[[kube-public]]</code> is created automatically and is readable by all users (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement. | ||
− | * <code>kube-node-lease</code> holds [[ | + | * <code>[[kube-node-lease]]</code> holds [[lease objects]] associated with each node. Node leases allow the <code>[[kubelet]]</code> to send [[heartbeats]] so that the control plane can detect node failure. |
Additional documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ | Additional documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ | ||
+ | Other typical namespaces: <code>[[Kubernetes monitoring|monitoring]], [[cluster-autoscaler]]</code> | ||
== Commands == | == Commands == | ||
* <code>[[kubectl get namespaces]]</code> | * <code>[[kubectl get namespaces]]</code> | ||
− | * | + | * <code>[[kubectl create namespace]] MY_TEST_NAMESPACE</code> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
* <code>[[kubectl create namespace]] [[argocd]]</code> | * <code>[[kubectl create namespace]] [[argocd]]</code> | ||
− | + | * <code>[[kubectl describe namespace]]</code> | |
* <code>[[kubectl get all --all-namespaces]]</code> | * <code>[[kubectl get all --all-namespaces]]</code> | ||
* <code>[[kubectl get pods]] --all-namespaces</code> | * <code>[[kubectl get pods]] --all-namespaces</code> | ||
+ | * <code>[[kubectl label namespace]]</code> | ||
== Activities == | == Activities == | ||
Line 32: | Line 27: | ||
* <code>[[kubectl get configmaps -A]]</code> | * <code>[[kubectl get configmaps -A]]</code> | ||
* <code>default, [[kube-node-lease]], [[kube-public]], [[kube-system]]</code> | * <code>default, [[kube-node-lease]], [[kube-public]], [[kube-system]]</code> | ||
+ | * [[Namespace controller]] | ||
+ | * <code>[[kubens]]</code> | ||
− | EKS | + | EKS namespaces: |
* <code>[[logging]]</code> | * <code>[[logging]]</code> | ||
* <code>[[aws-load-balancer-controller]]</code> [[Ingress controller]] | * <code>[[aws-load-balancer-controller]]</code> [[Ingress controller]] | ||
+ | * [[Terraform resource: kubernetes_namespace]] | ||
== See also == | == See also == |
Latest revision as of 11:18, 26 January 2024
Kubernetes starts with four initial namespaces: [1]
default
is the default namespace for objects with no other namespace.kube-system
for objects created by the Kubernetes system.kube-public
is created automatically and is readable by all users (including those not authenticated). This namespace is mostly reserved for cluster usage, in case that some resources should be visible and readable publicly throughout the whole cluster. The public aspect of this namespace is only a convention, not a requirement.kube-node-lease
holds lease objects associated with each node. Node leases allow thekubelet
to send heartbeats so that the control plane can detect node failure.
Additional documentation: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/
Other typical namespaces: monitoring, cluster-autoscaler
Contents
Commands[edit]
kubectl get namespaces
kubectl create namespace MY_TEST_NAMESPACE
kubectl create namespace argocd
kubectl describe namespace
kubectl get all --all-namespaces
kubectl get pods --all-namespaces
kubectl label namespace
Activities[edit]
Related terms[edit]
kind: namespace
helm list
helm install -n, --namespace
No resources found in default namespace.
kubectl get configmaps -A
default, kube-node-lease, kube-public, kube-system
- Namespace controller
kubens
EKS namespaces:
See also[edit]
kubectl
: [cp | config | create
|delete
|edit | explain |
apply
|exec
|get
|set
|drain | uncordon | rolling-update
|rollout
|logs
|run
|auth
|label | annotate
|version
|top
|diff
|debug
|replace
|describe
|port-forward | proxy
|scale
|rollout
|api-resources
| expose deployment | expose | patch | attach | get endpoints | ~/.kube/config | kubectl logs --help | kubectl --help, kubectl-convert, kubectl autoscale, kubectl.kubernetes.io- Kubernetes namespaces:
kubectl get namespaces
,kube-system namespace
,--namespace
Advertising: