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

Volcengine Kubernetes Engine

Copy page
Download PDF
Creating an instance
Creating instances and configuring proxy cache repositories
Copy page
Download PDF
Creating instances and configuring proxy cache repositories
Volcengine Container Instance (VCI) allows you to configure mirror repositories for image repositories. When you pull images, the requested addresses are replaced with those of the mirror repositories.​
Background​
In user business scenarios, requirements exist for pulling images from overseas repositories or cross-cloud collaboration. VCI provides the mirror repository configuration feature by using the proxy cache capability of Volcano Engine CR. When you use a public overseas image, you can use this capability to directly pull the corresponding image without changing the image address. This meets cross-region business requirements.​
tip​
For details about the proxy cache capability of CR, see Proxy cache repositories.​
Feature description​
VCI allows you to configure a mirror repository by using an annotation. The annotation description is as follows:​
  • Annotation Key: vci.volcengine.com/registry-mirror-config​
  • Annotation value:​
  • The parameter value needs to be in JSON format.​
  • The JSON file format and parameter descriptions are as follows:​
  • ​
    {​
    "mirrors": { // The domain name configurations of the proxy cache repository.​
    "docker.io": ["address1.cr.volces.com", "address2.cr.volces.com"], // Map images in the docker.io remote registry to the specified CR proxy registry. Configure this parameter as needed. When you enter multiple domain names of proxy cache repositories, images are pulled from the proxy cache repositories in the listed order.​
    "hub.byted.org": ["address2.cr.volces.com"], // Map images in the hub.byted.org remote registry to the specified CR proxy registry. Configure this parameter as needed.​
    "*": ["default-address.cr.volces.com"] // Map all types of images to the specified CR proxy registry. Configure this parameter as needed.​
    },​
    "configs": {​
    "address1.cr.volces.com": { // Configure an access policy for the specified CR proxy registry.​
    "auth": {​
    "username": "xxx", // The username used to log in to the CR proxy registry instance.​
    "password": "yyy" // The Base64-encoded password used to log in to the CR proxy registry instance.​
    },​
    "tls": {​
    "insecure_skip_verify": true // Ignore certificate verification when you log in to the CR proxy registry instance. Configure this parameter as needed.​
    }​
    }​
    }​
    }​
    ​
Procedure​
The following content provides an example of how to create a general-purpose VCI. For detailed instructions, see Creating general-purpose instances by specifying container vCPUs and memory.​
Prerequisites​
  • A VPC and its subnet have been created. For details, see Creating VPCs.​
Sample code​
The following sample code shows how to create a VCI Deployment:​
tip​
For configuration instructions other than mirror image repository configuration, see Creating general-purpose instances by specifying container vCPUs and memory.​
​
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 a subnet. You can specify multiple subnets within the same availability zone. To do so, separate them with commas (,).​
vci.vke.volcengine.com/preferred-instance-family: vci.u1 # Specify the VCI instance family​
vci.volcengine.com/registry-mirror-config: |​
{​
"mirrors": {​
"docker.io": ["address1.cr.volces.com", "address2.cr.volces.com"], ​
"hub.byted.org": ["address2.cr.volces.com"],​
"*": ["default-address.cr.volces.com"]​
},​
"configs": {​
"address1.cr.volces.com": {​
"auth": {​
"username": "demo-user",​
"password": "*****************"​
},​
"tls": {​
"insecure_skip_verify": true​
}​
}​
}​
}​
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 the address of the image in your remote registry.​
ports:​
- containerPort: 80​
resources:​
requests: # Specify the vCPU and memory of the container​
cpu: "500m" ​
memory: "1024Mi"​
limits:​
cpu: "1" ​
memory: "2048Mi"​
​
​
Last updated: 2026.09.03 15:56:09