kubernetes/kops · error
linode VPC requires at least one subnet
Error message
linode VPC requires at least one subnet
What it means
The Linode NetworkModelBuilder.Build() validates the cluster's networking configuration before generating VPC/subnet tasks. Linode clusters require at least one subnet defined in cluster.spec.networking.subnets; if the list is empty, the build aborts with this static error.
Source
Thrown at pkg/model/linodemodel/network.go:37
import (
"fmt"
"k8s.io/kops/upup/pkg/fi"
"k8s.io/kops/upup/pkg/fi/cloudup/linode"
"k8s.io/kops/upup/pkg/fi/cloudup/linodetasks"
)
// NetworkModelBuilder configures the Akamai (Linode) VPC for the cluster.
type NetworkModelBuilder struct {
*LinodeModelContext
Lifecycle fi.Lifecycle
}
var _ fi.CloudupModelBuilder = &NetworkModelBuilder{}
func (b *NetworkModelBuilder) Build(c *fi.CloudupModelBuilderContext) error {
if len(b.Cluster.Spec.Networking.Subnets) == 0 {
return fmt.Errorf("linode VPC requires at least one subnet")
}
seenSubnetNames := map[string]string{}
region := ""
for i, subnet := range b.Cluster.Spec.Networking.Subnets {
subnetName := subnet.Name
if subnetName == "" {
subnetName = fmt.Sprintf("subnet %d", i)
}
if subnet.Name == "" {
return fmt.Errorf("linode subnet %q requires a name", subnetName)
}
if subnet.Region == "" {
return fmt.Errorf("linode subnet %q requires a region", subnetName)
}
if subnet.CIDR == "" {
return fmt.Errorf("linode subnet %q requires a CIDR", subnetName)View on GitHub (pinned to 4c8573c808)
Solutions
- Add at least one subnet to cluster.spec.networking.subnets with name, region, and CIDR set.
- Re-run kops update cluster --yes after fixing the manifest.
- If using a cluster template, verify the templating filled in the subnets section.
Example fix
// before
networking:
subnets: []
// after
networking:
subnets:
- name: us-east-1a
region: us-east
cidr: 10.0.0.0/24 Defensive patterns
Strategy: validation
Validate before calling
if len(cluster.Spec.Networking.Subnets) == 0 {
return errors.New("cluster.spec.networking.subnets must define at least one subnet for Linode")
} Prevention
- Always define at least one subnet with name/region/cidr for Linode clusters.
- Run kops validate or a schema check on the manifest before create.
- Verify templating outputs a non-empty subnets list.
- Re-check specs after automated edits or migrations.
When it happens
Trigger: Creating or updating a Linode cluster whose manifest omits spec.networking.subnets entirely, or after a spec edit/tooling pass stripped the subnets array.
Common situations: Hand-written cluster manifests missing the subnets section; kops toolbox template rendering producing empty subnets; migrating a cluster spec from a provider where subnets are optional.
Related errors
- linode subnet %q requires a name
- linode subnet %q requires a region
- linode subnet %q requires a CIDR
- Subnet.VPC is required
- Subnet.VPC.ID is required
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/c1ff180d64106ffc.
Report an issue: GitHub.