Skip to content

Commit

Permalink
fix: use local NTP for AWS platform
Browse files Browse the repository at this point in the history
Fixes #10245

Signed-off-by: Andrey Smirnov <andrey.smirnov@siderolabs.com>
  • Loading branch information
smira committed Jan 31, 2025
1 parent 673ca4b commit b716561
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
16 changes: 15 additions & 1 deletion internal/app/machined/pkg/runtime/v1alpha1/platform/aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,21 @@ func NewAWS() (*AWS, error) {

// ParseMetadata converts AWS platform metadata into platform network config.
func (a *AWS) ParseMetadata(metadata *MetadataConfig) (*runtime.PlatformNetworkConfig, error) {
networkConfig := &runtime.PlatformNetworkConfig{}
networkConfig := &runtime.PlatformNetworkConfig{
TimeServers: []network.TimeServerSpecSpec{
{
NTPServers: []string{
// See https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-ec2-ntp.html
//
// Include both IPv4 & IPv6 addresses for the NTP servers, Talos would lock to one of them (whichever works),
// but it would be compatible with v4-only and v6-only deployments.
"169.254.169.123",
"fd00:ec2::123",
},
ConfigLayer: network.ConfigPlatform,
},
},
}

if metadata.Hostname != "" {
hostnameSpec := network.HostnameSpecSpec{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ hostnames:
domainname: ""
layer: platform
resolvers: []
timeServers: []
timeServers:
- timeServers:
- 169.254.169.123
- fd00:ec2::123
layer: platform
operators: []
externalIPs:
- 1.2.3.4
Expand Down

0 comments on commit b716561

Please sign in to comment.