VPC-ENI Specified Subnet IP Allocation (Container Network v2)

CCE CCE

  • Function Release Records
  • Common Tools
    • Command Line Scenario Examples
  • API Reference
    • Overview
    • Common Headers and Error Responses
    • General Description
  • Product Announcement
    • Announcement on the Discontinuation of CCE Standalone Clusters
    • CCE New Cluster Management Release Announcement
    • Upgrade Announcement for CCE Cluster Audit Component kube-external-auditor
    • CCE Console Upgrade Announcement
    • Announcement on Management Fees for CCE Managed Clusters
    • Container Runtime Version Release Notes
    • Announcement on the Decommissioning of CCE Image Repository
    • Kubernetes Version Release Notes
      • CCE Release of Kubernetes v1_26 History
      • CCE Kubernetes Version Update Notes
      • CCE Release of Kubernetes v1_24 History
      • CCE Release of Kubernetes v1_30 History
      • CCE Release of Kubernetes v1_22 History
      • CCE Release of Kubernetes v1_18 History
      • CCE Release of Kubernetes v1_20 History
      • CCE Release of Kubernetes v1_28 History
      • Release Notes for CCE Kubernetes 1_31 Version
      • Kubernetes Version Overview and Mechanism
    • Security Vulnerability Fix Announcement
      • Vulnerability CVE-2019-5736 Fix Announcement
      • Vulnerability CVE-2021-30465 Fix Announcement
      • CVE-2025-1097, CVE-2025-1098, and Other Vulnerabilities Fix Announcement
      • CVE-2020-14386 Vulnerability Fix Announcement
      • Impact Statement on runc Security Issue (CVE-2024-21626)
  • Service Level Agreement (SLA)
    • CCE Service Level Agreement SLA (V1_0)
  • Typical Practices
    • Pod Anomaly Troubleshooting
    • Adding CGroup V2 Node
    • Common Linux System Configuration Parameters Description
    • Encrypting etcd Data Using KMS
    • Configuring Container Network Parameters Using CNI
    • CCE - Public Network Access Practice
    • Practice of using private images in CCE clusters
    • Unified Access for Virtual Machines and Container Services via CCE Ingress
    • User Guide for Custom CNI Plugins
    • CCE Cluster Network Description and Planning
    • Cross-Cloud Application Migration to Baidu CCE Using Velero
    • CCE Resource Recommender User Documentation
    • Continuous Deployment with Jenkins in CCE Cluster
    • CCE Best Practice-Guestbook Setup
    • CCE Best Practice-Container Network Mode Selection
    • CCE Usage Checklist
    • VPC-ENI Mode Cluster Public Network Access Practice
    • CCE Container Runtime Selection
    • Cloud-native AI
      • Elastic and Fault-Tolerant Training Using CCE AITraining Operator
      • Deploy the TensorFlow Serving inference service
      • Best Practice for GPU Virtualization with Optimal Isolation
  • FAQs
    • How do business applications use load balancer
    • Using kubectl on Windows
    • Cluster management FAQs
    • Common Questions Overview
    • Auto scaling FAQs
    • Create a simple service via kubectl
  • Operation guide
    • Prerequisites for use
    • Identity and access management
    • Permission Management
      • Configure IAM Tag Permission Policy
      • Permission Overview
      • Configure IAM Custom Permission Policy
      • Configure Predefined RBAC Permission Policy
      • Configure IAM Predefined Permission Policy
      • Configure Cluster OIDC Authentication
    • Configuration Management
      • Configmap Management
      • Secret Management
    • Traffic access
      • BLB ingress annotation description
      • Use K8S_Service via CCE
      • Use K8S_Ingress via CCE
      • Implement Canary Release with CCE Based on Nginx-Ingress
      • Create CCE_Ingress via YAML
      • LoadBalancer Service Annotation Description
      • Service Reuses Existing Load Balancer BLB
      • Use Direct Pod Mode LoadBalancer Service
      • NGINX Ingress Configuration Reference
      • Create LoadBalancer_Service via YAML
      • Use NGINX Ingress
    • Virtual Node
      • Configuring BCIPod
      • Configuring bci-profile
      • Managing virtual nodes
    • Node management
      • Add a node
      • Managing Taints
      • Setting Node Blocking
      • Setting GPU Memory Sharing
      • Remove a node
      • Customizing Kubelet Parameters
      • Kubelet Container Monitor Read-Only Port Risk Warning
      • Managing Node Tag
      • Drain node
    • Component Management
      • CCE CSI CDS Plugin Description
      • CCE Fluid Description
      • CCE CSI PFS L2 Plugin
      • CCE Calico Felix Description
      • CCE Ingress Controller Description
      • CCE QoS Agent Description
      • CCE GPU Manager Description
      • CCE Ingress NGINX Controller Description
      • CCE P2P Accelerator Description
      • CCE Virtual Kubelet Component
      • CoreDNS Description
      • CCE Log Operator Description
      • CCE Node Remedier Description
      • CCE Descheduler Description
      • CCE Dynamic Scheduling Plugin Description
      • Kube Scheduler Documentation
      • CCE NPU Manager Description
      • CCE CronHPA Controller Description
      • CCE LB Controller Description
      • Kube ApiServer Description
      • CCE Backup Controller Description
      • CCE Network Plugin Description
      • CCE CSI PFS Plugin Description
      • CCE Credential Controller Description
      • CCE Deep Learning Frameworks Operator Description
      • Component Overview
      • CCE Image Accelerate Description
      • CCE CSI BOS Plugin Description
      • CCE Onepilot Description
      • Description of Kube Controller Manager
      • CCE_Hybrid_Manager Description
      • CCE NodeLocal DNSCache Description
      • CCE Node Problem Detector Description
      • CCE Ascend Mindx DL Description
      • CCE RDMA Device Plugin Description
      • CCE AI Job Scheduler Description
    • Image registry
      • Image Registry Basic Operations
      • Using Container Image to Build Services
    • Helm Management
      • Helm Template
      • Helm Instance
    • Cluster management
      • Upgrade Cluster Kubernetes Version
      • CCE Node CDS Dilatation
      • Managed Cluster Usage Instructions
      • Create cluster
      • CCE Supports GPUSharing Cluster
      • View Cluster
      • Connect to Cluster via kubectl
      • CCE Security Group
      • CCE Node Resource Reservation Instructions
      • Operate Cluster
      • Cluster Snapshot
    • Serverless Cluster
      • Product overview
      • Using Service in Serverless Cluster
      • Creating a Serverless Cluster
    • Storage Management
      • Using Cloud File System
      • Overview
      • Using Parallel File System PFS
      • Using RapidFS
      • Using Object Storage BOS
      • Using Parallel File System PFS L2
      • Using Local Storage
      • Using Cloud Disk CDS
    • Inspection and Diagnosis
      • Cluster Inspection
      • GPU Runtime Environment Check
      • Fault Diagnosis
    • Cloud-native AI
      • Cloud-Native AI Overview
      • AI Monitoring Dashboard
        • Connecting to a Prometheus Instance and Starting a Job
        • NVIDIA Chip Resource Observation
          • AI Job Scheduler component
          • GPU node resources
          • GPU workload resources
          • GPUManager component
          • GPU resource pool overview
        • Ascend Chip Resource Observation
          • Ascend resource pool overview
          • Ascend node resource
          • Ascend workload resource
      • Task Management
        • View Task Information
        • Create TensorFlow Task
        • Example of RDMA Distributed Training Based on NCCL
        • Create PaddlePaddle Task
        • Create AI Training Task
        • Delete task
        • Create PyTorch Task
        • Create Mxnet Task
      • Queue Management
        • Modify Queue
        • Create Queue
        • Usage Instructions for Logical Queues and Physical Queues
        • Queue deletion
      • Dataset Management
        • Create Dataset
        • Delete dataset
        • View Dataset
        • Operate Dataset
      • AI Acceleration Kit
        • AIAK Introduction
        • Using AIAK-Training PyTorch Edition
        • Deploying Distributed Training Tasks Using AIAK-Training
        • Accelerating Inference Business Using AIAK-Inference
      • GPU Virtualization
        • GPU Exclusive and Shared Usage Instructions
        • Image Build Precautions in Shared GPU Scenarios
        • Instructions for Multi-GPU Usage in Single-GPU Containers
        • GPU Virtualization Adaptation Table
        • GPU Online and Offline Mixed Usage Instructions
        • MPS Best Practices & Precautions
        • Precautions for Disabling Node Video Memory Sharing
    • Elastic Scaling
      • Container Timing Horizontal Scaling (CronHPA)
      • Container Horizontal Scaling (HPA)
      • Implementing Second-Level Elastic Scaling with cce-autoscaling-placeholder
      • CCE Cluster Node Auto-Scaling
    • Network Management
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC-ENI Mode)
      • Container Access to External Services in CCE Clusters
      • CCE supports dual-stack networks of IPv4 and IPv6
      • Using NetworkPolicy Network Policy
      • Traffic Forwarding Configuration for Containers in Peering Connections Scenarios
      • CCE IP Masquerade Agent User Guide
      • Creating VPC-ENI Mode Cluster
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC Network Mode)
      • Using NetworkPolicy in CCE Clusters
      • Network Orchestration
        • Container Network QoS Management
        • VPC-ENI Specified Subnet IP Allocation (Container Network v2)
        • Cluster Pod Subnet Topology Distribution (Container Network v2)
      • Network Connectivity
        • Container network accesses the public network via NAT gateway
      • Network Maintenance
        • Common Error Code Table for CCE Container Network
      • DNS
        • CoreDNS Component Manual Dilatation Guide
        • DNS Troubleshooting Guide
        • DNS Principle Overview
    • Namespace Management
      • Set Limit Range
      • Set Resource Quota
      • Basic Namespace Operations
    • Workload
      • CronJob Management
      • Set Workload Auto-Scaling
      • Deployment Management
      • Job Management
      • View the Pod
      • StatefulSet Management
      • Password-Free Pull of Container Image
      • Create Workload Using Private Image
      • DaemonSet Management
    • Monitor Logs
      • Monitor Cluster with Prometheus
      • CCE Event Center
      • Cluster Service Profiling
      • CCE Cluster Anomaly Event Alerts
      • Java Application Monitor
      • Cluster Audit Dashboard
      • Logging
      • Cluster Audit
      • Log Center
        • Configure Collection Rules Using CRD
        • View Cluster Control Plane Logs
        • View Business Logs
        • Log Overview
        • Configure Collection Rules in Cloud Container Engine Console
    • Application management
      • Overview
      • Secret
      • Configuration dictionary
      • Deployment
      • Service
      • Pod
    • NodeGroup Management
      • NodeGroup Management
      • NodeGroup Node Fault Detection and Self-Healing
      • Configuring Scaling Policies
      • NodeGroup Introduction
      • Adding Existing External Nodes
      • Custom NodeGroup Kubelet Configuration
      • Adding Alternative Models
      • Dilatation NodeGroup
    • Backup Center
      • Restore Management
      • Backup Overview
      • Backup Management
      • Backup repository
  • Quick Start
    • Quick Deployment of Nginx Application
    • CCE Container Engine Usage Process Overview
  • Product pricing
    • Product pricing
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
    • Features
    • Advantages
    • Core concepts
  • Solution-Fabric
    • Fabric Solution
  • Development Guide
    • EFK Log Collection System Deployment Guide
    • Using Network Policy in CCE Cluster
    • Creating a LoadBalancer-Type Service
    • Prometheus Monitoring System Deployment Guide
    • kubectl Management Configuration
  • API_V2 Reference
    • Overview
    • Common Headers and Error Responses
    • Cluster Related Interfaces
    • Instance Related Interfaces
    • Service domain
    • General Description
    • Kubeconfig Related Interfaces
    • RBAC Related Interfaces
    • Autoscaler Related Interfaces
    • Network Related Interfaces
    • InstanceGroup Related Interfaces
    • Appendix
    • Component management-related APIs
    • Package adaptation-related APIs
    • Task Related Interfaces
  • Solution-Xchain
    • Hyperchain Solution
  • SDK
    • Go-SDK
      • Overview
      • NodeGroup Management
      • Initialization
      • Install the SDK Package
      • Cluster management
      • Node management
