1
1
# Namespace Sameness - SIG Multicluster Position Statement
2
2
3
- Author: Jeremy Olmsted-Thompson (** [ @jeremyot ] ( https://github.com/jeremyot ) ** ), Google
4
- Last Edit: 2020/04/20
3
+ Last Edit: 2023/04/22
5
4
Status: RELEASED
6
5
7
6
## Goal
7
+
8
8
To establish a normative statement for multi-cluster namespace semantics and
9
9
governance as a building block for further development which will require
10
10
specifying behaviors across clusters.
11
11
12
12
## Context
13
+
13
14
Users are reaching for multi-cluster deployments for a
14
15
[ variety of reasons] ( http://bit.ly/k8s-multicluster-conversation-starter-doc ) .
15
- However, Kubernetes treats the cluster boundary as the edge of the universe.
16
- There are currently no standard practices for how to extend the Kubernetes
17
- resource model across multiple clusters. Without common patterns we can’t build
18
- portable tooling to facilitate multi-cluster capabilities and know that behavior
19
- will be consistent for each user.
16
+ However, Kubernetes has historically treated the cluster boundary as the edge
17
+ of the universe. Without common patterns we can’t build portable tooling to
18
+ facilitate multi-cluster capabilities and know that behavior will be consistent
19
+ for each user.
20
20
21
21
## Scope
22
+
22
23
A single organization may need multiple, disjoint sets of clusters. They may,
23
24
for example, represent different phases of the development lifecycle (dev,
24
25
staging, prod) or support unrelated projects. Each organization governs their
25
26
own clusters in isolation, so the scope of a namespace can only reasonably be
26
27
declared within the organizational boundary. The scope of namespace identity is
27
- defined as the union of clusters, governed by a single authority, that are
28
+ defined as the set of all clusters, governed by a single authority, that are
28
29
expected to work together. An authority is a company, organization, team,
29
30
individual, or other entity which is entrusted to manage these clusters and, in
30
31
particular, to create namespaces in them.
31
32
32
33
## Position
33
- ** For a set of related clusters governed by a single authority, all namespaces of
34
- a given name are considered to be the same namespace. A single namespace should
35
- have a consistent owner across the set of clusters.**
34
+
35
+ ** Within a set of related clusters which are governed by a single authority (a
36
+ "clusterset"), samely named namespaces in all clusters are considered to be
37
+ related, to have the same owner(s), and to represent the same intention,
38
+ unless otherwise dictated by some overriding policy, including, but not limited
39
+ to, implementation-specific configuration.**
36
40
37
41
## Appendix
38
42
@@ -46,12 +50,12 @@ Consider an organization that runs two clusters, "A" and "B". They have a
46
50
cluster-ops team which is responsible for keeping those clusters alive and
47
51
healthy. They also have app-teams, "foo" and "bar" which use those clusters.
48
52
49
- Cluster-ops owns the creation of namespaces in both clusters. They can choose
53
+ Cluster-ops owns the creation of namespaces in all clusters. They can choose
50
54
to delegate the ability to create namespaces to foo-team and bar-team, but any
51
- namespace name that is allocated in "reserved" in all clusters. How the
55
+ namespace name that is allocated is "reserved" in all clusters. How the
52
56
delegation works is an area for innovation, but some possible examples
53
57
include:
54
- * A self-service portal which allocate a name in a global database and
58
+ * A self-service portal which allocates a name in a global database and
55
59
creates the namespace on the user's behalf
56
60
* Tooling that allocates a name in a global database and issues a credential
57
61
to the user which is checked in an admission controller
@@ -79,7 +83,7 @@ If there are special RBAC rules that need to be applied in some clusters (e.g.
79
83
clusters in EU have more limited access), the LDAP-to-RBAC sync implementation
80
84
can apply specializations based on whatever criteria it understands.
81
85
82
- ### Example 3: Multi-cluster services
86
+ ### Example 3: Multi-cluster Services
83
87
84
88
Consider the same organization from previous examples. They have enabled an
85
89
implementation of multi-cluster Services, which lets them access backends which
@@ -88,14 +92,42 @@ are running on other clusters in the group.
88
92
As in example 2, cluster-ops run a per-cluster metrics service, It does not
89
93
make sense for clients in cluster A to access the metrics server of cluster B.
90
94
Even though this runs in the same "metrics" namespace in both clusters (and
91
- thus namespce sameness applies), the implementation of multi-cluster services
95
+ thus namespace sameness applies), the implementation of multi-cluster services
92
96
probably should not be on-by-default. The details of how multi-cluster
93
- services will work are an area for innovation, but ideas include:
94
- * Opt-in: services must be "exported" to be merged across clusters
95
- * Opt-out: services or namespace can be opted out of service merging
97
+ services work are out of scope for this document, but valid approaches could
98
+ include:
99
+ * Opt-in: services must be explicitly "exported" to be merged across clusters
100
+ * Opt-out: services or namespaces can be opted out of service merging
96
101
* Different discovery: merged services and "raw" services use different names
97
102
or other discovery mechanisms
98
103
99
- However the implementation works, the metrics service is not automatically
100
- merged across clusters, though the LDAP-to-RBAC sync from example 2 can still
101
- apply consistent policies.
104
+ However the implementation works, the metrics service is not _ necessarily_
105
+ merged across clusters, even if the LDAP-to-RBAC sync from example 2 still
106
+ applies consistent RBAC policies. Those are independent capabilities.
107
+
108
+ ### Example 4: Authority sameness policy
109
+
110
+ Consider the same organization from previous examples, but with more clusters:
111
+ "A", "B", "C", and "D". Business rules dictate that the foo-team and the
112
+ bar-team have a common security posture and may share clusters, but the
113
+ billing-team has stricter requirements and must not share clusters with other
114
+ teams. Cluster-ops wants to assign foo-team's and bar-team's namespaces to
115
+ clusters A and B, and billing-team's namespaces to clusters C and D. They also
116
+ want to ensure that the opposite is never true - foo-team's and bar-team's
117
+ namespaces cannot be used from clusters C or D, and billing-team's namespaces
118
+ cannot be used from clusters A or B.
119
+
120
+ What exactly it means to "be used" depends on each specific multi-cluster
121
+ capability. For multi-cluster Services, the billing-team's endpoints from
122
+ clusters C and D would be eligible for merging, but billing endpoints from
123
+ clusters A and B would not. This can be used by implementations to add another
124
+ layer of safety - even if cluster A were compromised and the billing-team's
125
+ namespaces was created, the MCS implementation can use the policy described
126
+ above to know that it should NOT merge billing endpoints from cluster A.
127
+
128
+ As an implementation choice, the authority may offer controls which govern
129
+ which cluster-namespaces are considered for sameness and which are not.
130
+ The details of how these policies might be expressed could include:
131
+ * In-cluster namespace labels or annotations
132
+ * In-cluster custom-resources
133
+ * An external control-plane API
0 commit comments