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

FluxCD - resources with references are always configured #1880

Closed
gecube opened this issue Aug 22, 2023 · 7 comments
Closed

FluxCD - resources with references are always configured #1880

gecube opened this issue Aug 22, 2023 · 7 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. service/ec2 Indicates issues or PRs that are related to ec2-controller.

Comments

@gecube
Copy link

gecube commented Aug 22, 2023

Describe the bug

If we create a resource that utilises ref from another resource like

apiVersion: ec2.services.k8s.aws/v1alpha1
kind: RouteTable
metadata:
  name: production-private-route-table-eu-west-2c
  namespace: infra-production
spec:
  vpcRef:
    from:
      name: production
  routes:
    - destinationCIDRBlock: 0.0.0.0/0
      natGatewayRef:
        from:
          name: natgateway-eu-west-2c
    - destinationCIDRBlock: 10.0.0.0/16
      vpcPeeringConnectionID: pcx-0a7197b4f5ced6f01

then the target resource looks like:

spec:
  routes:
    - destinationCIDRBlock: 10.0.0.0/16
      vpcPeeringConnectionID: pcx-0a7197b4f5ced6f01
    - destinationCIDRBlock: 0.0.0.0/0
      natGatewayID: nat-07a301987eaa97785
  tags:
    - key: services.k8s.aws/namespace
      value: infra-production
    - key: services.k8s.aws/controller-version
      value: ec2-1.0.3
  vpcRef:
    from:
      name: production

So we can clearly see that natGatewayID was substituted. So it means that on every reconciliation by flux resource is changed twice. Also it is curious that vpcRef is not substituted.

Steps to reproduce

Just apply the first manifest

Expected outcome

No idea. Needs to be discussed. Probably - make substitutions in status field. Or use admission controller. No idea. The only thing I can propose - ask not to change the original description, otherwise I will need to find a way to remove a fields from reconciliation.

@gecube
Copy link
Author

gecube commented Sep 14, 2023

linked to #1898

@a-hilaly
Copy link
Member

This could be very likely a bug with ACK references.. we'll have to investigate this further. Thank you for reporting this @gecube !

@ack-bot
Copy link
Collaborator

ack-bot commented May 11, 2024

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

@ack-prow ack-prow bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 11, 2024
@gecube
Copy link
Author

gecube commented May 11, 2024

/remove-lifecycle stale

@ack-prow ack-prow bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 11, 2024
@a-hilaly a-hilaly added kind/bug Categorizes issue or PR as related to a bug. service/ec2 Indicates issues or PRs that are related to ec2-controller. labels Jun 18, 2024
ack-prow bot pushed a commit to aws-controllers-k8s/ec2-controller that referenced this issue Sep 18, 2024
…220)

Issue [#1880](aws-controllers-k8s/community#1880)

Description of changes:
These tests ensure that after an update, 
the controller won't replace the resource 
reference with the ID itself.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@michaelhtm
Copy link
Member

Hello @gecube, I have made a fix to the EC2 controller.
The issue was happening due to an sdkFind in the customUpdate
function, that overwrites the spec, which is not expected. I will take
a look at the EKS issues as well, in case it's a similar issue.
Thanks for bringing this to our attention and feel free to reach
out for any other questions or concerns

@gecube
Copy link
Author

gecube commented Sep 19, 2024

@michaelhtm Hi! Thanks! Sound great. When could we check it on production (we need new release of ACK)?

@michaelhtm
Copy link
Member

@gecube We shipped a release for EC2, the EKS release will be coming soon

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

No branches or pull requests

4 participants