All documents
menu
No results found, please re-enter

CCE CCE

  • Function Release Records
  • Common Tools
    • Command Line Scenario Examples
  • API Reference
    • Overview
    • Common Headers and Error Responses
    • General Description
  • Product Announcement
    • Announcement on the Discontinuation of CCE Standalone Clusters
    • CCE New Cluster Management Release Announcement
    • Upgrade Announcement for CCE Cluster Audit Component kube-external-auditor
    • CCE Console Upgrade Announcement
    • Announcement on Management Fees for CCE Managed Clusters
    • Container Runtime Version Release Notes
    • Announcement on the Decommissioning of CCE Image Repository
    • Kubernetes Version Release Notes
      • CCE Release of Kubernetes v1_26 History
      • CCE Kubernetes Version Update Notes
      • CCE Release of Kubernetes v1_24 History
      • CCE Release of Kubernetes v1_30 History
      • CCE Release of Kubernetes v1_22 History
      • CCE Release of Kubernetes v1_18 History
      • CCE Release of Kubernetes v1_20 History
      • CCE Release of Kubernetes v1_28 History
      • Release Notes for CCE Kubernetes 1_31 Version
      • Kubernetes Version Overview and Mechanism
    • Security Vulnerability Fix Announcement
      • Vulnerability CVE-2019-5736 Fix Announcement
      • Vulnerability CVE-2021-30465 Fix Announcement
      • CVE-2025-1097, CVE-2025-1098, and Other Vulnerabilities Fix Announcement
      • CVE-2020-14386 Vulnerability Fix Announcement
      • Impact Statement on runc Security Issue (CVE-2024-21626)
  • Service Level Agreement (SLA)
    • CCE Service Level Agreement SLA (V1_0)
  • Typical Practices
    • Pod Anomaly Troubleshooting
    • Adding CGroup V2 Node
    • Common Linux System Configuration Parameters Description
    • Encrypting etcd Data Using KMS
    • Configuring Container Network Parameters Using CNI
    • CCE - Public Network Access Practice
    • Practice of using private images in CCE clusters
    • Unified Access for Virtual Machines and Container Services via CCE Ingress
    • User Guide for Custom CNI Plugins
    • CCE Cluster Network Description and Planning
    • Cross-Cloud Application Migration to Baidu CCE Using Velero
    • CCE Resource Recommender User Documentation
    • Continuous Deployment with Jenkins in CCE Cluster
    • CCE Best Practice-Guestbook Setup
    • CCE Best Practice-Container Network Mode Selection
    • CCE Usage Checklist
    • VPC-ENI Mode Cluster Public Network Access Practice
    • CCE Container Runtime Selection
    • Cloud-native AI
      • Elastic and Fault-Tolerant Training Using CCE AITraining Operator
      • Deploy the TensorFlow Serving inference service
      • Best Practice for GPU Virtualization with Optimal Isolation
  • FAQs
    • How do business applications use load balancer
    • Using kubectl on Windows
    • Cluster management FAQs
    • Common Questions Overview
    • Auto scaling FAQs
    • Create a simple service via kubectl
  • Operation guide
    • Prerequisites for use
    • Identity and access management
    • Permission Management
      • Configure IAM Tag Permission Policy
      • Permission Overview
      • Configure IAM Custom Permission Policy
      • Configure Predefined RBAC Permission Policy
      • Configure IAM Predefined Permission Policy
      • Configure Cluster OIDC Authentication
    • Configuration Management
      • Configmap Management
      • Secret Management
    • Traffic access
      • BLB ingress annotation description
      • Use K8S_Service via CCE
      • Use K8S_Ingress via CCE
      • Implement Canary Release with CCE Based on Nginx-Ingress
      • Create CCE_Ingress via YAML
      • LoadBalancer Service Annotation Description
      • Service Reuses Existing Load Balancer BLB
      • Use Direct Pod Mode LoadBalancer Service
      • NGINX Ingress Configuration Reference
      • Create LoadBalancer_Service via YAML
      • Use NGINX Ingress
    • Virtual Node
      • Configuring BCIPod
      • Configuring bci-profile
      • Managing virtual nodes
    • Node management
      • Add a node
      • Managing Taints
      • Setting Node Blocking
      • Setting GPU Memory Sharing
      • Remove a node
      • Customizing Kubelet Parameters
      • Kubelet Container Monitor Read-Only Port Risk Warning
      • Managing Node Tag
      • Drain node
    • Component Management
      • CCE CSI CDS Plugin Description
      • CCE Fluid Description
      • CCE CSI PFS L2 Plugin
      • CCE Calico Felix Description
      • CCE Ingress Controller Description
      • CCE QoS Agent Description
      • CCE GPU Manager Description
      • CCE Ingress NGINX Controller Description
      • CCE P2P Accelerator Description
      • CCE Virtual Kubelet Component
      • CoreDNS Description
      • CCE Log Operator Description
      • CCE Node Remedier Description
      • CCE Descheduler Description
      • CCE Dynamic Scheduling Plugin Description
      • Kube Scheduler Documentation
      • CCE NPU Manager Description
      • CCE CronHPA Controller Description
      • CCE LB Controller Description
      • Kube ApiServer Description
      • CCE Backup Controller Description
      • CCE Network Plugin Description
      • CCE CSI PFS Plugin Description
      • CCE Credential Controller Description
      • CCE Deep Learning Frameworks Operator Description
      • Component Overview
      • CCE Image Accelerate Description
      • CCE CSI BOS Plugin Description
      • CCE Onepilot Description
      • Description of Kube Controller Manager
      • CCE_Hybrid_Manager Description
      • CCE NodeLocal DNSCache Description
      • CCE Node Problem Detector Description
      • CCE Ascend Mindx DL Description
      • CCE RDMA Device Plugin Description
      • CCE AI Job Scheduler Description
    • Image registry
      • Image Registry Basic Operations
      • Using Container Image to Build Services
    • Helm Management
      • Helm Template
      • Helm Instance
    • Cluster management
      • Upgrade Cluster Kubernetes Version
      • CCE Node CDS Dilatation
      • Managed Cluster Usage Instructions
      • Create cluster
      • CCE Supports GPUSharing Cluster
      • View Cluster
      • Connect to Cluster via kubectl
      • CCE Security Group
      • CCE Node Resource Reservation Instructions
      • Operate Cluster
      • Cluster Snapshot
    • Serverless Cluster
      • Product overview
      • Using Service in Serverless Cluster
      • Creating a Serverless Cluster
    • Storage Management
      • Using Cloud File System
      • Overview
      • Using Parallel File System PFS
      • Using RapidFS
      • Using Object Storage BOS
      • Using Parallel File System PFS L2
      • Using Local Storage
      • Using Cloud Disk CDS
    • Inspection and Diagnosis
      • Cluster Inspection
      • GPU Runtime Environment Check
      • Fault Diagnosis
    • Cloud-native AI
      • Cloud-Native AI Overview
      • AI Monitoring Dashboard
        • Connecting to a Prometheus Instance and Starting a Job
        • NVIDIA Chip Resource Observation
          • AI Job Scheduler component
          • GPU node resources
          • GPU workload resources
          • GPUManager component
          • GPU resource pool overview
        • Ascend Chip Resource Observation
          • Ascend resource pool overview
          • Ascend node resource
          • Ascend workload resource
      • Task Management
        • View Task Information
        • Create TensorFlow Task
        • Example of RDMA Distributed Training Based on NCCL
        • Create PaddlePaddle Task
        • Create AI Training Task
        • Delete task
        • Create PyTorch Task
        • Create Mxnet Task
      • Queue Management
        • Modify Queue
        • Create Queue
        • Usage Instructions for Logical Queues and Physical Queues
        • Queue deletion
      • Dataset Management
        • Create Dataset
        • Delete dataset
        • View Dataset
        • Operate Dataset
      • AI Acceleration Kit
        • AIAK Introduction
        • Using AIAK-Training PyTorch Edition
        • Deploying Distributed Training Tasks Using AIAK-Training
        • Accelerating Inference Business Using AIAK-Inference
      • GPU Virtualization
        • GPU Exclusive and Shared Usage Instructions
        • Image Build Precautions in Shared GPU Scenarios
        • Instructions for Multi-GPU Usage in Single-GPU Containers
        • GPU Virtualization Adaptation Table
        • GPU Online and Offline Mixed Usage Instructions
        • MPS Best Practices & Precautions
        • Precautions for Disabling Node Video Memory Sharing
    • Elastic Scaling
      • Container Timing Horizontal Scaling (CronHPA)
      • Container Horizontal Scaling (HPA)
      • Implementing Second-Level Elastic Scaling with cce-autoscaling-placeholder
      • CCE Cluster Node Auto-Scaling
    • Network Management
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC-ENI Mode)
      • Container Access to External Services in CCE Clusters
      • CCE supports dual-stack networks of IPv4 and IPv6
      • Using NetworkPolicy Network Policy
      • Traffic Forwarding Configuration for Containers in Peering Connections Scenarios
      • CCE IP Masquerade Agent User Guide
      • Creating VPC-ENI Mode Cluster
      • How to Continue Dilatation When Container Network Segment Space Is Exhausted (VPC Network Mode)
      • Using NetworkPolicy in CCE Clusters
      • Network Orchestration
        • Container Network QoS Management
        • VPC-ENI Specified Subnet IP Allocation (Container Network v2)
        • Cluster Pod Subnet Topology Distribution (Container Network v2)
      • Network Connectivity
        • Container network accesses the public network via NAT gateway
      • Network Maintenance
        • Common Error Code Table for CCE Container Network
      • DNS
        • CoreDNS Component Manual Dilatation Guide
        • DNS Troubleshooting Guide
        • DNS Principle Overview
    • Namespace Management
      • Set Limit Range
      • Set Resource Quota
      • Basic Namespace Operations
    • Workload
      • CronJob Management
      • Set Workload Auto-Scaling
      • Deployment Management
      • Job Management
      • View the Pod
      • StatefulSet Management
      • Password-Free Pull of Container Image
      • Create Workload Using Private Image
      • DaemonSet Management
    • Monitor Logs
      • Monitor Cluster with Prometheus
      • CCE Event Center
      • Cluster Service Profiling
      • CCE Cluster Anomaly Event Alerts
      • Java Application Monitor
      • Cluster Audit Dashboard
      • Logging
      • Cluster Audit
      • Log Center
        • Configure Collection Rules Using CRD
        • View Cluster Control Plane Logs
        • View Business Logs
        • Log Overview
        • Configure Collection Rules in Cloud Container Engine Console
    • Application management
      • Overview
      • Secret
      • Configuration dictionary
      • Deployment
      • Service
      • Pod
    • NodeGroup Management
      • NodeGroup Management
      • NodeGroup Node Fault Detection and Self-Healing
      • Configuring Scaling Policies
      • NodeGroup Introduction
      • Adding Existing External Nodes
      • Custom NodeGroup Kubelet Configuration
      • Adding Alternative Models
      • Dilatation NodeGroup
    • Backup Center
      • Restore Management
      • Backup Overview
      • Backup Management
      • Backup repository
  • Quick Start
    • Quick Deployment of Nginx Application
    • CCE Container Engine Usage Process Overview
  • Product pricing
    • Product pricing
  • Product Description
    • Application scenarios
    • Introduction
    • Usage restrictions
    • Features
    • Advantages
    • Core concepts
  • Solution-Fabric
    • Fabric Solution
  • Development Guide
    • EFK Log Collection System Deployment Guide
    • Using Network Policy in CCE Cluster
    • Creating a LoadBalancer-Type Service
    • Prometheus Monitoring System Deployment Guide
    • kubectl Management Configuration
  • API_V2 Reference
    • Overview
    • Common Headers and Error Responses
    • Cluster Related Interfaces
    • Instance Related Interfaces
    • Service domain
    • General Description
    • Kubeconfig Related Interfaces
    • RBAC Related Interfaces
    • Autoscaler Related Interfaces
    • Network Related Interfaces
    • InstanceGroup Related Interfaces
    • Appendix
    • Component management-related APIs
    • Package adaptation-related APIs
    • Task Related Interfaces
  • Solution-Xchain
    • Hyperchain Solution
  • SDK
    • Go-SDK
      • Overview
      • NodeGroup Management
      • Initialization
      • Install the SDK Package
      • Cluster management
      • Node management
  • Document center
  • arrow
  • CCECCE
  • arrow
  • Operation guide
  • arrow
  • Network Management
  • arrow
  • Network Orchestration
  • arrow
  • VPC-ENI Specified Subnet IP Allocation (Container Network v2)
