When you upgrade a Container Service for Kubernetes (ACK) cluster, the system automatically checks the compatibility between the Elastic Container Instance platform version and the Kubernetes version of the cluster. If the Elastic Container Instance platform version is incompatible with the Kubernetes version, you must manually delete and recreate Elastic Container Instance-based pods before you can upgrade the Kubernetes version of the cluster. Before you upgrade an ACK cluster, make sure that the Elastic Container Instance platform version is compatible with the Kubernetes version of the cluster. This topic describes the compatibility between Elastic Container Instance platform versions and Kubernetes versions. This topic also describes how to upgrade the Elastic Container Instance platform version.
Introduction to the Elastic Container Instance platform version
The Elastic Container Instance platform version refers to the version of the runtime environment in which elastic container instances run. New Elastic Container Instance platform versions are released to add new features, fix bugs, or install patches.
The configuration of an Elastic Container Instance-based pod created in an ACK Serverless cluster contains the k8s.aliyun.com/eci-platform-version annotation by default. The value of the annotation indicates the version of the Elastic Container Instance platform on which the pod runs. Example:
---
apiVersion: v1
kind: Pod
metadata:
annotations:
k8s.aliyun.com/eci-platform-version: 1.0.0
name: demo-76d8d9f9d8-l7pwm
namespace: default
...Compatibility between Elastic Container Instance platform versions and Kubernetes versions
The following table describes the Kubernetes versions that are compatible with different Elastic Container Instance platform versions.
The Elastic Container Instance platform version of newly created Elastic Container Instance-based pods is 1.1.0. The Elastic Container Instance platform version of existing Elastic Container Instance-based pods is 1.0.0 or unavailable.
Elastic Container Instance Platform version | Compatible Kubernetes version |
1.1.0 | 1.12, 1.14, 1.16, 1.18, 1.20, 1.22, 1.24, 1.26, 1.28, 1.30, and 1.31 (canary release) |
1.0.0 | 1.12, 1.14, 1.16, 1.18, 1.20, 1.22, and 1.24 |
Unavailable (The | 1.12, 1.14, 1.16, 1.18, 1.20, 1.22, and 1.24 |
Upgrade the Elastic Container Instance platform version
Connect to the cluster. For more information, see Obtain the kubeconfig file of a cluster and use kubectl to connect to the cluster.
Query the information about the Elastic Container Instance-based pods whose Elastic Container Instance platform versions are 1.0.0 or empty strings.
The information includes the namespace, pod name, Elastic Container Instance platform version, and elastic container instance ID. The information is displayed in a format 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"])"'Expected output:
default,portal-server-57dfc4fdc8-2gl64,,eci-2zecdr8z5jy******Run the following command to delete and recreate the pod that is returned in the previous step.
kubectl delete pod portal-server-57dfc4fdc8-2gl64 -n defaultExpected output:
pod "portal-server-57dfc4fdc8-2gl64" deletedThe recreated pod uses the latest Elastic Container Instance platform version. Run the following command to query the Elastic Container Instance platform version of the recreated pod:
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"] // "")"'