You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Networking
Creating instances by specifying subnets
Copy page
Download PDF
Creating instances by specifying subnets
VCI supports creating instances using the default subnet or a specified subnet. This topic describes the steps of creating a VCI based on a specified subnet.​
Background information​
If no subnet is specified, the system uses the default subnet, that is, the pod subnet specified during cluster creation.​
Usage limits​
  • The availability zone to which the subnet belongs must already have a virtual node.​
  • After the instance is created, its subnet cannot be changed.​
Prerequisites​
  • A VPC and its subnet have been created. For details, see Creating VPCs.​
Using the Kubernetes approach​
When creating a pod or workload (including Deployment, StatefulSet, Job, or CronJob), specify the subnet by adding an annotation.​
The annotation description is as follows.​
​
Annotation key​
Annotation sample value​
Description​
Required​
vke.volcengine.com/preferred-subnet-ids​
subnet-3tispp1nai****​
Specify a subnet.​
tip​
  • You can specify multiple subnets across multiple availability zones. Separate them with commas (,).​
  • If you specify multiple subnets, the system selects the subnet with the most available IP addresses to create the VCI.​
Required for this scenario​
​
The following sample code shows how to create a Deployment.​
​
apiVersion: apps/v1​
kind: Deployment​
metadata:​
name: nginx-deployment​
spec:​
replicas: 2​
selector:​
matchLabels:​
app: nginx​
template:​
metadata:​
annotations:​
vke.volcengine.com/burst-to-vci: enforce # Force the use of VCI.​
vke.volcengine.com/preferred-subnet-ids: subnet-3tispp1nai**** # Specify the ID of the subnet.​
labels:​
app: nginx​
spec:​
containers:​
- name: nginx​
image: doc-cn-beijing.cr.volces.com/vke/nginx-demo:v1.0 # The address and version of the container image. Replace the value with your actual information.​
ports:​
- containerPort: 80​
​
Using the console​
Similarly, specify the subnet by adding an annotation when creating a workload.​
The following figure shows how to create a stateless workload (Deployment). The procedure for creating other workloads is similar. For detailed steps of creating workloads, see Workloads.​
tip​
VCI does not support DaemonSets. For more information, see Limits.​
Querying the subnet of an instance​
Obtain the ID of the subnet used by the VCI by using the pod annotation.​
​
Annotation key​
Annotation sample value​
Description​
vke.volcengine.com/used-subnet-id​
subnet-128fhnvjjgg****​
The ID of the subnet to which the instance belongs.​
​
​alt​​
​
Last updated: 2026.08.19 17:56:58