kubernetes/kops · error

evictionSoftGracePeriod: %w

Error message

evictionSoftGracePeriod: %w

What it means

EvictionSoftGracePeriod is parsed with parseKeyValueList using '=' as separator (e.g. "memory.available=30s"). If any comma-separated entry lacks '=', the parse fails and the error is wrapped as "evictionSoftGracePeriod: %w".

Source

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

	} 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

	if kubeletConfig.EnforceNodeAllocatable != "" {
		cc.EnforceNodeAllocatable = strings.Split(kubeletConfig.EnforceNodeAllocatable, ",")
	}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Ensure every entry is key=value form, e.g. memory.available=30s
  2. Check the wrapped %q pair in the message and add the '=' separator
  3. Do not reuse '<'-style threshold strings in this field
  4. Re-apply the cluster config and re-run nodeup

Example fix

// before
kubelet:
  evictionSoftGracePeriod: "memory.available<30s"
// after
kubelet:
  evictionSoftGracePeriod: "memory.available=30s"
Defensive patterns

Strategy: validation

Validate before calling

func validGracePeriods(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.EvictionSoftGracePeriod, "="); err != nil {
    return fmt.Errorf("evictionSoftGracePeriod must be key=value pairs: %w", err)
}

Prevention

When it happens

Trigger: kubeletConfiguration -> parseKeyValueList(kubeletConfig.EvictionSoftGracePeriod, "=") fails because an entry has no '=' separator.

Common situations: Using '<' (the evictionSoft separator) by mistake in grace period values; omitting the value ("memory.available=" would still pass Cut, but "memory.available" alone fails); copy-paste across fields with different separator conventions.

Related errors


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