Table of contents on this page
  • Overview
  • Requirement scenarios
  • Requirement scenario 1: Dynamic IP allocation for specified subnet
  • Scenario 2: Manual IP allocation
  • Scenario 3: Fixed IP
  • Solution overview
  • Introduction to key data structure
  • Pod Subnet Topology Spread (PodSubnetTopologySpread)
  • Usage restrictions
  • Configuration steps
  • Environment preparation
  • Create private subnet
  • Allocate IP for specified subnets in CCE
  • Scenario 1: Dynamic IP allocation for specified subnets
  • 1. Create psts
  • 2. Create workloads
  • 3. Verify IP allocation results
  • Scenario 2: Manual IP allocation
  • Applicable scenarios:
  • 1. Create psts
  • 2. Create workloads
  • 3. Verify IP allocation results
  • Scenario 3: Fixed IP
  • Applicable scenarios:
  • 1. Create psts
  • 2. Create workloads
  • 3. Verify IP allocation results
  • Related products

VPC-ENI Specified Subnet IP Allocation (Container Network v2)

Updated at:2025-10-27

Overview

The VPC-ENI container network mode supports assigning subnets for pod IP allocation. Users can use this feature to plan and allocate IP addresses from different subnets for pods serving various business uses.

Note: To enable this feature, please contact Baidu AI Cloud customer service to activate the allow list.

