Mark control-plane node for update when etcd volume size changes

etcd-manager expands the data volume on restart to the max available.
This commit is contained in:
Ciprian Hacman 2021-05-01 12:06:22 +03:00
parent 3704ffd2c9
commit d64cfba365
6 changed files with 28 additions and 11 deletions

View File

@ -326,16 +326,19 @@ func (b *BootstrapScript) Run(c *fi.Context) error {
for _, etcdCluster := range cs.EtcdClusters { for _, etcdCluster := range cs.EtcdClusters {
c := kops.EtcdClusterSpec{ c := kops.EtcdClusterSpec{
Image: etcdCluster.Image, Image: etcdCluster.Image,
Version: etcdCluster.Version, Version: etcdCluster.Version,
CPURequest: etcdCluster.CPURequest,
MemoryRequest: etcdCluster.MemoryRequest,
} }
// if the user has not specified memory or cpu allotments for etcd, do not for _, etcdMember := range etcdCluster.Members {
// apply one. Described in PR #6313. if fi.StringValue(etcdMember.InstanceGroup) == b.ig.Name && etcdMember.VolumeSize != nil {
if etcdCluster.CPURequest != nil { m := kops.EtcdMemberSpec{
c.CPURequest = etcdCluster.CPURequest Name: etcdMember.Name,
} VolumeSize: etcdMember.VolumeSize,
if etcdCluster.MemoryRequest != nil { }
c.MemoryRequest = etcdCluster.MemoryRequest c.Members = append(c.Members, m)
}
} }
spec["etcdClusters"].(map[string]kops.EtcdClusterSpec)[etcdCluster.Name] = c spec["etcdClusters"].(map[string]kops.EtcdClusterSpec)[etcdCluster.Name] = c
} }

View File

@ -829,7 +829,7 @@
"Type": "AWS::EC2::Volume", "Type": "AWS::EC2::Volume",
"Properties": { "Properties": {
"AvailabilityZone": "us-test-1a", "AvailabilityZone": "us-test-1a",
"Size": 20, "Size": 50,
"VolumeType": "gp3", "VolumeType": "gp3",
"Iops": 5000, "Iops": 5000,
"Throughput": 125, "Throughput": 125,

View File

@ -164,8 +164,14 @@ Resources.AWSEC2LaunchTemplatemasterustest1amastersminimalexamplecom.Properties.
encryptionConfig: null encryptionConfig: null
etcdClusters: etcdClusters:
events: events:
etcdMembers:
- name: us-test-1a
volumeSize: 20
version: 3.4.13 version: 3.4.13
main: main:
etcdMembers:
- name: us-test-1a
volumeSize: 50
version: 3.4.13 version: 3.4.13
kubeAPIServer: kubeAPIServer:
allowPrivileged: true allowPrivileged: true

View File

@ -163,8 +163,14 @@ docker:
encryptionConfig: null encryptionConfig: null
etcdClusters: etcdClusters:
events: events:
etcdMembers:
- name: us-test-1a
volumeSize: 20
version: 3.4.13 version: 3.4.13
main: main:
etcdMembers:
- name: us-test-1a
volumeSize: 50
version: 3.4.13 version: 3.4.13
kubeAPIServer: kubeAPIServer:
allowPrivileged: true allowPrivileged: true

View File

@ -14,12 +14,14 @@ spec:
- instanceGroup: master-us-test-1a - instanceGroup: master-us-test-1a
name: us-test-1a name: us-test-1a
volumeIops: 5000 volumeIops: 5000
volumeSize: 50
volumeThroughput: 125 volumeThroughput: 125
volumeType: gp3 volumeType: gp3
name: main name: main
- etcdMembers: - etcdMembers:
- instanceGroup: master-us-test-1a - instanceGroup: master-us-test-1a
name: us-test-1a name: us-test-1a
volumeSize: 20
volumeType: gp3 volumeType: gp3
name: events name: events
iam: {} iam: {}

View File

@ -211,7 +211,7 @@ resource "aws_ebs_volume" "us-test-1a-etcd-main-minimal-example-com" {
availability_zone = "us-test-1a" availability_zone = "us-test-1a"
encrypted = false encrypted = false
iops = 5000 iops = 5000
size = 20 size = 50
tags = { tags = {
"KubernetesCluster" = "minimal.example.com" "KubernetesCluster" = "minimal.example.com"
"Name" = "us-test-1a.etcd-main.minimal.example.com" "Name" = "us-test-1a.etcd-main.minimal.example.com"