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

Document setting -1 for warm and minimum ip targets #1548

Closed
Niksko opened this issue Jul 26, 2021 · 5 comments
Closed

Document setting -1 for warm and minimum ip targets #1548

Niksko opened this issue Jul 26, 2021 · 5 comments
Assignees

Comments

@Niksko
Copy link

Niksko commented Jul 26, 2021

What would you like to be added:

Documentation on the fact that setting WARM_IP_TARGET or MINIMUM_IP_TARGET to -1 (or indeed, any non-positive value) is the same as not setting these values.

Why is this needed:

Through shortcomings in the configuration management tool we're using, it's much easier for us to set these env variables to -1 in some environments, and set to them positive values in other environments where we want them to be set.
I had to dig through the source code to figure out that setting them to -1 would work. Setting variables to -1 to effectively have them not be set is fairly standard, and given that negative numbers don't really have any possible meaning in these contexts, it seems like an ok implementation detail to expose a part of the public API.

@jayanthvn
Copy link
Contributor

Sure, I can update the documentation on the default behavior.

@kishorj
Copy link
Contributor

kishorj commented Jul 27, 2021

If prefix delegation is enabled, setting the env variables to -1 would interfere with the engtrypoint.sh validation.

if [ "${WARM_PREFIX_TARGET}" == "0" ] && [ "${WARM_IP_TARGET}" == "0" ] && [ "${MINIMUM_IP_TARGET}" == "0" ];then

We will have to fix the validation script as well for the PD feature.

@jayanthvn
Copy link
Contributor

@kishorj yeah that's right but we won't be able to support that with prefix delegation. Since it is a cluster wide config I feel better to unset the variable for no-op.

@Niksko
Copy link
Author

Niksko commented Jul 29, 2021

@kishorj @jayanthvn would it be possible to update those scripts to check for <= 0 instead of == 0? That would maintain the existing behavior.

Or is there another way to set those values to a value indicating that they are unset?

@jayanthvn
Copy link
Contributor

@Niksko we will have to add the check (<=0) in entry point script to make it consistent with IPAMD. The only way is to unset the variables if they are not being used. The reason for not supporting 0 for these environment variables is they will impact pod launch times when IPs or ENIs are to be allocated. So if a pod is scheduled and IPs are not available then the pod will be stuck in container creating until the next reconciler allocates more IPs. This will be even more slow when new ENI has to be allocated since we need to create+attach an ENI and wait for it to be synced to IMDS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants