1
0
mirror of https://gitlab.alpinelinux.org/alpine/cloud/tiny-cloud.git synced 2026-06-21 00:07:16 +03:00

Allow to override default IMDS endpoint

This commit is contained in:
Leonardo Arena 2026-03-25 20:08:30 +01:00
parent 5c3bd02e27
commit ffff8fc35d
4 changed files with 26 additions and 1 deletions

View File

@ -116,6 +116,21 @@ Alternatively, you can add `tinycloud=cloud=<cloud>` (preferred) or `ds=<cloud>`
`/sys/class/dmi/id/product_serial` (QEMU hack) is another way to explicitly `/sys/class/dmi/id/product_serial` (QEMU hack) is another way to explicitly
choose a cloud provider. choose a cloud provider.
### Custom Metadata Service Endpoint
For custom or non-standard metadata services, you can
override the default IMDS endpoint by setting `IMDS_ENDPOINT` in
`/etc/tiny-cloud.conf`:
```sh
# For Tinkerbell or other custom metadata services
IMDS_ENDPOINT=192.0.2.1:50061
```
The default endpoint is `169.254.169.254` for most cloud providers. This
setting allows you to specify a custom IP address and optional port for the
metadata service.
## Operation ## Operation
The first time an instance boots -- either freshly instantiated from an image, The first time an instance boots -- either freshly instantiated from an image,

View File

@ -52,7 +52,8 @@ unset -f \
### default variables/functions ### default variables/functions
# Common to many clouds # Common to many clouds
IMDS_ENDPOINT="169.254.169.254" # Can be overridden in /etc/tiny-cloud.conf
: "${IMDS_ENDPOINT:=169.254.169.254}"
# Common to AWS and NoCloud(ish) # Common to AWS and NoCloud(ish)
IMDS_HOSTNAME="meta-data/hostname" IMDS_HOSTNAME="meta-data/hostname"

View File

@ -33,6 +33,10 @@ Blank lines and shell comments are ignored.
Default user account for instance SSH keys and default-user setup. The default Default user account for instance SSH keys and default-user setup. The default
is *alpine*. is *alpine*.
*IMDS_ENDPOINT*=<ip_address>
Provider endpoint IP address to use. Defaults to 169.254.169.254 for many
providers.
*IMDS_TOKEN_TTL*=<seconds> *IMDS_TOKEN_TTL*=<seconds>
Metadata token lifetime in seconds for AWS metadata access. This is only used Metadata token lifetime in seconds for AWS metadata access. This is only used
by the AWS provider. The default is *5*. by the AWS provider. The default is *5*.

View File

@ -8,6 +8,11 @@
# User account where instance SSH keys are installed # User account where instance SSH keys are installed
#CLOUD_USER=alpine #CLOUD_USER=alpine
# IMDS endpoint override (IP:PORT or IP)
# Defaults to 169.254.169.254 for most clouds
# Useful for custom metadata services
#IMDS_ENDPOINT=169.254.169.254
# IMDS token validity, in seconds (AWS only) # IMDS token validity, in seconds (AWS only)
#IMDS_TOKEN_TTL=5 #IMDS_TOKEN_TTL=5