kubernetes/kops · error

evictionSoft: %w

Error message

evictionSoft: %w

What it means

Same parseKeyValueList mechanism as evictionHard but applied to EvictionSoft: entries must be key<value pairs split on '<'. A comma-separated entry missing '<' aborts kubelet configuration assembly with this wrapped error.

Source

Thrown at nodeup/pkg/model/kubelet.go:394

		cc.EventRecordQPS = kubeletConfig.EventQPS
	}

	if b.NodeupConfig.ContainerdConfig.Address == nil {
		cc.ContainerRuntimeEndpoint = "unix:///run/containerd/containerd.sock"
	} else {
		cc.ContainerRuntimeEndpoint = "unix://" + fi.ValueOf(b.NodeupConfig.ContainerdConfig.Address)
	}

	if kubeletConfig.EvictionHard != nil {
		evictionHard, err := parseKeyValueList(*kubeletConfig.EvictionHard, "<")
		if err != nil {
			return nil, fmt.Errorf("evictionHard: %w", err)
		}
		cc.EvictionHard = evictionHard
	}
	evictionSoft, err := parseKeyValueList(kubeletConfig.EvictionSoft, "<")
	if err != nil {
		return nil, fmt.Errorf("evictionSoft: %w", err)
	}
	cc.EvictionSoft = evictionSoft
	evictionSoftGracePeriod, err := parseKeyValueList(kubeletConfig.EvictionSoftGracePeriod, "=")
	if err != nil {
		return nil, fmt.Errorf("evictionSoftGracePeriod: %w", err)
	}
	cc.EvictionSoftGracePeriod = evictionSoftGracePeriod
	evictionMinimumReclaim, err := parseKeyValueList(kubeletConfig.EvictionMinimumReclaim, "=")
	if err != nil {
		return nil, fmt.Errorf("evictionMinimumReclaim: %w", err)
	}
	cc.EvictionMinimumReclaim = evictionMinimumReclaim

	featureGates, err := parseFeatureGates(kubeletConfig.FeatureGates)
	if err != nil {
		return nil, fmt.Errorf("featureGates: %w", err)
	}
	cc.FeatureGates = featureGates

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Fix the offending entry to use '<' between key and value (message quotes the bad pair)
  2. Distinguish fields: evictionSoft uses '<', evictionSoftGracePeriod and evictionMinimumReclaim use '='
  3. Validate the CSV string locally with a quick split-and-check before applying
  4. kops update cluster after correcting the spec

Example fix

// before
kubelet:
  evictionSoft: "memory.available=100Mi"
// after
kubelet:
  evictionSoft: "memory.available<100Mi"
Defensive patterns

Strategy: validation

Validate before calling

func validEvictionSoft(s string) bool {
    if s == "" { return true }
    for _, kv := range strings.Split(s, ",") {
        if !strings.Contains(kv, "<") { return false }
    }
    return true
}

Try / catch

if _, err := parseKeyValueList(cfg.EvictionSoft, "<"); err != nil {
    return fmt.Errorf("evictionSoft must be comma-separated key<value pairs: %w", err)
}

Prevention

When it happens

Trigger: kubeletConfiguration -> parseKeyValueList(kubeletConfig.EvictionSoft, "<") fails because an entry in spec.kubelet.evictionSoft lacks the '<' separator.

Common situations: Mixing up separators: grace periods use '=' but evictionSoft thresholds use '<'; users copy grace-period syntax into evictionSoft; typos like "memory.available 100Mi" (missing separator entirely).

Related errors


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