Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Routetable table routes are different compared with the ones used during the creation of the object #2054

Open
adriananeci opened this issue Apr 12, 2024 · 7 comments
Labels
service/ec2 Indicates issues or PRs that are related to ec2-controller.

Comments

@adriananeci
Copy link

Describe the bug
I've noticed that the routetable rules rules are changed by the ack controller once created.
This affect an ArgoCD application that is creating such objects because it is constantly in an out of sync status.

Steps to reproduce

Create a routetable using

apiVersion: ec2.services.k8s.aws/v1alpha1
kind: RouteTable
metadata:
  annotations:
    ec2.services.k8s.aws/deletion-policy: retain
  name: dev-va6-k8s-public
spec:
  routes:
    - destinationCIDRBlock: 0.0.0.0/0
      gatewayRef:
        from:
          name: dev-va6-k8s
    - destinationCIDRBlock: 10.15.20.0/21
      transitGatewayID: tgw-abc123
  vpcRef:
    from:
      name: dev-va6-k8s

Once created the routes are getting changed into something like:

apiVersion: ec2.services.k8s.aws/v1alpha1
kind: RouteTable
metadata:
  annotations:
    ec2.services.k8s.aws/deletion-policy: retain
  name: dev-va6-k8s-public
spec:
  routes:
    - destinationCIDRBlock: 10.15.20.0/21
      transitGatewayID: tgw-abc123
    - destinationCIDRBlock: 0.0.0.0/0
      gatewayID: igw-abc123
    - destinationPrefixListID: pl-123abc
      gatewayID: vpce-123
    - destinationPrefixListID: pl-abc123
      gatewayID: vpce-xxxx
  vpcRef:
    from:
      name: dev-va6-k8s

Expected outcome
Routetable routes should remain the same after object creation

Environment

  • Kubernetes version 1.27
  • Using EKS (yes/no), if so version? 1.27
  • AWS service targeted (S3, RDS, etc.) EC2

cc @a-hilaly

@a-hilaly
Copy link
Member

@adriananeci looks like those are "defaults" created by the ec2 API, can you confirm? If it's the case, then it's an expected behaviour. The controllers can default some fields on Create/Update if they are not specified in the spec.

@a-hilaly a-hilaly added the service/ec2 Indicates issues or PRs that are related to ec2-controller. label Apr 15, 2024
@a-hilaly
Copy link
Member

Mmmmm looks like the gatewayRef also disapeared ...

      gatewayRef:
        from:
          name: dev-va6-k8s

Are you referring to this specific behaviour?

@adriananeci
Copy link
Author

Yes and also to the rules with destinationPrefixListID

@adriananeci
Copy link
Author

The symptoms look similar with the ones described in #1880

@jas-nik
Copy link

jas-nik commented Sep 3, 2024

image
image

Hi @a-hilaly , just checking in, any update on this?

@a-hilaly
Copy link
Member

@jas-nik @adriananeci we just shipped a patch in ec2 controller to fix this. Please try 1.2.24

@jas-nik
Copy link

jas-nik commented Sep 19, 2024

Thats awesome. Thank you for the fix! @a-hilaly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service/ec2 Indicates issues or PRs that are related to ec2-controller.
Projects
None yet
Development

No branches or pull requests

3 participants