mirror of https://github.com/kubernetes/kops.git
Refactor LaunchTemplate.RootVolumeIops
This commit is contained in:
parent
01a55812ac
commit
436dbe8435
|
|
@ -160,9 +160,9 @@ func (b *AutoscalingGroupModelBuilder) buildLaunchTemplateTask(c *fi.ModelBuilde
|
||||||
InstanceInterruptionBehavior: ig.Spec.InstanceInterruptionBehavior,
|
InstanceInterruptionBehavior: ig.Spec.InstanceInterruptionBehavior,
|
||||||
InstanceMonitoring: ig.Spec.DetailedInstanceMonitoring,
|
InstanceMonitoring: ig.Spec.DetailedInstanceMonitoring,
|
||||||
InstanceType: fi.String(strings.Split(ig.Spec.MachineType, ",")[0]),
|
InstanceType: fi.String(strings.Split(ig.Spec.MachineType, ",")[0]),
|
||||||
|
RootVolumeIops: fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops))),
|
||||||
RootVolumeOptimization: lc.RootVolumeOptimization,
|
RootVolumeOptimization: lc.RootVolumeOptimization,
|
||||||
RootVolumeSize: lc.RootVolumeSize,
|
RootVolumeSize: lc.RootVolumeSize,
|
||||||
RootVolumeIops: lc.RootVolumeIops,
|
|
||||||
RootVolumeType: fi.String(rootVolumeType),
|
RootVolumeType: fi.String(rootVolumeType),
|
||||||
RootVolumeEncryption: lc.RootVolumeEncryption,
|
RootVolumeEncryption: lc.RootVolumeEncryption,
|
||||||
SSHKey: lc.SSHKey,
|
SSHKey: lc.SSHKey,
|
||||||
|
|
@ -242,20 +242,18 @@ func (b *AutoscalingGroupModelBuilder) buildLaunchTemplateTask(c *fi.ModelBuilde
|
||||||
if rootVolumeType == ec2.VolumeTypeIo1 || rootVolumeType == ec2.VolumeTypeIo2 {
|
if rootVolumeType == ec2.VolumeTypeIo1 || rootVolumeType == ec2.VolumeTypeIo2 {
|
||||||
if fi.Int32Value(ig.Spec.RootVolumeIops) < 100 {
|
if fi.Int32Value(ig.Spec.RootVolumeIops) < 100 {
|
||||||
lt.RootVolumeIops = fi.Int64(int64(DefaultVolumeIonIops))
|
lt.RootVolumeIops = fi.Int64(int64(DefaultVolumeIonIops))
|
||||||
} else {
|
|
||||||
lt.RootVolumeIops = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops)))
|
|
||||||
}
|
}
|
||||||
} else if rootVolumeType == ec2.VolumeTypeGp3 {
|
} else if rootVolumeType == ec2.VolumeTypeGp3 {
|
||||||
if fi.Int32Value(ig.Spec.RootVolumeIops) < 3000 {
|
if fi.Int32Value(ig.Spec.RootVolumeIops) < 3000 {
|
||||||
lt.RootVolumeIops = fi.Int64(int64(DefaultVolumeGp3Iops))
|
lt.RootVolumeIops = fi.Int64(int64(DefaultVolumeGp3Iops))
|
||||||
} else {
|
|
||||||
lt.RootVolumeIops = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeIops)))
|
|
||||||
}
|
}
|
||||||
if fi.Int32Value(ig.Spec.RootVolumeThroughput) < 125 {
|
if fi.Int32Value(ig.Spec.RootVolumeThroughput) < 125 {
|
||||||
lt.RootVolumeThroughput = fi.Int64(int64(DefaultVolumeGp3Throughput))
|
lt.RootVolumeThroughput = fi.Int64(int64(DefaultVolumeGp3Throughput))
|
||||||
} else {
|
} else {
|
||||||
lt.RootVolumeThroughput = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeThroughput)))
|
lt.RootVolumeThroughput = fi.Int64(int64(fi.Int32Value(ig.Spec.RootVolumeThroughput)))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
lt.RootVolumeIops = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// When using a MixedInstances ASG, AWS requires the SpotPrice be defined on the ASG
|
// When using a MixedInstances ASG, AWS requires the SpotPrice be defined on the ASG
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue