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
AWS EC2 Instance tag filter #19181
AWS EC2 Instance tag filter #19181
Conversation
|
Commit 96133ab6cdcacf9eb4b9a91e00240502b91cb5a7 does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
96133ab
to
6ca153c
Compare
6ca153c
to
abdbefd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is the subnet tag filter not enough to do this job? AFAIU, interfaces are attached to subnets, so filtering out certain subnets allows you to filter out interfaces as well.
The theory is that you want Cilium to sync AWS resources that are used by the cluster.
The real good way to filter resources is by targeting things that are in play in the cluster: instances / nodegroups. Ideally I would PR to remove the subnet filter, but that would be a breaking change. This PR is adding an instance filter that should be able to replace the subnet filter in most if not all of the possible scenarios. I'm also wondering about the other part of the Personally, in my DEV AWS account, I have currently 8 clusters * 5 nodes * 3 private subnets for ec2 instance IPs * 3 pod subnets for pod IPs... For this setup to work, I have to either don't use a filter, or filter on both Note that same issue seems to exist with Alibaba, Azure and all. I'm opened to any suggestion here. And if you think the subnet-filter hack is enough (once well documented) then I'll close this PR :) |
|
Commit ef1fe5b831034982f3f0c6989ff0376041c8a3f2 does not contain "Signed-off-by". Please follow instructions provided in https://docs.cilium.io/en/stable/contributing/development/contributing_guide/#developer-s-certificate-of-origin |
ef1fe5b
to
d3e901a
Compare
|
latest commit msg with some infos: This PR is adding the basic code to add a new command line option of the Cilium-Operator to filter AWS EC2 instances (and available ENI/subnets) based on EC2 instance tags Technically, if an instance tag filter is provided, instead of searching ALL the ENIs that exist in the AWS account, we:
We have to search twice, once to filter instances and ENIS (giving us This could also be refactored... We could filter both on instance tags and subnets in the same function (even if it seems useless to do so). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks very solid to me, thanks a lot for taking care of this! 🚀
I have a few minor nits that need to be addressed, and an overall question about what the interaction with this and the old subnet tag filter should be.
d3e901a
to
aec5404
Compare
|
/test |
1 similar comment
|
/test |
[ upstream commit 212d6e7 ] The `eni.subnetTagsFilter` option is notoriously hard to use correctly. If it is used with tags that don't match the subnet of the pre-attached ENI, Cilium agent will never become ready (cilium#18239). This PR removes it from the ENI documentation (which most users will use as a reference configuration) such that no one enables this option without being aware of its requirements. This PR also adds additional context the Helm value. We might deprecate and remove the option in the future as well (cilium#19181). Signed-off-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Paul Chaignon <paul@cilium.io>
[ upstream commit 212d6e7 ] The `eni.subnetTagsFilter` option is notoriously hard to use correctly. If it is used with tags that don't match the subnet of the pre-attached ENI, Cilium agent will never become ready (cilium#18239). This PR removes it from the ENI documentation (which most users will use as a reference configuration) such that no one enables this option without being aware of its requirements. This PR also adds additional context the Helm value. We might deprecate and remove the option in the future as well (cilium#19181). Signed-off-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Paul Chaignon <paul@cilium.io>
cfe11d4
to
51d6d57
Compare
|
I just corrected to docs wordlist, but i'm clueless about the other tests failing... how to get this PR merged ? |
Thanks! So to get the PR merged, we want to make sure CI runs completely and doesn't uncover any issues. Our CI tends to be unreliable at times, so not every failure is necessarily related to the PR. I'll trigger a CI run (the As a side note: Please avoid pushing to the branch before we have had a change to look at any failing tests. Re-pushing invalidates the CI results. |
[ upstream commit 212d6e7 ] The `eni.subnetTagsFilter` option is notoriously hard to use correctly. If it is used with tags that don't match the subnet of the pre-attached ENI, Cilium agent will never become ready (#18239). This PR removes it from the ENI documentation (which most users will use as a reference configuration) such that no one enables this option without being aware of its requirements. This PR also adds additional context the Helm value. We might deprecate and remove the option in the future as well (#19181). Signed-off-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Paul Chaignon <paul@cilium.io>
[ upstream commit 212d6e7 ] The `eni.subnetTagsFilter` option is notoriously hard to use correctly. If it is used with tags that don't match the subnet of the pre-attached ENI, Cilium agent will never become ready (#18239). This PR removes it from the ENI documentation (which most users will use as a reference configuration) such that no one enables this option without being aware of its requirements. This PR also adds additional context the Helm value. We might deprecate and remove the option in the future as well (#19181). Signed-off-by: Sebastian Wicki <sebastian@isovalent.com> Signed-off-by: Paul Chaignon <paul@cilium.io>
|
@gandro any news ? |
This PR is adding a new command line option `instance-tags-filter` to the Cilium-Operator to filter maintained AWS EC2 instances (and available ENIs) based on EC2 instance tags Technically, if an instance tag filter is provided, instead of searching ALL the ENIs that exist in the AWS account, we: - skip the `instance-subnet-filter` - search all instances matching the tags - grab all the ENIS of the selected instances The code will search for matching instances and will grab all instance ENIS (giving us `ec2_types.InstanceNetworkInterface`) and will then search ENIs to get `ec2_types.NetworkInterface` that is needed down the line. Signed-off-by: Sebastien Prune THOMAS <prune@lecentre.net>
51d6d57
to
495be70
Compare
|
/test |
|
I have re-triggered the tests, normally it will take 2-3 hours for full CI. Will check back once it's completed. |
|
GKE failed with known flake #17307 but shouldn't be affected by these changes anyway. Other tests are passing and reviews are in. Marking ready to merge. |
|
@prune998 Thanks for the contribution! |
… used PR cilium#19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com>
… used PR #19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com>
… used PR cilium#19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com>
… used [ upstream commit c7ebfee ] PR cilium#19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com> Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
… used [ upstream commit c7ebfee ] PR #19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com> Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com>
… used [ upstream commit c7ebfee ] PR cilium#19181 introduced option `instance-tags-filter` for filtering instances that need to be kept in sync. The implementation uses AWS EC2 API DescribeInstances. Without the permission, the operator would fail with message: level=warning msg="Unable to synchronize EC2 interface list" error="operation error EC2: DescribeInstances, https response error StatusCode: 403, RequestID: <snap>, api error UnauthorizedOperation: You are not authorized to perform this operation." subsys=eni This patches documents the necessary permission the operator needs to be granted when using option `instance-tags-filter`. Signed-off-by: Haitao Li <lihaitao@gmail.com> Signed-off-by: Nicolas Busseneau <nicolas@isovalent.com> Signed-off-by: Michi Mutsuzaki <michi@isovalent.com>

Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXXline if the commit addresses a particularGitHub issue.
Fixes: #18239