Requirement scenarios

Requirement scenario 1: Dynamic IP allocation for specified subnet

Dynamically assign IP to pods from the subnet associated with the subnet topology constraint policy matching with pod. All pods matching the subnet topology constraint policy (psts) will only be assigned IP addresses from subnets included in the policy.

Scenario 2: Manual IP allocation

The manual IP allocation policy involves providing an IP list for CCE to assign IPs to pods. After a pod is deleted, the IP address is retained. Before the IP address expires, the same IP address will be reused if the pod is recreated or migrated. By default, an IP address is retained for 7 days after a pod is deleted.

Scenario 3: Fixed IP

Fixed IP policy means providing an IP list from which CCE assigns IP to stateful workloads pods. After Pod deletion, the IP address is retained. The IP address remains unchanged after Pod reconstruction or migration. Regardless of whether the pod is deleted, the allocated IP address will not be released and only be reclaimed until the workload is deleted.

Solution overview

As demonstrated in the CRD data structure below, CCE provides a custom CRD to specify pod subnet topology spread policies for implementing subnet IP allocation in the K8S Cluster CCE.

Introduction to key data structure

Pod Subnet Topology Spread (PodSubnetTopologySpread)

The subnet topology spread object is the core working object for specifying IP allocation in subnets. Its core data structure is defined as follows:

