kubernetes/kops · error

SizeGB cannot be decreased

Error message

SizeGB cannot be decreased

What it means

Volume.CheckChanges returns this error when a kOps update tries to shrink an existing Linode volume. Linode (like most block storage APIs) does not support shrinking volumes, so the task refuses the change before calling the API.

Source

Thrown at upup/pkg/fi/cloudup/linodetasks/volume.go:101

func (v *Volume) Run(c *fi.CloudupContext) error {
	return fi.CloudupDefaultDeltaRunMethod(v, c)
}

func (_ *Volume) CheckChanges(actual, expected, changes *Volume) error {
	if actual != nil {
		if changes.ID != nil {
			return fi.CannotChangeField("ID")
		}
		if changes.Name != nil {
			return fi.CannotChangeField("Name")
		}
		if changes.Region != nil {
			return fi.CannotChangeField("Region")
		}
		if changes.SizeGB != nil {
			if fi.ValueOf(expected.SizeGB) < fi.ValueOf(actual.SizeGB) {
				return fmt.Errorf("SizeGB cannot be decreased")
			}
		}
		if changes.Tags != nil {
			return fi.CannotChangeField("Tags")
		}
	} else {
		if expected.Name == nil {
			return fi.RequiredField("Name")
		}
		if expected.Region == nil {
			return fi.RequiredField("Region")
		}
		if expected.SizeGB == nil {
			return fi.RequiredField("SizeGB")
		}
		if fi.ValueOf(expected.SizeGB) < 10 {
			return fmt.Errorf("SizeGB must be at least 10 GB")
		}

View on GitHub (pinned to 4c8573c808)

Solutions

  1. Restore the volume size in the spec to be >= the current volume size
  2. If shrinkage is truly needed, create a new larger-capacity-compatible workflow: snapshot/copy data, delete the old volume, and create a new one at the smaller size (data loss risk)
  3. Keep volume sizes immutable in your provisioning pipeline to avoid accidental shrink requests

Example fix

// before (cluster spec)
volumeSize: 50   # existing volume is 100 GB
// after
volumeSize: 100  # only increases are allowed
Defensive patterns

Strategy: validation

Validate before calling

// before applying a spec change
if desired.VolumeSize < currentVolumeSizeGB {
  return fmt.Errorf("cannot shrink volume from %d to %d GB; volumes only grow", currentVolumeSizeGB, desired.VolumeSize)
}

Prevention

When it happens

Trigger: During an update, changes.SizeGB != nil and fi.ValueOf(expected.SizeGB) < fi.ValueOf(actual.SizeGB) — the spec's new size is smaller than the existing volume's size.

Common situations: An operator reduced the volumeSize in the cluster spec or a template and applied the update to an existing cluster; a template generated with a smaller default was reused for a cluster with a larger volume.

Related errors


AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05). Data as JSON: /api/errors/bb3aedb5316ebf67. Report an issue: GitHub.