kubernetes/kops · error

error building cloud tags: %v

Error message

error building cloud tags: %v

What it means

Computing the GCE cloud tags (instance labels) for an instance group failed while building its instance template; typically a label key or value violates GCE labeling constraints.

Source

Thrown at pkg/model/gcemodel/autoscalinggroup.go:248

			t.CanIPForward = new(false)

			nodeCIDRMaskSize := int32(24)
			if b.Cluster.Spec.KubeControllerManager.NodeCIDRMaskSize != nil {
				nodeCIDRMaskSize = *b.Cluster.Spec.KubeControllerManager.NodeCIDRMaskSize
			}
			t.AliasIPRanges = map[string]string{
				b.NameForIPAliasRange("pods"): fmt.Sprintf("/%d", nodeCIDRMaskSize),
			}
		} else {
			t.CanIPForward = new(true)
		}
		t.Subnet = b.LinkToSubnet(subnet)

		t.ServiceAccounts = append(t.ServiceAccounts, b.LinkToServiceAccount(ig))

		labels, err := b.CloudTagsForInstanceGroup(ig)
		if err != nil {
			return nil, fmt.Errorf("error building cloud tags: %v", err)
		}
		t.Labels = labels

		t.GuestAccelerators = []gcetasks.AcceleratorConfig{}
		for _, accelerator := range ig.Spec.GuestAccelerators {
			t.GuestAccelerators = append(t.GuestAccelerators, gcetasks.AcceleratorConfig{
				AcceleratorCount: accelerator.AcceleratorCount,
				AcceleratorType:  accelerator.AcceleratorType,
			})
		}

		return t, nil
	}
}

func (b *AutoscalingGroupModelBuilder) splitToZones(ig *kops.InstanceGroup) (map[string]int, error) {
	// Indented to keep diff manageable
	// TODO: Remove spurious indent

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check cluster and instance group labels for invalid characters or excessive length (GCE label constraints)
  2. Fix the labels in the cluster spec
  3. Re-run kops update
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at pkg/model/gcemodel/autoscalinggroup.go:248 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/d1833c9e91bf61bc. Report an issue: GitHub.