kubernetes/kops · error
found multiple RouteTables attached to subnet
Error message
found multiple RouteTables attached to subnet
What it means
kOps expects exactly one route table associated with a subnet when reconciling; more than one attached route table is ambiguous (the explicit association and possibly the main route table propagated), so kOps fails rather than guessing.
Source
Thrown at upup/pkg/fi/cloudup/awstasks/routetableassociation.go:143
if subnet.ID == nil {
return nil, fmt.Errorf("subnet ID not set")
}
subnetID := fi.ValueOf(subnet.ID)
request := &ec2.DescribeRouteTablesInput{
Filters: []ec2types.Filter{awsup.NewEC2Filter("association.subnet-id", subnetID)},
}
response, err := cloud.EC2().DescribeRouteTables(ctx, request)
if err != nil {
return nil, fmt.Errorf("error listing RouteTables for subnet %q: %v", subnetID, err)
}
if response == nil || len(response.RouteTables) == 0 {
return nil, nil
}
if len(response.RouteTables) != 1 {
return nil, fmt.Errorf("found multiple RouteTables attached to subnet")
}
rt := response.RouteTables[0]
return &rt, nil
}
func (_ *RouteTableAssociation) RenderAWS(t *awsup.AWSAPITarget, a, e, changes *RouteTableAssociation) error {
ctx := context.TODO()
if a == nil {
// TODO: We might do better just to make the subnet the primary key here
klog.V(2).Infof("Checking for existing RouteTableAssociation to subnet")
existing, err := findExistingRouteTableForSubnet(t.Cloud, e.Subnet)
if err != nil {
return fmt.Errorf("error checking for existing RouteTableAssociation: %v", err)
}
if existing != nil {
for _, a := range existing.Associations {View on GitHub (pinned to 4c8573c808)
Solutions
- List the subnet's route table associations in the AWS console/CLI and remove the unintended one: aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=<subnet-id>
- Ensure only the kOps-managed route table is explicitly associated with the subnet
- If a second table is intentional, manage associations outside the kOps RouteTableAssociation task or disable route-table management for that subnet
- Re-run kops update after cleanup
Example fix
// inspect then disassociate the extra table aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=subnet-0abc aws ec2 disassociate-route-table --association-id <extra-association-id>
Defensive patterns
Strategy: validation
Validate before calling
aws ec2 describe-route-tables --filters Name=association.subnet-id,Values=<subnet-id> --query 'length(RouteTables)'
Prevention
- Do not manually attach extra route tables to kOps-managed subnets
- Keep one management tool (kOps) for route table associations in cluster subnets
- Audit shared-VPC subnets for foreign associations before cluster updates
When it happens
Trigger: DescribeRouteTables filtered by association.subnet-id returns 2+ route tables for the same subnet during RenderAWS of a RouteTableAssociation.
Common situations: Operators manually associated an extra route table (e.g., a appliance/inspection route table) to a kOps-managed subnet; multiple controllers (kOps + Terraform/console) managing routing; shared-subnet setups where another team attached routes.
Related errors
- subnet ID not set
- subnet %q had unknown type %q
- subnet %q had unknown type %q
- could not find public subnet in zone: %q
- found multiple public subnets in zone: %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/d5de014d886292ac.
Report an issue: GitHub.