kubernetes/kops · error

LeaderElectionTimeout not supported by etcd-manager

Error message

LeaderElectionTimeout not supported by etcd-manager

What it means

etcdCluster.LeaderElectionTimeout is a legacy (non-manager) etcd tuning knob. etcd-manager does not wire it into its spec, so instead of silently ignoring it, buildPod returns this error to force the user to remove the field.

Source

Thrown at pkg/model/components/etcdmanager/model.go:439

	{
		// Determine scheme: HTTPS by default, but allow HTTP for events cluster
		// when EtcdEventsHTTP feature flag is enabled
		scheme := "https"
		if etcdCluster.Name == "events" && featureflag.EtcdEventsHTTP.Enabled() {
			scheme = "http"
			config.EtcdInsecure = new(true)
			klog.Warningf("etcd cluster %q is configured with TLS disabled (HTTP) via KOPS_FEATURE_FLAGS=EtcdEventsHTTP. This is for experiments only.", etcdCluster.Name)
		}

		config.PeerUrls = fmt.Sprintf("%s://__name__:%d", scheme, ports.PeerPort)
		config.ClientUrls = fmt.Sprintf("%s://%s:%d", scheme, clientHost, ports.ClientPort)
		config.QuarantineClientUrls = fmt.Sprintf("%s://__name__:%d", scheme, ports.QuarantinedGRPCPort)

		// TODO: We need to wire these into the etcd-manager spec
		// // add timeout/heartbeat settings
		if etcdCluster.LeaderElectionTimeout != nil {
			//      envs = append(envs, v1.EnvVar{Name: "ETCD_ELECTION_TIMEOUT", Value: convEtcdSettingsToMs(etcdClusterSpec.LeaderElectionTimeout)})
			return nil, fmt.Errorf("LeaderElectionTimeout not supported by etcd-manager")
		}
		if etcdCluster.HeartbeatInterval != nil {
			//      envs = append(envs, v1.EnvVar{Name: "ETCD_HEARTBEAT_INTERVAL", Value: convEtcdSettingsToMs(etcdClusterSpec.HeartbeatInterval)})
			return nil, fmt.Errorf("HeartbeatInterval not supported by etcd-manager")
		}
	}

	{
		switch b.Cluster.GetCloudProvider() {
		case kops.CloudProviderAWS:
			config.VolumeProvider = "aws"

			config.VolumeTag = []string{
				fmt.Sprintf("kubernetes.io/cluster/%s=owned", b.Cluster.Name),
				awsup.TagNameEtcdClusterPrefix + etcdCluster.Name,
				awsup.TagNameRolePrefix + "control-plane=1",
			}
			config.VolumeNameTag = awsup.TagNameEtcdClusterPrefix + etcdCluster.Name

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Remove `leaderElectionTimeout` from the etcdCluster spec and re-run `kops update cluster`.
  2. If tuning is needed, manage election timeout via etcd-manager's own configuration/override mechanism.
  3. Confirm the cluster is manager-based (`kops get cluster -o yaml` shows no etcdManager bypass) — the field is only meaningful for legacy etcd.

Example fix

// before
etcdClusters:
- name: etcd
  leaderElectionTimeout: 2s
  ...
// after
etcdClusters:
- name: etcd
  ...
Defensive patterns

Strategy: validation

Validate before calling

for _, c := range spec.EtcdClusters {
	if c.LeaderElectionTimeout != nil {
		return fmt.Errorf("leaderElectionTimeout must be removed for etcd-manager clusters")
	}
}

Prevention

When it happens

Trigger: Spec contains `etcdClusters[].leaderElectionTimeout` while the cluster uses etcd-manager; detected during `kops update cluster` model build.

Common situations: Cluster spec carried over from pre-etcd-manager kOps versions; docs/blog snippets with etcd tuning copied into a manager-based cluster.

Understand the failure class

Related errors


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