kubernetes/kops · error

error writing updated addon configuration: %v

Error message

error writing updated addon configuration: %v

What it means

CreateClusterConfig finishes by replacing the cluster's addon manifests through addonsClient.Replace(addons). If that write fails, the error is wrapped as "error writing updated addon configuration". At this point the cluster and all instance groups have already been written, so only addon registration in the state store failed.

Source

Thrown at pkg/apis/kops/registry/helpers.go:60

	}

	_, err := clientset.CreateCluster(ctx, cluster)
	if err != nil {
		return err
	}

	for _, ig := range groups {
		_, err = clientset.InstanceGroupsFor(cluster).Create(ctx, ig, metav1.CreateOptions{})
		if err != nil {
			return fmt.Errorf("error writing updated instancegroup configuration: %v", err)
		}
	}

	{
		addonsClient := clientset.AddonsFor(cluster)

		if err := addonsClient.Replace(addons); err != nil {
			return fmt.Errorf("error writing updated addon configuration: %v", err)
		}
	}

	return nil
}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Check the wrapped cause and validate state-store access: run `kops get cluster <name>` and confirm write permissions on the state bucket/prefix.
  2. Re-run the command; Replace is idempotent since it overwrites the addon manifest, so a retry after fixing connectivity is safe.
  3. If credentials are the cause, refresh them (aws sso login / new session) and ensure the bucket policy allows PutObject for the addons prefix.
  4. As a last resort, delete the addons key under the cluster state path and re-run `kops create cluster` or `kops update cluster` to repopulate it.
Defensive patterns

Strategy: retry

Validate before calling

// verify addons path is writable before Replace
addonPath, err := ConfigBase(vfs.Context, cluster)
if err != nil {
	return err // state store base malformed/missing
}
if _, err := addonPath.Join("addons").ReadTree(); err != nil && !os.IsNotExist(err) {
	return fmt.Errorf("addons path not readable: %v", err)
}

Try / catch

err := addonsClient.Replace(addons)
if err != nil {
	if isTransient(err) { // network/5xx/throttle
		err = retry.Do(3, backoff, func() error { return addonsClient.Replace(addons) })
	}
	if err != nil {
		return fmt.Errorf("error writing updated addon configuration: %v", err)
	}
}

Prevention

When it happens

Trigger: Calling CreateClusterConfig when the addons VFS path under the cluster's state store cannot be written: bad state-store permissions/credentials, missing kopsAddon files in the addon path, or an underlying storage error (S3 throttling, network failure).

Common situations: AWS credentials lacking s3:PutObject on the state bucket; transient S3 5xx during `kops create cluster`; a corrupted/locked addons manifest left by a previous failed run; read-only mounted file-backed state store.

Related errors


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