Skip to content

Commit 2094e11

Browse files
authored
Merge pull request #37739 from sftim/20221106_revise_namespaces_concept
Improve list of default namespaces
2 parents 5d44f76 + 8e7f060 commit 2094e11

File tree

1 file changed

+22
-11
lines changed
  • content/en/docs/concepts/overview/working-with-objects

1 file changed

+22
-11
lines changed

content/en/docs/concepts/overview/working-with-objects/namespaces.md

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@ resources, such as different versions of the same software: use
3232
{{< glossary_tooltip text="labels" term_id="label" >}} to distinguish
3333
resources within the same namespace.
3434

35+
{{< note >}}
36+
For a production cluster, consider _not_ using the `default` namespace. Instead, make other namespaces and use those.
37+
{{< /note >}}
38+
39+
## Initial namespaces
40+
41+
Kubernetes starts with four initial namespaces:
42+
43+
`default`
44+
: Kubernetes includes this namespace so that you can start using your new cluster without first creating a namespace.
45+
46+
`kube-node-lease`
47+
: This namespace holds [Lease](/docs/reference/kubernetes-api/cluster-resources/lease-v1/) objects associated with each node. Node leases allow the kubelet to send [heartbeats](/docs/concepts/architecture/nodes/#heartbeats) so that the control plane can detect node failure.
48+
49+
`kube-public`
50+
: This namespace is readable by *all* clients (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.
51+
52+
`kube-system`
53+
: The namespace for objects created by the Kubernetes system.
54+
3555
## Working with Namespaces
3656

3757
Creation and deletion of namespaces are described in the
@@ -56,16 +76,7 @@ kube-public Active 1d
5676
kube-system Active 1d
5777
```
5878

59-
Kubernetes starts with four initial namespaces:
6079

61-
* `default` The default namespace for objects with no other namespace
62-
* `kube-system` The namespace for objects created by the Kubernetes system
63-
* `kube-public` This namespace 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.
64-
* `kube-node-lease` This namespace holds [Lease](/docs/reference/kubernetes-api/cluster-resources/lease-v1/)
65-
objects associated with each node. Node leases allow the kubelet to send
66-
[heartbeats](/docs/concepts/architecture/nodes/#heartbeats) so that the control plane
67-
can detect node failure.
68-
6980
### Setting the namespace for a request
7081

7182
To set the namespace for a current request, use the `--namespace` flag.
@@ -106,7 +117,7 @@ By creating namespaces with the same name as [public top-level
106117
domains](https://data.iana.org/TLD/tlds-alpha-by-domain.txt), Services in these
107118
namespaces can have short DNS names that overlap with public DNS records.
108119
Workloads from any namespace performing a DNS lookup without a [trailing dot](https://datatracker.ietf.org/doc/html/rfc1034#page-8) will
109-
be redirected to those services, taking precedence over public DNS.
120+
be redirected to those services, taking precedence over public DNS.
110121

111122
To mitigate this, limit privileges for creating namespaces to trusted users. If
112123
required, you could additionally configure third-party security controls, such
@@ -116,7 +127,7 @@ to block creating any namespace with the name of [public
116127
TLDs](https://data.iana.org/TLD/tlds-alpha-by-domain.txt).
117128
{{< /warning >}}
118129

119-
## Not All Objects are in a Namespace
130+
## Not all objects are in a namespace
120131

121132
Most Kubernetes resources (e.g. pods, services, replication controllers, and others) are
122133
in some namespaces. However namespace resources are not themselves in a namespace.

0 commit comments

Comments
 (0)