Open nnbu opened 10 months ago
The real problem here with aws api itself.
e.g. I created a new route in existing route-table using following CLI. Notice that I have provided vpc-endpoint-id
as argument
$ aws ec2 create-route --route-table-id rtb-0d41902e37988a44b --destination-cidr-block 192.168.16.0/26 --vpc-endpoint-id vpce-0d16fc08e2473fc4b --region us-west-2
But when I describe the route, aws api returns it as gatewayID instead of vpcendpointID as shown below
$ aws ec2 describe-route-tables --region us-west-2
{
"Associations": [],
"PropagatingVgws": [],
"RouteTableId": "rtb-0d41902e37988a44b",
"Routes": [
{
"DestinationCidrBlock": "192.168.16.0/26",
"GatewayId": "vpce-0d16fc08e2473fc4b",
"Origin": "CreateRoute",
"State": "active"
},
...
When route is added to routeTable CR, sdkUpdate
is called and then immediately sdkFind
is called.
This sdkFind
gets GatewayId
instead of vpcEndpointId
due to the bug in aws cli described above. This is then returned from customUpdateRouteTable
and CR spec gets modified from having vpcEndpointId
to having GatewayId
Relevant code: https://github.com/aws-controllers-k8s/ec2-controller/blob/main/pkg/resource/route_table/hooks.go#L216
The same issue does NOT happen for nat-gateway-id
, because aws api returns the correct value.
e.g.
$ aws ec2 create-route --route-table-id rtb-06883be7cd0fe6be3 --destination-cidr-block 192.168.16.0/26 --nat-gateway-id nat-0837c191cbd2fa45f --region us-west-2
AWS api to describe route table correctly returns the id as nat-gateway-id
(instead of gatewayID
)
$ aws ec2 describe-route-tables --region us-west-2
{
"Associations": [],
"PropagatingVgws": [],
"RouteTableId": "rtb-06883be7cd0fe6be3",
"Routes": [
{
"DestinationCidrBlock": "192.168.16.0/26",
"NatGatewayId": "nat-0837c191cbd2fa45f",
"Origin": "CreateRoute",
"State": "active"
},
Issues go stale after 180d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 60d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle stale
Stale issues rot after 60d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 60d of inactivity.
If this issue is safe to close now please do so with /close
.
Provide feedback via https://github.com/aws-controllers-k8s/community.
/lifecycle rotten
Describe the bug Steps mentioned below describe the issue
Steps to reproduce
Create RouteTable CR without any routes
Add routes to the CR which has
vpcEndpointID
and apply the CR againAfter this, CR spec changes and
vpcEndpointID
gets removed andgatewayID
gets added to the CR. Value ofgatewayID
remains same asvpcEndpointID
Expected outcome CR spec should remain unchanged
Environment
Kubernetes version 1.26
Using EKS (yes/no), if so version? Seen with and without EKS
AWS service targeted (S3, RDS, etc.) EC2 controller