You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
= Including and excluding namespaces from a cluster-wide mesh by using the CLI
7
7
8
-
By default, the {SMProductName} Operator uses discovery selectors to identify the namespaces that make up the mesh. Namespaces that do not contain the label defined in the `ServiceMeshMemberRoll` resource are not matched by the discovery selector and are excluded from the mesh.
9
-
8
+
Using the {product-title} CLI, you can add discovery selectors to the `ServiceMeshControlPlane` resource in a cluster-wide mesh. Discovery selectors define the namespaces that the control plane can discover. The control plane ignores any namespace that does not match one of the discovery selectors, which excludes the namespace from the mesh.
9
+
10
+
[NOTE]
11
+
====
12
+
If you install ingress or egress gateways in the control plane namespace, you must include the control plane namespace in the discovery selectors.
13
+
====
14
+
10
15
.Prerequisites
11
16
12
17
* You have installed the {SMProductName} Operator.
<1> `<name>` represents the name of the `ServiceMeshControlPlane` resource.
27
32
28
-
. Modify the YAML file so that the `spec.discoverySelectors` field of the `ServiceMeshMemberRoll` resource includes the discovery selector. The following example uses `istio-discovery: enabled`:
33
+
. Modify the YAML file so that the `spec.meshConfig` field of the `ServiceMeshControlPlane` resource includes the discovery selector.
34
+
+
35
+
[NOTE]
36
+
====
37
+
When configuring namespaces that the `Istiod` service can discover, exclude namespaces that might contain sensitive services that should not be exposed to the rest of the mesh.
38
+
====
39
+
+
40
+
In the following example, the `Istiod` service discovers any namespace that is labeled `istio-discovery: enabled` or any namespace that has the name `bookinfo`, `httpbin` or `istio-system`:
29
41
+
30
42
[source,yaml]
31
43
----
@@ -41,12 +53,15 @@ spec:
41
53
istio-discovery: enabled <1>
42
54
- matchExpressions:
43
55
- key: kubernetes.io/metadata.name <2>
44
-
operator: NotIn
56
+
operator: In
45
57
values:
46
58
- bookinfo
47
59
- httpbin
60
+
- istio-system
48
61
----
49
-
<1> Ensures that the mesh discovers namespaces that contain the label `istio-discovery: enabled`. The mesh does not discover namespaces that do not contain the label.
50
-
<2> Ensures that the mesh does not discover namespaces `bookinfo` and `httpbin`.
62
+
<1> Ensures that the mesh discovers namespaces that contain the label `istio-discovery: enabled`.
63
+
<2> Ensures that the mesh discovers namespaces `bookinfo`, `httpbin` and `istio-system`.
64
+
+
65
+
If a namespace matches any of the discovery selectors, then the mesh discovers the namespace. The mesh excludes namespaces that do not match any of the discovery selectors.
= Including and excluding namespaces from a cluster-wide mesh by using the web console
7
-
8
-
By default, the {SMProductName} Operator uses discovery selectors to identify the namespaces that make up the mesh. Namespaces that do not contain the label defined in the `ServiceMeshMemberRoll` resource are not matched by the discovery selector and are excluded from the mesh.
9
-
7
+
8
+
Using the {product-title} web console, you can add discovery selectors to the `ServiceMeshControlPlane` resource in a cluster-wide mesh. Discovery selectors define the namespaces that the control plane can discover. The control plane ignores any namespace that does not match one of the discovery selectors, which excludes the namespace from the mesh.
9
+
10
+
[NOTE]
11
+
====
12
+
If you install ingress or egress gateways in the control plane namespace, you must include the control plane namespace in the discovery selectors.
13
+
====
14
+
10
15
.Prerequisites
11
16
12
17
* You have installed the {SMProductName} Operator.
@@ -27,7 +32,14 @@ By default, the {SMProductName} Operator uses discovery selectors to identify th
27
32
28
33
. Click *YAML*.
29
34
30
-
. Modify the YAML file so that the `spec.discoverySelectors` field of the `ServiceMeshMemberRoll` resource includes the discovery selector. The following example uses `istio-discovery: enabled`:
35
+
. Modify the YAML file so that the `spec.meshConfig` field of the `ServiceMeshControlPlane` resource includes the discovery selector.
36
+
+
37
+
[NOTE]
38
+
====
39
+
When configuring namespaces that the `Istiod` service can discover, exclude namespaces that might contain sensitive services that should not be exposed to the rest of the mesh.
40
+
====
41
+
+
42
+
In the following example, the `Istiod` service discovers any namespace that is labeled `istio-discovery: enabled` or any namespace that has the name `bookinfo`, `httpbin` or `istio-system`:
31
43
+
32
44
[source,yaml]
33
45
----
@@ -43,12 +55,15 @@ spec:
43
55
istio-discovery: enabled <1>
44
56
- matchExpressions:
45
57
- key: kubernetes.io/metadata.name <2>
46
-
operator: NotIn
58
+
operator: In
47
59
values:
48
60
- bookinfo
49
61
- httpbin
62
+
- istio-system
50
63
----
51
-
<1> Ensures that the mesh discovers namespaces that contain the label `istio-discovery: enabled`. The mesh does not discover namespaces that do not contain the label.
52
-
<2> Ensures that the mesh does not discover namespaces `bookinfo` and `httpbin`.
64
+
<1> Ensures that the mesh discovers namespaces that contain the label `istio-discovery: enabled`.
65
+
<2> Ensures that the mesh discovers namespaces `bookinfo`, `httpbin` and `istio-system`.
66
+
+
67
+
If a namespace matches any of the discovery selectors, then the mesh discovers the namespace. The mesh excludes namespaces that do not match any of the discovery selectors.
0 commit comments