Updated on 2025-06-13 GMT+08:00

Pod Access to Metadata

It specifies whether to allow newly created pods in a cluster to access their node metadata, such as AZs and enterprise project ID. For details about the metadata types and how to obtain metadata, see ECS Metadata Types. This function is only available for clusters of v1.23.13-r0, v1.25.8-r0, v1.27.5-r0, v1.28.3-r0, or later versions.

  • If a pod is created after this function is enabled, its ability to access metadata depends on the function's status.
  • If a pod is created after this function is disabled, or in a cluster of an earlier version without this function, it cannot access metadata. To enable a pod to access metadata, it must be rebuilt while the function is enabled.

Value Range

Enable/Disable

Default Value

Disabled

Modifiable

Yes

Scope

CCE Turbo clusters

Example

  1. Enable Pod Access to Metadata. After this function is enabled, the newly created pods in the cluster can access their node metadata.

    1. Log in to the CCE console and click the name of a CCE Turbo cluster to access the cluster console.
    2. In the navigation pane, choose Settings. In the right pane, click the Network tab and enable Pod Access to Metadata.
    3. Click Confirm Settings.

  2. Create a workload. For details about how to create a workload, see Creating a Deployment.
  3. Check whether the node metadata can be accessed by the workload pod.

    1. Log in to the pod. For details about how to log in to a pod, see Logging In to a Container.
    2. Obtain the metadata of the node where the pod is located. For details, see ECS Metadata Types.
      curl http://169.254.169.254/openstack/latest/meta_data.json

      169.254.169.254 is the reserved IP address of the metadata. There is no need to change it.

      Information similar to the following is displayed:

      {"uuid":"xxx","meta":{"My Server Name":"xxx","agency_name":"","bootstrap-token":"","cascaded.instance_extrainfo":"pcibridge:1,virtio_bus_count:8","charging_mode":"0",...