Plain Text
1apiVersion: cce.baidubce.com/v2
2kind: PodSubnetTopologySpread
3metadata:
4  name: example-subnet-topology
5  namespace: default
6spec:
7# Topology Spread Object Name
8  name: example-subnet-topology
9# Among multiple subnet topology constraints, higher numerical values indicate higher priority. Default value: 0
10  priority: 0
11  subnets:
12#  must be a subnet ID in the same VPC as the current cluster, in the format of sbn-*, e.g., sbn-ccfud13pwcqf
13# When a dedicated subnet is used, users must confirm that the subnet is only used by the current K8S Cluster CCE.
14    sbn-ccfud13pwcqf: []
15  strategy:
16    releaseStrategy: TTL
17    ttl: 168h0m0s
18    type: Elastic
19# Select the pods to apply this subnet topology spread
20  selector:
21    matchLabels:
22      app: foo

The core fields of this object are as follows:

Domain Data type Required Default value Description
name string Topology spread object name is mandatory when subnet topology spread is created via PodSubnetTopologySpread.
priority int32 No 0 Among multiple subnet topology constraints, higher numerical values denote higher priorities.
selector object No Use this condition for tag-based pod matching. Eligible pods will apply this rule during IP address allocation. If the selector is empty, all pods within the same namespace will match this rule.
subnets object Yes Subnet specified by the policy. K8S Cluster CCE assigns IP addresses to pods from these subnets.
subnets.[].family string Yes IP address protocol family. The value can be "4" or "6"
subnets.[].range array Yes IP address range
subnets.[].range[].start string Yes Starting IP address
subnets.[].range[].end string Yes End IP address
strategy object Yes IP address use and reclaiming policies
strategy.type string Yes Elastic Elastic: Dynamically allocates IP addresses and any workload can be used; Fixed: Permanently fixed IP addresses, only used together with sts workload; PrimaryENI: Dedicated ENI-exclusive IP addresses
strategy.releaseStrategy string Yes TTL IP address release policy. TTL: The IP address expires over time after the pod is deleted. Under dynamic IP allocation mode, the IP is immediately reclaimed after pod deletion. When enableReuseIPAddress is enabled, the default reclaiming period is 7 days.
Never: Only used with strategy.type: Fixed used, indicating never reclaim.
strategy.enableReuseIPAddress bool No false Whether to enable IP reuse in the scenario of strategy.type: Elastic. If IP reuse is enabled, the system will attempt to reuse IP for repeatedly created pods with identical name before expiration, to achieve the effect similar to fixed IP.
strategy.ttl string No 168h0m0s When IP address reuse is enabled, this defines the retention period for the IP address after a pod has been deleted. The default retention period is 7 days (168h0m0s).

