mirror of https://github.com/kubernetes/kops.git
Add iops field for gp3 volumes only with launch templates
This commit is contained in:
parent
3b24a11b30
commit
85fbf1c6a2
|
|
@ -160,7 +160,12 @@ func (b *AutoscalingGroupModelBuilder) buildLaunchTemplateTask(c *fi.ModelBuilde
|
|||
} else {
|
||||
lt.RootVolumeKmsKey = fi.String("")
|
||||
}
|
||||
if fi.StringValue(ig.Spec.RootVolumeType) == ec2.VolumeTypeGp3 {
|
||||
if fi.StringValue(lt.RootVolumeType) == ec2.VolumeTypeGp3 {
|
||||
if fi.Int32Value(ig.Spec.RootVolumeIops) < 3000 {
|
||||
lt.RootVolumeIops = fi.Int64(int64(DefaultVolumeGp3Iops))
|
||||
} else {
|
||||
lt.RootVolumeIops = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops)))
|
||||
}
|
||||
if fi.Int32Value(ig.Spec.RootVolumeThroughput) < 125 {
|
||||
lt.RootVolumeThroughput = fi.Int64(int64(DefaultVolumeGp3Throughput))
|
||||
} else {
|
||||
|
|
@ -259,12 +264,6 @@ func (b *AutoscalingGroupModelBuilder) buildLaunchConfigurationTask(c *fi.ModelB
|
|||
} else {
|
||||
t.RootVolumeIops = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops)))
|
||||
}
|
||||
} else if volumeType == ec2.VolumeTypeGp3 {
|
||||
if fi.Int32Value(ig.Spec.RootVolumeIops) < 3000 {
|
||||
t.RootVolumeIops = fi.Int64(int64(DefaultVolumeGp3Iops))
|
||||
} else {
|
||||
t.RootVolumeIops = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops)))
|
||||
}
|
||||
}
|
||||
|
||||
if ig.Spec.Tenancy != "" {
|
||||
|
|
|
|||
Loading…
Reference in New Issue