You need to enable JavaScript to run this app.
Volcengine Kubernetes Engine

Volcengine Kubernetes Engine

Copy page
Download PDF
Instance metadata
Querying instance metadata
Copy page
Download PDF
Querying instance metadata
Instance metadata provides basic VCI information, such as the instance hostname, instance ID, instance specifications, region, and availability zone. This topic describes how to query instance metadata.​
Usage notes​
Metadata of an instance can be accessed only from within the instance. The metadata is not encrypted or protected, and anyone who can access the instance can query its metadata. If the metadata contains sensitive information, you should take appropriate measures to protect the sensitive data, such as limiting the scope of access and encrypting the metadata.​
Prerequisites​
The VCI has been created. For details, see Creating instances.​
Querying instance metadata​
Access method description​
You can query instance metadata by using the cURL tool or an HTTP GET request. The query format is http://100.96.0.96/latest/${metadata}.​
tip​
  • Replace ${metadata} with a specific instance metadata item. For example, to query metadata item instance_id, use http://100.96.0.96/latest/instance_id.​
Step 1: Log in to the instance​
To perform instance metadata operations, you must first log in to the target instance. This topic describes how to log in to a VCI by using a Deployment as an example.​
  1. Go to the management page of the Deployment.​
  1. Log in to the VKE console.​
  1. In the left navigation bar, click Cluster.​
  1. In the cluster list, click the target cluster that runs the VCI application.​
  1. In the left navigation bar of the cluster management page, click Workload > Deployment.​
  1. Click the name of the target Deployment to go to the its page.​
  1. On the Deployment page, click Console in the upper-right corner to log in to the VCI pod.​
Step 2: Query metadata​
For example, after logging in to the VCI pod, you can run the following shell command to query instance metadata by using cURL:​
tip​
Ensure that the cURL tool is installed in the container image. If it is not installed, install it first.​
  • Query the root directory for instance metadata:​
  • ​
    curl http://100.96.0.96/latest​
    ​
  • Query the instance ID:​
  • ​
    curl http://100.96.0.96/latest/instance_id​
    ​
  • Query the billing type of the instance:​
  • ​
    curl http://100.96.0.96/latest/payment/charge_type​
    ​
  • Query IAM roles of the instance:​
  • ​
    curl http://100.96.0.96/volcstack/latest/iam/security_credentials/​
    ​
  • ​
Last updated: 2026.03.16 14:55:25