ipam: Support for static IP allocation in AWS#34622
Merged
julianwiedmann merged 1 commit intocilium:mainfrom Oct 2, 2024
Merged
ipam: Support for static IP allocation in AWS#34622julianwiedmann merged 1 commit intocilium:mainfrom
julianwiedmann merged 1 commit intocilium:mainfrom
Conversation
doniacld
reviewed
Sep 9, 2024
doniacld
approved these changes
Sep 9, 2024
Contributor
doniacld
left a comment
There was a problem hiding this comment.
One minor comment otherwise the PR seems good to me but note that I do not have a extended knowledge of this code.
doniacld
reviewed
Sep 9, 2024
36bd0fa to
8ba6fb8
Compare
joamaki
approved these changes
Sep 10, 2024
Contributor
|
Hey @antonipp When making k8s related changes, there maybe some extra steps to do in our k8s infrastructure. Please view and handle the failing test here: https://github.com/cilium/cilium/actions/runs/10775087980/job/29878708227?pr=34622 |
Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
8ba6fb8 to
0bf5b57
Compare
Contributor
Author
|
Thanks, I completely missed this error! I did run the required steps before but looks like since #34463 the format for YAML multi-line strings changed so I re-generated the manifests once again from latest |
Member
|
/test |
8 tasks
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR is a proposal for supporting static IP allocation as described in #34094.
The proposed abstraction is Cloud Provider agnostic. This PR implements the code path for AWS which is fully functional. The code for other Cloud Providers can be implemented later separately.
In this version of the implementation, we assume that users manually manage pools of static IP addresses (in this particular example, pools of AWS Elastic IP addresses) and assign different tags to differentiate the pools.
The main idea of this proposal is to add a new field (
static-ip-tags) to theipamsection of the CNI spec. This will allow users to indicate that they want a static IP with given tags to be assigned to the node.Example:
When the Operator sees that
static-ip-tagsis set on theCiliumNodeobject, it makes the Cloud Provider API calls to retrieve the IPs with the given tags and associates the first found IP with the instance. It then updates the status of theCiliumNodeobject.Testing
I added some unit tests but also tried out the PR in a real AWS environment.
At first I manually allocated an EIP with tags
"anton": "test"and"kubernetes_cluster": "<MY_CLUSTER_NAME>"in our AWS account.I then provisioned a node with the following CNI spec:
$ sudo cat /etc/cni/net.d/10-generic-veth.conflist { "cniVersion": "0.3.1", "name": "cilium", "plugins": [ { "name": "cilium", "type": "cilium-cni", "eni": { "delete-on-termination": true, "first-interface-index": 1, "use-primary-address": false, "pre-allocate": 1, "min-allocate": 3 }, "ipam": { "pre-allocate": 1, "min-allocate": 3, "static-ip-tags": { "anton": "test", "kubernetes_cluster": "" } } } ] }I then confirmed that the IPAM settings were successfully passed on to the
CiliumNodeCRD object:The Operator saw that IPAM field and associated the EIP I created. Logs:
It also updated the CRD resource status with the right IP address:
The EIP is successfully associated with the EC2 instance as well:
