mirror of https://github.com/kubernetes/kops.git
Merge pull request #10361 from hakman/single-az-multi-master
Prefix etcd cluster names with letters
This commit is contained in:
commit
2e202badc5
|
|
@ -16,21 +16,21 @@ spec:
|
|||
- cpuRequest: 200m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a-1
|
||||
name: "1"
|
||||
name: etcd-1
|
||||
- instanceGroup: master-us-test-1a-2
|
||||
name: "2"
|
||||
name: etcd-2
|
||||
- instanceGroup: master-us-test-1a-3
|
||||
name: "3"
|
||||
name: etcd-3
|
||||
memoryRequest: 100Mi
|
||||
name: main
|
||||
- cpuRequest: 100m
|
||||
etcdMembers:
|
||||
- instanceGroup: master-us-test-1a-1
|
||||
name: "1"
|
||||
name: etcd-1
|
||||
- instanceGroup: master-us-test-1a-2
|
||||
name: "2"
|
||||
name: etcd-2
|
||||
- instanceGroup: master-us-test-1a-3
|
||||
name: "3"
|
||||
name: etcd-3
|
||||
memoryRequest: 100Mi
|
||||
name: events
|
||||
iam:
|
||||
|
|
|
|||
|
|
@ -736,6 +736,13 @@ func trimCommonPrefix(names []string) []string {
|
|||
}
|
||||
}
|
||||
|
||||
for i := range names {
|
||||
_, err := strconv.Atoi(names[i])
|
||||
if err == nil {
|
||||
names[i] = "etcd-" + names[i]
|
||||
}
|
||||
}
|
||||
|
||||
return names
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,10 @@ func TestRemoveSharedPrefix(t *testing.T) {
|
|||
Input: []string{"zza", "zzb", ""},
|
||||
Output: []string{"zza", "zzb", ""},
|
||||
},
|
||||
{
|
||||
Input: []string{"us-test-1a-1", "us-test-1a-2", "us-test-1a-3"},
|
||||
Output: []string{"etcd-1", "etcd-2", "etcd-3"},
|
||||
},
|
||||
{
|
||||
Input: []string{"us-test-1a-1", "us-test-1b-1", "us-test-1a-2", "us-test-1b-2", "us-test-1a-3"},
|
||||
Output: []string{"a-1", "b-1", "a-2", "b-2", "a-3"},
|
||||
|
|
|
|||
Loading…
Reference in New Issue