Usage restrictions

  1. This function requires the ENI cross-subnet IP allocation capability of VPC. Please submit a ticket to request activation for the ENI cross-subnet IP allocation feature.
  2. Pods in the kube-system namespace cannot use the designated subnet IP allocation function.
  3. When using ipRange function, ensure that the specified IP range excludes special addresses like IPv4 network, gateway, broadcast, and multicast addresses. Including these special addresses may cause problem with IP allocation.
  4. Pods in specified subnets can only be scheduled to nodes located in the same availability zone as the subnet. Please ensure that the AZ contains nodes in Ready status.
  5. In scenarios involving fixed IPs and IP reuse, only dedicated subnets (subnets exclusively reserved for a single K8S Cluster CCE) can be used. Dedicated subnets cannot be converted to general-purpose subnets or removed from the cluster. For details, please refer to the description of dedicated subnets.
  6. This function is applicable only to clusters using container network v2.

Dedicated subnet: When the user needs to assign several IPs under the specified subnet to pods, the subnet of the IP will automatically be marked as manual IP allocation mode. Subnets in manual IP allocation mode have the following characteristics:

  1. Dedicated subnets must be exclusive to the current K8S Cluster CCE. CCE automatically adds exclusive tags to subnets to prevent other K8S Cluster CCEs from using them. (However, users can operate other Baidu AI Cloud products to utilize such subnets.)
  2. Dedicated subnets only support manual IP allocation and do not allow automatic allocation. Users must manage IP address planning and assignments themselves.
  3. The relationship between IPs and pods in dedicated subnets supports two modes: priority allocation and fixed binding. The fixed binding policy uses the pod's name as the identifier, ensuring that pods with the same name always have the same IP address.
  4. The default subnet for cluster pod cannot be a dedicated subnet; otherwise, other pods in the cluster may fail to allocate IP normally
  5. It does not support converting dedicated subnets to regular subnets or deleting them from the cluster

