Search code examples
amazon-web-serviceskubernetesterraformkubectlamazon-eks

EKS: Error syncing load balancer: failed to ensure load balancer: Multiple tagged security groups found for instance


Warning  SyncLoadBalancerFailed  54s (x4 over 91s)  service-controller  Error syncing load balancer: failed to ensure load balancer: Multiple tagged security groups found for instance i-05f3a11329a20bb93; ensure only the k8s security group is tagged; the tagged groups were sg-08ca90265d3402e6c(education-eks-ooHfNJwm-node-20221205083117267100000007) sg-04ad04b5d3bb35e66(eks-cluster-sg-education-eks-ooHfNJwm-1857011925)
  Normal   EnsuringLoadBalancer    14s (x5 over 94s)  service-controller  Ensuring load balancer
  Warning  SyncLoadBalancerFailed  13s                service-controller  Error syncing load balancer: failed to ensure load balancer: Multiple tagged security groups found for instance i-046c2cc46714af250; ensure only the k8s security group is tagged; the tagged groups were sg-08ca90265d3402e6c(education-eks-ooHfNJwm-node-20221205083117267100000007) sg-04ad04b5d3bb35e66(eks-cluster-sg-education-eks-ooHfNJwm-1857011925)

I created the cluster with this code: eks using terraform


Solution

  • Add in eks module will fix issue.

    node_security_group_tags = {
        "kubernetes.io/cluster/${var.cluster_name}" = null
      }
    

    Ref:

    https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1986 https://github.com/terraform-aws-modules/terraform-aws-eks/issues/1810