Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating an MCS Object

Updated on 2025-01-24 GMT+08:00

Constraints

  • MCS is only available in clusters v1.21 or later.
  • A Service, with both MCI and MCS configured, can only be delivered to the cluster where the Service is deployed, the cluster that accesses the Service, and the cluster where the corresponding workload is deployed in MCS.

Preparations

  • Deploying Workloads and Services

    Deploy available workloads (Deployments) and Services on the federation control plane. If no workload or Service is available, create one by referring to Deployments and ClusterIP.

  • Configuring the Multi-Cluster Networking

    Check and configure the network connectivity of both inter-cluster nodes and containers by referring to Configuring the Multi-Cluster Networking.

NOTE:

If the error message "policy doesn't allow 'get loadbalancer' to be performed." or "because no identity-based policy allows the xxx action." is displayed during MCS instance creation, the agency permissions do not take effect. Wait for a while and try again. If it is displayed in the Events window, ignore it.

Creating an MCS Object Using YAML on the Console

  1. Log in to the UCS console. In the navigation pane, choose Fleets.
  2. On the Fleets tab, click the name of the federation-enabled fleet to access the fleet console.
  3. In the navigation pane, choose Services and Ingresses. Then, click the MCS tab.
  4. Click Create from YAML in the upper right corner.
  5. Select YAML for Current Data and edit the configuration in the editing area. (Configure the parameters as needed.)

    apiVersion: networking.karmada.io/v1alpha1
    kind: MultiClusterService
    metadata:
      name: mcs-24132      # MCS object name
      namespace: default      # Name of the namespace where the MCS object is located
    spec:
      types:
        - CrossCluster     # Inter-cluster service discovery
      providerClusters:
        - name: cluster-25043    # The cluster that this Service will be deployed in
      consumerClusters:
        - name: cluster-29544    # The cluster that will access this Service

  6. Click OK.

Creating an MCS Object Using kubectl

  1. Use kubectl to connect to the federation. For details, see Using kubectl to Connect to a Federation.
  2. Create and edit the mcs.yaml file. For details about the parameters in this file, see Table 1.

    vi mcs.yaml

    In the example, the defined MCS object is associated with Service foo. This Service is deployed in cluster B and can be accessed from cluster A.

    apiVersion: networking.karmada.io/v1alpha1 
    kind: MultiClusterService 
    metadata: 
       name: foo                          # MCS object name
       namespace: default                  # Name of the namespace where the MCS object is located
    spec: 
       types: 
         - CrossCluster                   # Inter-cluster service discovery
       providerClusters:                  # Cluster that the Service is delivered to
         - name: clusterB
       consumerClusters:                  # Cluster that accesses the Service
         - name: clusterA
    Table 1 Key parameters

    Parameter

    Mandatory

    Type

    Description

    metadata.name

    Yes

    String

    Name of the MCS object, which must be the same as that of the associated Service.

    metadata.namespace

    No

    String

    Name of the namespace where the MCS object is located, which must be the same as that of the namespace where the associated Service is located. If this parameter is left blank, default is used.

    spec.types

    Yes

    String

    Traffic direction. To enable service discovery across clusters, set this parameter to CrossCluster.

    spec.providerClusters.name

    No

    String

    Name of the cluster that the Service is delivered to. Set this parameter to the cluster where the Service is deployed. If this parameter is left blank, the Service is delivered to all clusters in the federation by default.

    CAUTION:

    If a Service is deployed in cluster B but cluster A and cluster B are both configured as the delivery targets, the Service is delivered to both clusters. The original Service with the same name in cluster A will be overwritten.

    spec.consumerClusters.name

    No

    String

    Name of the cluster that accesses the Service. Set this parameter to the name of the cluster that is expected to access the Service across clusters through MCS. If this parameter is left blank, all clusters in the federation can access the Service by default.

  3. Create an MCS object.

    kubectl apply -f mcs.yaml

  4. Check the status of the MCS object (named foo).

    kubectl describe mcs foo

    The status field in the YAML file records the MCS object status. If the following information is displayed, the endpoint slices are successfully delivered and synchronized, and cross-cluster service discovery is available:

    status: 
      conditions: 
      - lastTransitionTime: "2023-11-20T02:30:49Z"  
      message: EndpointSlices are propagated to target clusters. 
        reason: EndpointSliceAppliedSuccess 
        status: "True"  
      type: EndpointSliceApplied
    Run the following commands to operate the MCS object (named foo):
    • kubectl get mcs foo: obtains the MCS object.
    • kubectl edit mcs foo: updates the MCS object.
    • kubectl delete mcs foo: deletes the MCS object.

Cross-Cluster Access

After the MCS object is created, you can access the Service from the cluster specified by consumerClusters.name.

In the cluster specified by consumerClusters.name, create a pod, access the container, and run the curl http://Service name:Port number command to access the Service.

If the following information is displayed, the access is successful:

/ # curl http://Service name:Port number
... 
<h1>Welcome to foo!</h1> 
...

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback