kubernetes/kubernetes · error

concurrent-statefulset-syncs must be greater than 0, but got

Error message

concurrent-statefulset-syncs must be greater than 0, but got %d

What it means

Thrown by StatefulSetControllerOptions.Validate() when --concurrent-statefulset-syncs (Int32) is <1. The StatefulSet controller reconciles StatefulSets with strict ordinal ordering per worker; zero workers means StatefulSets never advance. Part of the aggregated validation error slice.

Source

Thrown at cmd/kube-controller-manager/app/options/statefulsetcontroller.go:60

func (o *StatefulSetControllerOptions) ApplyTo(cfg *statefulsetconfig.StatefulSetControllerConfiguration) error {
	if o == nil {
		return nil
	}

	cfg.ConcurrentStatefulSetSyncs = o.ConcurrentStatefulSetSyncs

	return nil
}

// Validate checks validation of StatefulSetControllerOptions.
func (o *StatefulSetControllerOptions) Validate() []error {
	if o == nil {
		return nil
	}

	errs := []error{}
	if o.ConcurrentStatefulSetSyncs < 1 {
		errs = append(errs, fmt.Errorf("concurrent-statefulset-syncs must be greater than 0, but got %d", o.ConcurrentStatefulSetSyncs))
	}
	return errs
}

View on GitHub (pinned to b882c60b40)

Solutions

  1. Set --concurrent-statefulset-syncs to >=1 (default is 5) or remove the flag.
  2. Disable the controller with --controllers=-statefulset if stateful workloads are not used.
  3. Clamp computed concurrency values to a minimum of 1.

Example fix

# before
--concurrent-statefulset-syncs=0
# after
--concurrent-statefulset-syncs=5
Defensive patterns

Strategy: validation

Validate before calling

if opts.StatefulSetController.ConcurrentStatefulSetSyncs < 1 {
    return fmt.Errorf("concurrent-statefulset-syncs must be >= 1")
}

Prevention

When it happens

Trigger: Launching KCM with --concurrent-statefulset-syncs=0 or negative, or a StatefulSetControllerConfiguration component-config with concurrentStatefulSetSyncs: 0.

Common situations: Operators scaling down KCM on small clusters and crossing zero; misconfigured kustomize/Helm patches that null out the field; attempting to disable statefulsets via sync count instead of --controllers.

Related errors


AI-assisted analysis of kubernetes/kubernetes@b882c60b40 (2026-08-07). Data as JSON: /api/errors/2048f13e1f38060b. Report an issue: GitHub.