Configuration steps

Environment preparation

Create private subnet

In the Baidu AI Cloud VPC Console -> Subnet tab, create a new subnet for your VPC and save the subnet ID (subnet IDs are named in the format sbn-xxx). Note: When creating a subnet, select an availability zone associated with the K8S Cluster CCE nodes; otherwise, scheduling may fail.

Description: To enable ENI cross-subnet IP allocation function, please submit a ticket request.

image

Allocate IP for specified subnets in CCE

Scenario 1: Dynamic IP allocation for specified subnets

Dynamically assign IP to pods from the subnet associated with the subnet topology constraint policy matching with pod. All pods matching the subnet topology constraint policy (psts) will only be assigned IP addresses from subnets included in the policy. Applicable scenarios:

  • Perform traffic statistics by subnet dimension
  • Implement security policies at the subnet dimension, such as ACL rule control
  • Enable Internet access for specific subnets via NAT (Network Address Translation)
1. Create psts
Plain Text
1apiVersion: cce.baidubce.com/v2
2# Pod topology spread table
3kind: PodSubnetTopologySpread
4metadata:
5  name: default
6  namespace: default
7spec:
8# Among multiple subnet topology constraints, the earlier the order is, the higher the priority will be.#
9  priority: 0
10  name: default-psts
11  strategy:
12    releaseStrategy: TTL
13    type: Elastic
14  subnets:
15#  must be a subnet ID in the same VPC as the current cluster, in the format of sbn-*, e.g., sbn-ccfud13pwcqf
16    sbn-ccfud13pwcqf: []
17    sbn-e8rk4zxn2ys6: []
18# Select the pods to use this subnet topology spread; if empty, all pods will use this subnet topology spread
19    selector:
20      matchLabels:
21        app: foo
2. Create workloads
Plain Text
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4  name: elastic-deploy
5  namespace: default
6spec:
7  replicas: 1
8  selector:
9    matchLabels:
10      app: foo
11  template:
12    metadata:
13      labels:
14        app: foo
15    spec:
16      containers:
17      - image: nginx
18        name: nginx
3. Verify IP allocation results
Plain Text
1# kubectl get pod {podName} -oyaml
2apiVersion: v1
3kind: Pod
4metadata:
5  annotations:
6    cce.baidubce.com/PodSubnetTopologySpread: example-subnet-topology
7  generateName: elastic-deploy-56dc49b486-
8  labels:
9    app: foo
10  name: elastic-deploy-56dc49b486-d6z7b
11  namespace: default
12spec:
13  affinity:
14    nodeAffinity:
15      requiredDuringSchedulingIgnoredDuringExecution:
16        nodeSelectorTerms:
17        - matchExpressions:
18          - key: topology.kubernetes.io/zone
19            operator: In
20            values:
21            - zoneF
22  containers:
23  - image: nginx
24    imagePullPolicy: IfNotPresent
25    name: nginx
26    resources:
27      limits:
28        cce.baidubce.com/ip: "1"
29      requests:
30        cce.baidubce.com/ip: "1"

Scenario 2: Manual IP allocation

The manual IP allocation policy involves providing an IP list for CCE to assign IPs to pods. After a pod is deleted, the IP address is retained. Before the IP address expires, the same IP address will be reused if the pod is recreated or migrated. By default, an IP address is retained for 7 days after a pod is deleted.

Applicable scenarios:
  • Fixed pod IP, requiring the IP to remain unchanged after Pod migration
  • Use dedicated subnets and fully manage the IP of the subnet manually
  • Pod names remain unchanged after multiple reconstruction, such as pods created by stateful workloads (apps/v1 StatefulSet)
