You can use the instance metadata service from within an ECS instance to retrieve its metadata, such as instance IDs, VPC information, and network interface information. By default, the instance metadata access mode for nodes in an ACK cluster supports both normal mode and enhanced mode. You can switch to only enhanced mode (IMDSv2) to improve the security of the instance metadata service.
After you enable enhanced mode, applications on the nodes can no longer use normal mode to access the ECS instance metadata service. For more information about ECS instance metadata access modes, see instance metadata.
Prerequisites
You have an ACK managed cluster or an ACK dedicated cluster that runs Kubernetes version 1.28 or later. To upgrade your cluster, see Manually upgrade a cluster.
If your cluster uses any of the components in the following tables, ensure both the components and the cluster meet the minimum version requirements.
If you have deployed applications in your cluster that depend on the instance metadata service, enforcing enhanced mode will cause requests that use normal mode to be rejected. Update your application code. For more information, see instance metadata.
Procedure
You can configure this feature only when you create a node pool or during the node pool configuration step of cluster creation. The instance metadata access mode cannot be changed after the node pool is created.
The following procedure uses the creation of a new node pool as an example. The key settings are the same for the cluster creation process.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, click the name of your cluster. In the left navigation pane, click .
Click Create a node pool.
This section describes only the key settings for this feature. For details about all settings, see Create and manage a node pool.
Operating system: Ensure that the operating system image supports enhanced mode and that the image version meets the requirements.
Public image
Operating system image
Minimum version
Alibaba Cloud Linux 3.2104 LTS 64-bit (Container-optimized)
20241226
Alibaba Cloud Linux 3.2104 LTS 64-bit
20241218
Alibaba Cloud Linux 4 LTS 64-bit (Container-optimized)
20251106
Ubuntu 22.04
20250722
ContainerOS 3.6
20250916
Custom image: The cloud-init version in the image must be 23.2.2 or later. To learn how to check and upgrade the cloud-init version, see Install cloud-init.
Instance Metadata Access Mode: Select Security Hardening Mode.