1.10.5.2. Adding a project to the mesh using label selectors with the CLI


You can use label selectors to add a project to the Service Mesh with the CLI.

Prerequisites

  • You have installed the Red Hat OpenShift Service Mesh Operator.
  • The deployment has an existing ServiceMeshMemberRoll resource.
  • You are logged in to OpenShift Container Platform as`cluster-admin`.

Procedure

  1. Log in to the OpenShift Container Platform CLI.
  2. Edit the ServiceMeshMemberRoll resource.

    $ oc edit smmr default -n istio-system

    You can deploy the Service Mesh control plane to any project provided that it is separate from the project that contains your services.

  3. Modify the YAML file to include namespace label selectors in the spec.memberSelectors field of the ServiceMeshMemberRoll resource.

    참고

    Instead of using the matchLabels field, you can also use the matchExpressions field in the selector.

    apiVersion: maistra.io/v1
    kind: ServiceMeshMemberRoll
    metadata:
      name: default
      namespace: istio-system
    spec:
      memberSelectors: 
    1
    
      - matchLabels: 
    2
    
          mykey: myvalue 
    3
    
      - matchLabels: 
    4
    
          myotherkey: myothervalue 
    5
    1
    Contains the label selectors used to identify which project namespaces are included in the service mesh. If a project namespace has either label specified by the selectors, then the project namespace is included in the service mesh. The project namespace does not need both labels to be included.
    2 3
    Specifies all namespaces with the mykey=myvalue label. When the selector identifies a match, the project namespace is added to the service mesh.
    4 5
    Specifies all namespaces with the myotherkey=myothervalue label. When the selector identifies a match, the project namespace is added to the service mesh.
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 문서 정보

Legal Notice

Theme

© 2026 Red Hat
맨 위로 이동