Skip to content

Commit

Permalink
fix: update providerid prefix for aws
Browse files Browse the repository at this point in the history
This PR updates the ProviderID format for aws resources. There seems to
be a bug when using Talos CCM (which consumes this value from Talos)
because the format is `aws://x/y` (two slashes) vs. the expected
`aws:///x/y` (three slashes) that is set with the AWS CCM code
[here](https://github.com/kubernetes/cloud-provider-aws/blob/d0551093673e8c355db17249b8f069767c014748/pkg/providers/v1/instances.go#L47-L53).

Setting only two slashes causes important software in the workload
cluster to fail, specifically cluster-autoscaler. The regex they use for
pulling providerID is [here](https://github.com/kubernetes/autoscaler/blob/702e9685d6c1d002f4a448f2d88007141dfa6d56/cluster-autoscaler/cloudprovider/aws/aws_cloud_provider.go#L195).

Signed-off-by: Spencer Smith <spencer.smith@talos-systems.com>
  • Loading branch information
jared-gs authored and rsmitty committed Aug 3, 2023
1 parent ac2aff5 commit bcf2845
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func (a *AWS) ParseMetadata(metadata *MetadataConfig) (*runtime.PlatformNetworkC
Zone: metadata.Zone,
InstanceType: metadata.InstanceType,
InstanceID: metadata.InstanceID,
ProviderID: fmt.Sprintf("aws://%s/%s", metadata.Zone, metadata.InstanceID),
ProviderID: fmt.Sprintf("aws:///%s/%s", metadata.Zone, metadata.InstanceID),
Spot: metadata.InstanceLifeCycle == "spot",
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ metadata:
region: us-east-1
zone: us-east-1a
instanceId: i-0a0a0a0a0a0a0a0a0
providerId: aws://us-east-1a/i-0a0a0a0a0a0a0a0a0
providerId: aws:///us-east-1a/i-0a0a0a0a0a0a0a0a0

0 comments on commit bcf2845

Please sign in to comment.