-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Automatically include ServiceCIDR as an argument to Windows nodes bootstrap #4088
Comments
I am interested in working on this issue and will take it up. |
This is kind of a show-stopper if the VPC CIDR range is not 172.20.0.0/16 or 10.100.0.0/16 |
We had the same issue, with Karpenter v0.30.0 which added windows userdata support this issue can be worked around. Just add this one line of user data to AWSNodeTemplate, replacing
The user data will be prepended before the EKS bootstrap script which could make use of the Of course a proper Karpenter level support for |
@jzhn This is awesome! Would you be open to adding this into the upstream documentation for users to be aware of until we get the proper ServiceCIDR feature merged into the project? |
@jonathan-innis : I'm happy to PR for this workaround, but I hesitate to do that because the usage of If you could provide some insights that this workaround is safe and won't cause confusion I'll make a PR ASAP. Thanks. |
Going to aim to prioritize this and hopefully have a PR up soon given how this is a show-stopper for some cases. I am afraid that @jzhn is right that the Windows bootstrap is not open sourced but the contents are publicly readable on the node if you run an instance with the EKS Windows Optimized AMI. @jzhn is also right regarding the fact that the global variables are internal to the Powershell bootstrap so they will only be accessible within the script itself. If you set the global variable outside the script it is overwritten internally in the script so this workaround will not work. Support for ServiceCIDR will have to be at Karpenter level for ease of use. |
Thanks @tzifudzi for your information. I want to add that the workaround of setting The function Describe-EKSCluster {
<#
.SYNOPSIS
Calls Get-EKSCluster to get cluster information like ServiceIpv4Cidr, APIServerEndpoint, Base64ClusterCA, etc.
#>
# Get-EKSCluster call.
if (-not [string]::IsNullOrEmpty($Endpoint)) {
$global:EKSCluster = Get-EKSCluster -Name $EKSClusterName -EndpointUrl $Endpoint
} else {
$global:EKSCluster = Get-EKSCluster -Name $EKSClusterName
}
}
function Update-KubeConfig {
<#
.SYNOPSIS
Creates/Updates kubeconfig file
#>
# Update only if the APIServerEndPoint and Base64ClusterCA are empty.
if ($APIServerEndpoint -and $Base64ClusterCA) {
Write-Log "APIServer Endpoint and Cluster CA are being passed, bypassing cluster defaults."
} else {
Write-Log "Getting cluster information..."
Describe-EKSCluster
Write-Log "Using cluster information to get APIServer Endpoint and Cluster CA."
# ...
}
# ...
} Some personal thoughts:
|
@jzhn Ah I see. When I referred to the value being overwritten I was referring to Please run a test locally and see if setting the cluster name results in the the To verify that the ServiceCIDR was set correctly, please check the file |
Yes, I've been running this workaround for my cluster for ~1 week with Karpenter v0.30.0 + Just for the ease of reproduce and test on your side, we used Let me prepare a quick doc update PR then. |
This change will be not be implemented within Karpenter, as discussed in closed PR #4625. The fix will be applied in the Windows bootstrap to extend it to accept an environment variable that can be set with custom userdata. Will share more information regarding the environment variable name and examples of how to use it at a later time within the next few weeks. |
This issue can now be closed as the EKS Windows powershell bootstrap script now accepts an environment variable for Service CIDR which can be set with custom user data. This is available in the latest EKS Windows Optimizd AMIs, that is, version Example of setting the service CIDR:
This has already been updated in AWS EKS Windows Documentation, and I am happy to add documentation to Karpenter too if necessary. |
Tell us about your request
After Windows support is implemented, it will be ideal and preferable to automatically include
ServiceCIDR
as an argument to bootstrap file for Windows nodes. It is possible we can retrieve this value along with theDNSClusterIP
as is part of the DescribeCluster request operation against the EKS API. The value will be set inserviceIpv4Cidr
in thekubernetesNetworkConfig
.Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?
If the ServiceCIDR is not automatically retrieved or provided, the default value will be used as described in EKS docs Bootstrap script configuration parameters and will default to 172.20.0.0/16 or 10.100.0.0/16 based on the IP address of the primary interface.
In a case where a custom service CIDR was used, pods behind a Kubernetes service not have network connectivity as it would have been misconfigured with the default values. If this issue is not fixed, it would become a blocker for anyone wishing to adopt Karpenter as an autoscaler for Windows nodes in a case where they need a custom service CIDR.
Are you currently working around this issue?
See workaround listed here https://karpenter.sh/v0.30/concepts/node-templates/#windows
Additional Context
At the current time of opening the issue, support for Windows is still yet to be released but has been merged in PR #3698.
Attachments
No response
Community Note
The text was updated successfully, but these errors were encountered: