{"record":{"id":"44450b6b2f452ef5","repo":"kubernetes/kops","slug":"unexpected-name-for-etcd-cluster-must-start-with","errorCode":null,"errorMessage":"unexpected name for etcd cluster (must start with etcd): %q","messagePattern":"unexpected name for etcd cluster \\(must start with etcd\\): %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/model/components/etcdmanager/model.go","lineNumber":386,"sourceCode":"\t\tif !featureflag.APIServerNodes.Enabled() {\n\t\t\tclientHost = b.Cluster.APIInternalName()\n\t\t}\n\n\tcase \"leases\":\n\t\t// ok\n\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown etcd cluster key %q\", etcdCluster.Name)\n\t}\n\n\tif backupStore == \"\" {\n\t\treturn nil, fmt.Errorf(\"backupStore must be set for use with etcd-manager\")\n\t}\n\n\tname := clusterName\n\tif !strings.HasPrefix(name, \"etcd\") {\n\t\t// For sanity, and to avoid collisions in directories / dns\n\t\treturn nil, fmt.Errorf(\"unexpected name for etcd cluster (must start with etcd): %q\", name)\n\t}\n\tlogFile := \"/var/log/\" + name + \".log\"\n\n\tconfig := &config{\n\t\tContainerized: true,\n\t\tClusterName:   clusterName,\n\t\tBackupStore:   backupStore,\n\t\tGrpcPort:      ports.GRPCPort,\n\t\tDNSSuffix:     dnsInternalSuffix,\n\t}\n\n\t// Rewrite to the legacy URL shape for the pinned etcd-manager image; see\n\t// resolveAzureBackupStore.\n\tlegacyBackupStore, azureStorageAccount, err := resolveAzureBackupStore(b.Cluster.Spec.ConfigStore.Base, backupStore)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tconfig.BackupStore = legacyBackupStore","sourceCodeStart":368,"sourceCodeEnd":404,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/pkg/model/components/etcdmanager/model.go#L368-L404","documentation":"etcd-manager derives log paths, directories, and DNS names from the cluster name, so buildPod enforces that clusterName starts with 'etcd' to prevent directory/DNS collisions and keep naming sane. Names like 'events' or 'main' fail this prefix check.","triggerScenarios":"buildManifest -> buildPod with an etcdCluster whose name (after normalization) does not begin with 'etcd', e.g. Name: 'events' or 'mainetcd'.","commonSituations":"Users abbreviating cluster names ('etcd' -> 'db', 'events' -> 'ev'); specs generated by tooling that dropped the prefix; typos like 'etc-main'.","solutions":["Rename the etcdClusters entries to the canonical 'etcd' and 'etcd-events'.","Fix upstream spec generators to always prefix names with 'etcd'.","If migrating an old cluster, rename via `kops replace` with a corrected spec."],"exampleFix":"// before\n- name: events\n  ...\n// after\n- name: etcd-events\n  ...","handlingStrategy":"validation","validationCode":"for _, c := range spec.EtcdClusters {\n\tif !strings.HasPrefix(c.Name, \"etcd\") {\n\t\treturn fmt.Errorf(\"etcd cluster %q must start with 'etcd'\", c.Name)\n\t}\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use the exact canonical names 'etcd' and 'etcd-events'.","Add naming lint to spec-generation pipelines.","Watch for typos like 'etc-' when hand-editing YAML."],"tags":["kops","etcd-manager","naming","validation"],"backgroundTag":"invalid-resource-name-prefix","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}