Upgrade ECI Platform Version
When you upgrade a cluster, the system automatically checks the compatibility between ECI Platform Version and Kubernetes. For ECI-based pods whose ECI Platform Version is incompatible with the target Kubernetes version, you must manually delete and recreate the pods before you upgrade the Kubernetes version of the cluster. Before you upgrade a cluster, make sure that ECI Platform Version is compatible with the Kubernetes version.
Overview of ECI Platform Version
ECI Platform Version is the version number of a specific runtime environment of the Elastic Container Instance (ECI) infrastructure. Each ECI Platform Version identifies a different ECI runtime environment. A new revision of ECI Platform Version is released as the ECI runtime environment evolves, for example, when features are added, bugs are fixed, or patches are updated.
By default, an ECI-based pod that you create in your ACK cluster has an annotation with the key k8s.aliyun.com/eci-platform-version. The value is the version number of ECI Platform Version. The following example shows an annotation:
apiVersion: v1
kind: Pod
metadata:
annotations:
k8s.aliyun.com/eci-platform-version: 1.0.0
name: demo-76d8d9f9d8-l7pwm
namespace: default
...Kubernetes versions compatible with ECI Platform Version
As the following table shows, different ECI Platform Versions are compatible with different Kubernetes versions.
The ECI Platform Version of a newly created ECI-based pod is 1.1.0. The ECI Platform Version of an existing ECI-based pod is 1.0.0 or empty.
ECI Platform Version | Compatible Kubernetes versions |
1.1.0 | 1.12 and later |
1.0.0 | 1.12, 1.14, 1.16, 1.18, 1.20, 1.22, and 1.24 |
Empty (the | 1.12, 1.14, 1.16, 1.18, 1.20, 1.22, and 1.24 |
Upgrade ECI Platform Version
Connect to the cluster. For instructions, see Obtain the KubeConfig of a cluster and connect to the cluster by using kubectl.
Obtain the information about ECI-based pods whose ECI Platform Version is empty or 1.0.0.
The information includes the namespace, name, ECI Platform Version, and ECI instance ID of each ECI-based pod. The fields are separated by commas (,).
kubectl get pods -A -o json | jq -r '.items[] | select(.metadata.annotations["k8s.aliyun.com/eci-platform-version"] == "1.0.0" or .metadata.annotations["k8s.aliyun.com/eci-platform-version"] == null or .metadata.annotations["k8s.aliyun.com/eci-platform-version"] == "") | select(.spec.nodeName | startswith("virtual-kubelet")) | "\(.metadata.namespace),\(.metadata.name),\(.metadata.annotations["k8s.aliyun.com/eci-platform-version"] // ""),\(.metadata.annotations["k8s.aliyun.com/eci-instance-id"])"'The following example shows the output:
default,portal-server-57dfc4fdc8-2gl64,,eci-2zecdr8z5jy******Delete and recreate the target ECI-based pod.
The following example shows the command:
kubectl delete pod portal-server-57dfc4fdc8-2gl64 -n defaultThe following example shows the output:
pod "portal-server-57dfc4fdc8-2gl64" deletedAfter you delete and recreate the ECI-based pod, the ECI Platform Version of the new ECI-based pod is automatically upgraded to the updated version. You can run the following command to view the ECI Platform Version.
kubectl get pods -A -o json | jq -r '.items[] | select(.spec.nodeName | startswith("virtual-kubelet")) | "\(.metadata.namespace),\(.metadata.name),\(.metadata.annotations["k8s.aliyun.com/eci-platform-version"] // ""),\(.metadata.annotations["k8s.aliyun.com/eci-instance-id"] // "")"'