mirror of https://github.com/k3s-io/k3s
Update the dynamic volume limit in GCE PD
Currently GCE PD support 128 maximum disks attached to a node for all machines types except shared-core. This PR updates the limit number to date. Change-Id: Id9dfdbd24763b6b4138935842c246b1803838b78pull/564/head
parent
803a14d47a
commit
b01e2a387d
|
@ -64,11 +64,7 @@ const (
|
|||
// persistent disks that can be attached to an instance. Please refer to gcloud doc
|
||||
// https://cloud.google.com/compute/docs/disks/#increased_persistent_disk_limits
|
||||
const (
|
||||
OneCPU = 1
|
||||
EightCPUs = 8
|
||||
VolumeLimit16 = 16
|
||||
VolumeLimit32 = 32
|
||||
VolumeLimit64 = 64
|
||||
VolumeLimit128 = 128
|
||||
)
|
||||
|
||||
|
@ -152,22 +148,12 @@ func (plugin *gcePersistentDiskPlugin) GetVolumeLimits() (map[string]int64, erro
|
|||
klog.Errorf("Failed to get instance type from GCE cloud provider")
|
||||
return volumeLimits, nil
|
||||
}
|
||||
if strings.HasPrefix(instanceType, "n1-") {
|
||||
splits := strings.Split(instanceType, "-")
|
||||
if len(splits) < 3 {
|
||||
return volumeLimits, nil
|
||||
}
|
||||
last := splits[2]
|
||||
if num, err := strconv.Atoi(last); err == nil {
|
||||
if num == OneCPU {
|
||||
volumeLimits[util.GCEVolumeLimitKey] = VolumeLimit32
|
||||
} else if num < EightCPUs {
|
||||
volumeLimits[util.GCEVolumeLimitKey] = VolumeLimit64
|
||||
} else {
|
||||
volumeLimits[util.GCEVolumeLimitKey] = VolumeLimit128
|
||||
}
|
||||
}
|
||||
if strings.HasPrefix(instanceType, "n1-") || strings.HasPrefix(instanceType, "custom-") {
|
||||
volumeLimits[util.GCEVolumeLimitKey] = VolumeLimit128
|
||||
} else {
|
||||
volumeLimits[util.GCEVolumeLimitKey] = VolumeLimit16
|
||||
}
|
||||
|
||||
return volumeLimits, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue