هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

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
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

Configuring a Scheduling Policy of a Component Instance

Updated on 2024-12-16 GMT+08:00

Kubernetes supports node affinity and pod affinity/anti-affinity. You can configure custom rules for affinity and anti-affinity scheduling. For example, you can deploy frontend pods and backend pods together, deploy the same type of applications onto specific nodes, or deploy applications onto different nodes.

Kubernetes affinity applies to nodes and pods.

  • Node affinity: Kubernetes can schedule workloads to affinity nodes based on their labels and label values. For example, some nodes support GPU computing, and node affinity scheduling can guarantee that high-performance computing pods run on these GPU nodes.
  • Workload affinity/anti-affinity: Kubernetes offers workload affinity and anti-affinity scheduling, which allows flexible scheduling of new workloads on either related or unrelated nodes. This results in improved cluster performance and utilization. For example, frontend pods and backend pods that frequently communicate with each other can be preferentially scheduled to the same node or AZ to minimize network latency.
    NOTE:

    Workload affinity and anti-affinity require time for computing, which significantly slows down scheduling in large-scale clusters. Do not enable workload affinity and anti-affinity in a cluster that contains hundreds of nodes.

You can Configuring an Affinity Scheduling Policy of a Node and Configuring an Affinity/Anti-affinity Scheduling Policy of a Workload for container-deployed component instances when configuring Advanced Settings.

Configuring an Affinity Scheduling Policy of a Node

  1. Choose Advanced Settings > Scheduling Policy.
  2. Select a type of the node affinity scheduling rule.

    • Mandatory: hard constraints that must be met. If multiple Mandatory rules are added, scheduling will be performed if one of the rules is met.
    • Best effort: soft constraints that are met as much as possible. If multiple Best effort rules are added, scheduling will be performed if one or none of the rules is met.

  3. Click Add.
  4. Select Node for Object Type.
  5. Add objects as required.

    • Add a policy: Click Add Policy and set the scheduling policy parameters by referring to the following table. You can customize a scheduling policy.
    • Specify a node: Click Specify Node to quickly select the node to be scheduled. You do not need to manually enter the node label and label value. The kubernetes.io/hostname label is used when you specify a node.
    • Specify an AZ: Click Specify AZ to quickly select the AZ to be scheduled. You do not need to manually enter the AZ label and label value. The failure-domain.beta.kubernetes.io/zone label is used when you specify an AZ.

    Parameter

    Description

    Weight

    This parameter is mandatory when the policy type selected in 2 is Best effort.

    During scheduling, the scheduler adds the weight to the scores of other priority functions and schedules pods to the node with the largest total score.

    The weight ranges from 1 to 100.

    Label Name

    When you click Add Policy to customize a scheduling policy, enter the node label to be matched.

    Operators

    • When you click Add Policy to customize a scheduling policy, set the following mapping relationships:
      • In: The label of the affinity object is in the label value list (values field).
      • NotIn: The label of the affinity object is not in the label value list (values field).
      • Exists: The affinity object has a specified label name.
      • DoesNotExist: The affinity object does not have a specified label name.
      • Gt: The label value of the scheduling node exceeds what is listed (character string comparison).
      • Lt: The label value of the scheduling node is under what is listed (character string comparison).
    • When configuring a Specify Node or Specify AZ scheduling policy, set the following matching relationships:
      • In: The label of the affinity object is in the label value list (values field).
      • NotIn: The label of the affinity object is not in the label value list (values field).

    Label Value

    When you click Add Policy to customize a scheduling policy, enter the label value corresponding to the label name of the node based on the selected operator.

    • If Operators is In or NotIn, enter characters for the label value. Separate multiple labels by semicolons (;). Example:
      str1;str2;str3
    • If Operators is Exists or DoesNotExist, the label value can be empty.
    • If Operators is Gt or Lt, enter an integer for the label value, for example, 5 or -5.

  6. Click OK.

Configuring an Affinity/Anti-affinity Scheduling Policy of a Workload

  1. Choose Advanced Settings > Scheduling Policy.
  2. Select a type of the workload affinity or anti-affinity scheduling rule by referring to the following table.

    Scheduling Policy

    Rule Type

    Description

    Affinity

    Mandatory

    Hard constraints that must be met.

    Filter pods that require affinity by label. If a pod that meets the filter criteria has been running on a node within the node range specified by the node label, the scheduler will forcibly schedule the created pod to this node range.

    NOTE:

    When multiple affinity policies are added, multiple labels are configured for filtering. A pod meets the filter criteria only when it has all the specified labels.

    Best effort

    Soft constraints that are met as much as possible.

    Filter pods that require affinity by label. If a pod that meets the filter criteria has been running on a node within the node range specified by the node label, the scheduler will preferentially schedule the created pod to this node range.

    NOTE:

    When multiple affinity policies are added, multiple labels are configured for filtering. A pod meets the filter criteria only when it has all the specified labels.

    Anti-affinity

    Mandatory

    Hard constraints that must be met.

    Filter one or more pods that require affinity by label. If a pod that meets the filter criteria has been running on a node within the node range specified by the node label, the scheduler will not schedule the created pod to this node range.

    NOTE:

    When multiple anti-affinity policies are added, multiple labels are configured for filtering. A pod meets the filter criteria if it has one of the specified labels.

    Best effort

    Soft constraints that are met as much as possible.

    Filter one or more pods that require affinity by label. If a pod that meets the filter criteria has been running on a node within the node range specified by the node label, the scheduler will preferentially schedule the created pod to other node range.

    NOTE:

    When multiple anti-affinity policies are added, multiple labels are configured for filtering. A pod meets the filter criteria if it has one of the specified labels.

  3. Click Add.
  4. Select Workload for Object Type.
  5. Add objects as required.

    • Click Add Policy to customize a scheduling policy. The scheduling policy is implemented based on node labels.
    • Click Specify Component, select the component to be scheduled, and click OK to quickly select the component to be scheduled. You do not need to manually enter the component label and label value.

      Parameter

      Description

      Weight

      This parameter is mandatory when the policy type selected in 2 is Best effort.

      During scheduling, the scheduler adds the weight to the scores of other priority functions and schedules pods to the node with the largest total score.

      The weight ranges from 1 to 100.

      Namespace

      Select the namespace to which the object belongs. This parameter specifies the namespace in which the scheduling policy takes effect.

      Label Name

      • When you click Add Policy to customize a scheduling policy, enter the workload label to be matched.
      • When you click Specify Component to set the scheduling policy for a specified component, you can use the default label or customize a label.

      Operators

      When you click Add Policy to customize a scheduling policy, set the matching relationship.

      • In: The label of the affinity or anti-affinity object is in the label value list (values field).
      • NotIn: The label of the affinity or anti-affinity object is not in the label value list (values field).
      • Exists: The affinity or anti-affinity object has a specified label name.
      • DoesNotExist: The affinity or anti-affinity object does not have a specified label name.

      Label Value

      Enter the label value corresponding to the workload label name based on the selected operator.

      • If Operators is In or NotIn, enter characters for the label value. Separate multiple labels by semicolons (;). Example:
        str1;str2;str3
      • If Operators is Exists or DoesNotExist, the label value can be empty.

  6. Click OK.

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