1. Create psts
Plain Text
1apiVersion: cce.baidubce.com/v2
2kind: PodSubnetTopologySpread
3metadata:
4  name: example-subnet-topology
5  namespace: default
6spec:
7  priority: 0
8  subnets:
9    sbn-6mrkdcsyzpaw:
10# Optional. Fixed IP range; if left blank, it indicates that the default IP range of the subnet is used
11    - family: 4
12      range:
13      - start: 10.0.0.2
14        end: 10.0.0.254
15  strategy:
16    releaseStrategy: TTL
17    ttl: 168h0m0s
18    type: Elastic
19# Mandatory: Enable IP reuse
20    enableReuseIPAddress: true   
21  selector:
22    matchLabels:
23      workloadType: sts
24      fixedIP: "true"
25      app: fixedIPApp
2. Create workloads
Plain Text
1apiVersion: apps/v1
2# Stateful workloads must be used.
3kind: StatefulSet
4metadata:
5  name: foo
6  namespace: default
7spec:
8  replicas: 1
9  selector:
10    matchLabels:
11      app: fixedIPApp
12  serviceName: foo
13  template:
14    metadata:
15      labels:
16        workloadType: sts
17        fixedIP: "true"
18        app: fixedIPApp
19    spec:
20      containers:
21      - image: nginx
22        name: nginx
3. Verify IP allocation results
Plain Text
1# kubectl get pod {podName} -oyaml
2apiVersion: v1
3kind: Pod
4metadata:
5  annotations:
6    cce.baidubce.com/PodSubnetTopologySpread: example-subnet-topology
7  labels:
8    app: foo
9  name: foo-0
10  namespace: default
11spec:
12  affinity:
13    nodeAffinity:
14      requiredDuringSchedulingIgnoredDuringExecution:
15        nodeSelectorTerms:
16        - matchExpressions:
17          - key: topology.kubernetes.io/zone
18            operator: In
19            values:
20            - zoneF
21  containers:
22  - image: nginx
23    imagePullPolicy: IfNotPresent
24    name: nginx
25    resources:
26      limits:
27        cce.baidubce.com/ip: "1"
28      requests:
29        cce.baidubce.com/ip: "1"

Scenario 3: Fixed IP

Fixed IP policy means providing an IP list from which CCE assigns IP to stateful workloads pods. After Pod deletion, the IP address is retained. The IP address remains unchanged after Pod reconstruction or migration. Regardless of whether the pod is deleted, the allocated IP address will not be released and only be reclaimed until the workload is deleted.

Applicable scenarios:
  • The specified subnet must be exclusively used by a single K8S Cluster CCE and will no longer support dynamic IP allocation. CCE will mark this subnet as a dedicated one.
  • Implement security policies at the IP address level, such as configuring ACLs at the subnet level.
  • Only applicable to pods created by stateful workloads (apps/v1 StatefulSet).
1. Create psts
Plain Text
1apiVersion: cce.baidubce.com/v2
2kind: PodSubnetTopologySpread
3metadata:
4  name: example-subnet-topology
5  namespace: default
6spec:
7  subnets:
8    sbn-6mrkdcsyzpaw:
9# Optional. Fixed IP range; if left blank, it indicates that the default IP range of the subnet is used
10    - family: 4
11      range:
12      - start: 10.0.0.2
13        end: 10.0.0.254
14  strategy:
15    releaseStrategy: Never
16    type: Fixed
17    enableReuseIPAddress: true
18# Select the pods to apply this subnet topology spread
19  selector:
20    matchLabels:
21      app: foo
2. Create workloads
Plain Text
1apiVersion: apps/v1
2# Stateful workloads must be used.
3kind: StatefulSet
4metadata:
5  name: foo
6  namespace: default
7spec:
8  replicas: 1
9  selector:
10    matchLabels:
11      app: fixedIPApp
12  serviceName: foo
13  template:
14    metadata:
15      labels:
16        workloadType: sts
17        fixedIP: "true"
18        app: fixedIPApp
19    spec:
20      containers:
21      - image: nginx
22        name: nginx
3. Verify IP allocation results
Plain Text
1# kubectl get pod {podName} -oyaml
2apiVersion: v1
3kind: Pod
4metadata:
5  annotations:
6    cce.baidubce.com/PodSubnetTopologySpread: example-subnet-topology
7  labels:
8    app: foo
9  name: foo-0
10  namespace: default
11spec:
12  affinity:
13    nodeAffinity:
14      requiredDuringSchedulingIgnoredDuringExecution:
15        nodeSelectorTerms:
16        - matchExpressions:
17          - key: topology.kubernetes.io/zone
18            operator: In
19            values:
20            - zoneF
21  containers:
22  - image: nginx
23    imagePullPolicy: IfNotPresent
24    name: nginx
25    resources:
26      limits:
27        cce.baidubce.com/ip: "1"
28      requests:
29        cce.baidubce.com/ip: "1"

Related products

  • Virtual Private Cloud (VPC)

Previous
Container Network QoS Management
Next
Cluster Pod Subnet Topology Distribution (Container Network v2)