kubernetes/kops · error
unexpected amount of ipv6 prefixes on interface %q: %v
Error message
unexpected amount of ipv6 prefixes on interface %q: %v
What it means
After finding the node's single ENI, the controller expects exactly one IPv6 prefix delegated to it, because it assigns that single /80 prefix as the node's podCIDR. This error is thrown when DescribeNetworkInterfaces reports a number of Ipv6Prefixes other than 1 on that interface.
Source
Thrown at cmd/kops-controller/controllers/awsipam.go:141
Filters: []ec2types.Filter{
{
Name: new("attachment.instance-id"),
Values: []string{
instanceID,
},
},
},
})
if err != nil {
return ctrl.Result{}, err
}
if len(eni.NetworkInterfaces) != 1 {
return ctrl.Result{}, fmt.Errorf("unexpected number of network interfaces for instance %q: %v", instanceID, len(eni.NetworkInterfaces))
}
if len(eni.NetworkInterfaces[0].Ipv6Prefixes) != 1 {
return ctrl.Result{}, fmt.Errorf("unexpected amount of ipv6 prefixes on interface %q: %v", *eni.NetworkInterfaces[0].NetworkInterfaceId, len(eni.NetworkInterfaces[0].Ipv6Prefixes))
}
ipv6Address := aws.ToString(eni.NetworkInterfaces[0].Ipv6Prefixes[0].Ipv6Prefix)
podCIDRs := []string{ipv6Address}
if err := patchNodePodCIDRs(r.coreV1Client, ctx, node, podCIDRs); err != nil {
return ctrl.Result{}, err
}
}
return ctrl.Result{}, nil
}
func (r *AWSIPAMReconciler) SetupWithManager(mgr ctrl.Manager) error {
return ctrl.NewControllerManagedBy(mgr).
Named("aws_ipam").
For(&corev1.Node{}).
Complete(r)
}View on GitHub (pinned to 4c8573c808)
Solutions
- Ensure the subnet and instance are configured for IPv6: subnet has an IPv6 CIDR and the ENI has an IPv6 prefix delegated (check in EC2 console / aws ec2 describe-network-instances --query ...Ipv6Prefixes).
- Wait/requeue briefly — prefix delegation can lag instance launch; treat 0 prefixes as transient rather than fatal if the node is new.
- Verify the cluster is actually running with the IPv6 pod-CIDR IPAM mode; this controller should only be enabled for kops IPv6 clusters.
- If multiple prefixes are delegated intentionally, adjust the controller to pick the first prefix instead of erroring.
Example fix
// before
if len(eni.NetworkInterfaces[0].Ipv6Prefixes) != 1 {
return ctrl.Result{}, fmt.Errorf("unexpected amount of ipv6 prefixes on interface %q: %v", *eni.NetworkInterfaces[0].NetworkInterfaceId, len(eni.NetworkInterfaces[0].Ipv6Prefixes))
}
// after
prefixes := eni.NetworkInterfaces[0].Ipv6Prefixes
if len(prefixes) == 0 {
klog.Warningf("no ipv6 prefixes yet on interface %q; requeueing", *eni.NetworkInterfaces[0].NetworkInterfaceId)
return ctrl.Result{RequeueAfter: 10 * time.Second}, nil
}
if len(prefixes) > 1 {
return ctrl.Result{}, fmt.Errorf("unexpected amount of ipv6 prefixes on interface %q: %v", *eni.NetworkInterfaces[0].NetworkInterfaceId, len(prefixes))
} Defensive patterns
Strategy: retry
Validate before calling
resp, _ := ec2Client.DescribeNetworkInterfaces(ctx, &ec2.DescribeNetworkInterfacesInput{Filters: eniFilters})
if len(resp.NetworkInterfaces) == 1 && len(resp.NetworkInterfaces[0].Ipv6Prefixes) == 0 && recentlyLaunched(instance) {
// prefix delegation not propagated yet — retry later instead of failing
} Type guard
func hasSingleIPv6Prefix(iface ec2types.NetworkInterface) bool {
return len(iface.Ipv6Prefixes) == 1 && iface.Ipv6Prefixes[0].Ipv6Prefix != nil
} Try / catch
result, err := r.Reconcile(ctx, req)
if err != nil && strings.Contains(err.Error(), "ipv6 prefixes") {
klog.Warningf("ipv6 prefix count mismatch, requeueing with backoff: %v", err)
return ctrl.Result{RequeueAfter: 30 * time.Second}, nil
} Prevention
- Enable IPv6 prefix delegation on the subnet and instances (IPv6 CIDR on subnet, assign Ipv6Prefix on ENI) before enabling this controller.
- Only run the AWS IPAM controller on clusters provisioned for kops IPv6 pod-CIDR mode.
- Distinguish '0 prefixes' (transient — retry) from '>1 prefixes' (config drift — alert) in monitoring.
- Do not manually add/remove IPv6 prefixes on node ENIs while the controller manages podCIDRs.
When it happens
Trigger: eni.NetworkInterfaces[0].Ipv6Prefixes has length 0 (the ENI was not allocated an IPv6 prefix yet, or IPv6 prefix delegation is disabled on the subnet/instance) or length > 1 (multiple /80 prefixes delegated, e.g. after kubelet/controller restarts or manual assignment), while patching expects exactly one.
Common situations: Cluster not fully configured for IPv6 prefix delegation (subnet without an IPv6 CIDR, 'assignIpv6AddressOnCreation' or prefix delegation not enabled); node launched before prefix assignment completed; manual EC2 changes adding or removing IPv6 prefixes; running an IPv4-only cluster while the IPv6 IPAM controller is enabled.
Related errors
- unexpected number of network interfaces for instance %q: %v
- error deleting EgressOnlyInternetGateway %q: %v
- error listing EgressOnlyInternetGateway: %v
- error listing EgressOnlyInternetGateways: %v
- found multiple EgressOnlyInternetGateways matching tags
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/8fe78fd4ed264a35.
Report an issue: GitHub.