2.10.4.2. Adding a project to the mesh using the ServiceMeshMember resource with the CLI
You can add one or more projects to the mesh using the ServiceMeshMember resource with the CLI.
Prerequisites
- You have installed the Red Hat OpenShift Service Mesh Operator.
-
You know the name of the
ServiceMeshControlPlaneresource and the name of the project it belongs to. - You know the name of the project you want to add to the mesh.
-
A service mesh administrator must explicitly grant access to the service mesh. Administrators can grant users permissions to access the mesh by assigning them the
mesh-userRoleusing aRoleBindingorClusterRoleBinding. For more information, see Creating the Red Hat OpenShift Service Mesh members.
Procedure
- Log in to the OpenShift Container Platform CLI.
Create the YAML file for the
ServiceMeshMembermanifest. The manifest adds themy-applicationproject to the service mesh that was created by theServiceMeshControlPlaneresource deployed in theistio-systemnamespace:apiVersion: maistra.io/v1 kind: ServiceMeshMember metadata: name: default namespace: my-application spec: controlPlaneRef: namespace: istio-system name: basicApply the YAML file to create the
ServiceMeshMemberresource:$ oc apply -f <file-name>
Verification
Verify that the namespace is part of the mesh by running the following command. Confirm the that the value
Trueappears in theREADYcolumn.$ oc get smm default -n my-applicationExample output
NAME CONTROL PLANE READY AGE default istio-system/basic True 2m11sAlternatively, view the
ServiceMeshMemberRollresource to confirm that themy-applicationnamespace is displayed in thestatus.membersandstatus.configuredMembersfields of theServiceMeshMemberRollresource.$ oc describe smmr default -n istio-systemExample output
Name: default Namespace: istio-system Labels: <none> # ... Status: # ... Configured Members: default my-application # ... Members: default my-application