- Documentation
Volcengine Kubernetes Engine
Volcengine Container Instance
User guide
Container configuration
In-place restart of VCI pods
Container configuration
In-place restart of VCI pods
In-place restart of VCI pods
VCI supports the in-place restart of VCI pods based on the in-place upgrade feature of OpenKruise. This topic describes how to use OpenKruise to perform in-place upgrades for VCI pods.
Background information
OpenKruise is an extension suite based on Kubernetes, which mainly focuses on the automation of cloud-native applications, such as deployment, release, operation and maintenance, and availability protection. You can perform in-place upgrades for pods within workloads by deploying OpenKruise in VKE. For more details, see OpenKruise in-place upgrade. Usage instructions
- The in-place upgrade feature applies to container images and part of metadata, such as annotation and label.
tip
[Beta · Apply for Trial]: The feature to update metadata and restart VCI pods in place is currently at the beta stage. Submit an application if you need to use it. - The in-place upgrade feature applies to the following workloads:
Prerequisites
Procedure
Scenario 1: Updating container images
- Install OpenKruise in the VCI business cluster. The name of the application template for OpenKruise is Kruise. For details, see Application templates.
- Use kubectl to create a workload for OpenKruise and deploy it to VCI. The following vci-openkruise.yaml file serves as an example:
- Run the following command to create a workload for OpenKruise. In this example, a CloneSet is created.
- The command in this example is as follows:
- After you create the workload, view and record the pod name and VCI ID.
- Run the following command to obtain the pod name under CloneSet.
- The command in this example is as follows:
- Obtain the pod name from the NAME field in the returned information.
- Run the following command to view pod details and obtain the VCI ID.
- The command in this example is as follows:
- Obtain the VCI ID from the annotation vci.vke.volcengine.com/instance-id in the returned information.
- Modify the YAML file of the workload to verify the in-place pod restart capability. Replace the value of the image field with a container image of another version. The following sample code shows the YAML content.
- View the update status of the workload (CloneSet is used in this example) and wait for the pod restart to complete.
- The expected output is as follows, which indicates that the pod is restarted.
- Run the command described in Step 4 to view and record the pod name and VCI ID in the workload again.
- The pod will pull the image again, but the pod name and VCI ID will not change.
Scenario 2: Updating container metadata
tip
[Beta · Apply for Trial]: This feature is currently at the beta stage. Submit an application if you need to use it. - Install OpenKruise in the VCI business cluster. The name of the application template for OpenKruise is Kruise. For details, see Application templates.
tip
If Kruise has been installed, you do not need to install it again.
- Use kubectl to create a workload for OpenKruise and deploy it to VCI. The following vci-openkruise-demo.yaml file serves as an example:
- Run the following command to create a workload for OpenKruise. In this example, a CloneSet is created.
- The command in this example is as follows:
- After you create the workload, view and record the pod name and VCI ID.
- Run the following command to obtain the pod name under CloneSet.
- The command in this example is as follows:
- Obtain the pod name from the NAME field in the returned information.
- Run the following command to view pod details and obtain the VCI ID.
- The command in this example is as follows:
- Obtain the VCI ID from the annotation vci.vke.volcengine.com/instance-id in the returned information.
- Modify the YAML file of the workload to verify the in-place pod restart capability. Update annotation and label under the metadata of the container based on the following example.
- View the update status of the workload (CloneSet is used in this example) and wait for the pod restart to complete.
- The expected output is as follows, which indicates that the pod is restarted.
- Access the corresponding container to check whether the env information of the container has been updated.
- The label value of the container has changed, but the pod name and VCI ID will not change.
Last updated: 2026.08.19 17:58:30