Skip to content
This repository was archived by the owner on Dec 2, 2021. It is now read-only.

Commit 66dc6df

Browse files
committed
Revert "add NamespaceSelector to select namespaces for Initializers"
This reverts commit ee1291784bf373e22cf972d72c3556835fc033c5.
1 parent 0a3255e commit 66dc6df

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

api-machinery/dynamic-admission-control-configuration.md

-26
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@ default admission controls. This document hashes out the implementation details.
2424
* Do not block the entire cluster if the initializers/webhooks are not ready
2525
after registration.
2626

27-
* Admin can enforce initializers to specific namespaces.
28-
2927
## Specification
3028

3129
We assume initializers could be "fail open". We need to update the extensible
@@ -75,13 +73,6 @@ type Initializer struct {
7573
// if the timeout is reached. The default timeout for each initializer is
7674
// 5s.
7775
FailurePolicy *FailurePolicyType `json:"failurePolicy,omitempty"`
78-
79-
// Selects Namespaces using cluster scoped-labels. This
80-
// matches all pods in all namespaces selected by this label selector.
81-
// This field follows standard label selector semantics.
82-
// If present but empty, this selector selects all namespaces.
83-
// +optional
84-
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
8576
}
8677

8778
// Rule is a tuple of APIGroups, APIVersion, and Resources.It is recommended
@@ -282,23 +273,6 @@ crashes, so it is rare.
282273

283274
See [Considered but REJECTED alternatives](#considered-but-rejected-alternatives) for considered alternatives.
284275

285-
## Enforce initializers to specific namespaces
286-
287-
Current `InitializerConfiguration` is at the cluster level and all of the to-be-created resources (such as rc and deployments) defined in `Rules`
288-
will be appended with the pending initializers automatically during creation, regardless of the namespace.
289-
There is no way to only apply the initializers to specific namespaces.
290-
291-
For example, when running a multi-tenant cluster, it'd be quite useful to only apply the rules in just certain namespaces. Sometimes we
292-
don't want to enforce in "kube-*" related namespaces as well.
293-
294-
With the help of `NamespaceSelector`, we can
295-
296-
* Apply initializer to ALL namespaces (by default);
297-
* Apply initializer to limited namespaces using label selector;
298-
299-
Since most users won't add extra labels for namespaces explicitly when creating new resources, the selector matching should only be applied to
300-
`labels.Set(map[string]string{"namespace": namespace})` instead of widely-used `metadata.Labels`.
301-
302276
## Future work
303277

304278
1. Figuring out a better schema to represent the order among

0 commit comments

Comments
 (0)