Closed arunsisodiya closed 1 year ago
Guys, Can anyone look into this?
Are you saying that this example does not produce the desired results? https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/ipv4-prefix-delegation
Yes right @bryantbiggs , I am able to use the VPC cni addon with secondary CIDR configuration but the prefix delegation was not enabled on the ec2 machines even if the configuration is there.
I don't know about the root cause but you can see that VPC-CNI addon, as well as managed node groups, are being created in parallel which should not happen right?
I have tried the example I linked 3 times and the results are as intended - I suspect the issue is with the configuration you are using; I would start with the example linked and modified to suit your needs
I agree with you that is why I put my whole configuration here, I think the same that it should work. I even validated all the settings and created a new cluster multiple times but the result was not desired.
I can give it another try now and let you know.
based on your configuration, I think you're trying to do too much. Again, start with the example linked and only modify the settings that you need to set explicitly
Do you think that the order of Environment variables can be an issue? Since now I am creating the cluster and it is showing me desired results, the only change i did is this:
configuration_values = jsonencode({
env = {
# Reference https://aws.github.io/aws-eks-best-practices/reliability/docs/networkmanagement/#cni-custom-networking
AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG = "true"
ENI_CONFIG_LABEL_DEF = "topology.kubernetes.io/zone"
# Reference docs https://docs.aws.amazon.com/eks/latest/userguide/cni-increase-ip-addresses.html
ENABLE_PREFIX_DELEGATION = "true"
WARM_PREFIX_TARGET = "1"
}
})
Previously it was:
configuration_values = jsonencode({
env = {
# Reference docs https://docs.aws.amazon.com/eks/latest/userguide/cni-increase-ip-addresses.html
AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG = "true"
WARM_ENI_TARGET = "1"
ENABLE_PREFIX_DELEGATION = "true"
ENI_CONFIG_LABEL_DEF = "topology.kubernetes.io/zone"
}
})
closed with above guidance - thank you!
Hello,
I'm having the same issue, sometimes a cluster creation is OK, sometimes it's not. I do remember that some time a go when creating the cluster, the VPC_cni config as iutput all together as a block, and only the would the managed nodegroup output started, but now it seems both are done at the same time, and that causes this issue.
Was something changed that might have caused this? I now have to always check the nodes created to see if they have the secondary interface, and rotate them when they don't, which is really frustrating.
@bryantbiggs so I really think this issue should not be closed
yes, this was changed recently https://github.com/terraform-aws-modules/terraform-aws-eks/pull/2478
@bryantbiggs - This rolled-out change is quite old, we are already using this version. Still, sometimes everything will go as per plan with the right configuration but sometimes it is not working and we need to rotate nodes manually.
have you tried extending the dataplane_wait_duration
to something like "60s"
or more?
No, I have not tried it, Can give a try to this. Still, do we have any way to put explicit dependency between node groups and vpc_cni? like node groups must be created only after CNI is created?
@ArunSisodiya , The problem in this code was not due to it's order sequence but the change in parameters , As per to the updated AWS doc (link:- https://docs.aws.amazon.com/eks/latest/userguide/cni-increase-ip-addresses.html ) two parameters have been depreciated i.e. ( AWS_VPC_K8S_CNI_CUSTOM_NETWORK_CFG = "true" and ENI_CONFIG_LABEL_DEF = "topology.kubernetes.io/zone" )
Try Instead the below code, as it worked for me with the same expected results
configuration_values = jsonencode({
env = {
# Reference docs https://docs.aws.amazon.com/eks/latest/userguide/cni-increase-ip-addresses.html
ENABLE_PREFIX_DELEGATION = "true"
WARM_ENI_TARGET = "1"
}
})
After this you can easily find out the max number of Pods that can be placed on your eks Nodes with this command.
kubectl describe node ip-192-168-30-193.region-code.compute.internal | grep 'pods\|PrivateIPv4Address'
NOTE: - Replace 192.168.30.193 with the IPv4 address in the name of one of your nodes returned in the previous output.
Description
In our organization, we are using AWS EKS for the Kubernetes cluster. To enable the CNI, we are using the addon provided by AWS i.e.
vpc-cni
. In addition to that we are also using secondary CIDR for having a large number of IPs for the pods running inside the cluster. Currently, we are using the steps defined here - https://tf-eks-workshop.workshop.aws/500_eks-terraform-workshop/570_advanced-networking/secondary_cidr/configure-cni.htmlWith this approach, we need to run some scripts but I want to have a native way of doing it. I am following the examples defined here - https://github.com/aws-ia/terraform-aws-eks-blueprints/tree/main/examples/vpc-cni-custom-networking but the
prefix-delegation
is not working as expected.In the ideal scenario, the VPC CNI should be available with the options configured and then the node group should come up so that we don't have to recreate the node groups but in my case, it is not happening. The prefix delegation is not picking up on the ec2 machines.
Versions
Module version [Required]: ~> 19.0
Terraform version: 1.3.1
Provider version(s):
provider registry.terraform.io/hashicorp/aws v4.54.0
provider registry.terraform.io/hashicorp/cloudinit v2.2.0
provider registry.terraform.io/hashicorp/helm v2.9.0
provider registry.terraform.io/hashicorp/kubernetes v2.17.0
provider registry.terraform.io/hashicorp/local v2.3.0
provider registry.terraform.io/hashicorp/null v3.2.1
provider registry.terraform.io/hashicorp/tls v4.0.4
provider registry.terraform.io/oboukili/argocd v3.2.1
Reproduction Code [Required]
Steps to reproduce the behavior:
EKS Configuration:
Node Group Configuration:
ENI Configuration:
Expected behaviour
The expected behavior is that VPC CNI should pick up the values before the node group is creating ec2 machines and push the cni configuration of prefix delegation to the network configuration of the ec2 machines.
Actual behaviour
The actual behavior is that I need to recreate the ec2 machine for picking up the prefix delegation change which is not good for the production clusters.
Terminal Output Screenshot(s)
Additional context
If you require, I can provide screenshots of the ec2 machines' network configuration.
NOTE: Since we are using EKS for our production clusters, it will be really helpful if someone looks into this on priority and provide the right way of implementing the custom CNI networking for the
max_pods
.cc - @bryantbiggs