kubernetes/kops · error
kops upgrade is required
Error message
kops upgrade is required
What it means
validateKopsVersion checks the kops binary's own version against the requirements in the cluster's channel file. If the channel marks the running kops version as requiring an upgrade (too old / no longer supported), apply is refused with 'kops upgrade is required' — unless the KOPS_RUN_OBSOLETE_VERSION env var is set.
Source
Thrown at upup/pkg/fi/cloudup/apply_cluster.go:966
fmt.Printf("\n")
fmt.Printf("%s\n", starline)
fmt.Printf("\n")
if recommended != nil {
fmt.Printf("a new kops version is available: %s\n", recommended)
}
fmt.Println("")
fmt.Printf("This version of kops (%s) is no longer supported; upgrading is required\n", kopsbase.Version)
fmt.Printf("(you can bypass this check by exporting KOPS_RUN_OBSOLETE_VERSION)\n")
fmt.Println("")
fmt.Printf("More information: %s\n", buildPermalink("upgrade_kops", recommended.String()))
fmt.Printf("\n")
fmt.Printf("%s\n", starline)
fmt.Printf("\n")
}
if required {
if os.Getenv("KOPS_RUN_OBSOLETE_VERSION") == "" {
return fmt.Errorf("kops upgrade is required")
}
}
return nil
}
// validateKubernetesVersion ensures that kubernetes meet the version requirements / recommendations in the channel
func (c *ApplyClusterCmd) validateKubernetesVersion() error {
parsed, err := util.ParseKubernetesVersion(c.Cluster.Spec.KubernetesVersion)
if err != nil {
klog.Warningf("unable to parse kubernetes version %q", c.Cluster.Spec.KubernetesVersion)
// Not a hard-error
return nil
}
kopsVersion, err := semver.Parse(kopsbase.Version)
if err != nil {
klog.Warningf("unable to parse kops version %q", kopsVersion)View on GitHub (pinned to 4c8573c808)
Solutions
- Upgrade the kops binary to the latest release (https://github.com/kubernetes/kops/releases), then re-run
- Temporarily bypass with: export KOPS_RUN_OBSOLETE_VERSION=1 (not recommended for production)
- Pin to a supported kops version in CI matching your cluster channel
- Follow the permalink printed above the error (upgrade_kops) for version guidance
Example fix
// before kops update cluster mycluster.example.com # kops 1.24 (retired by channel) // after curl -LO https://github.com/kubernetes/kops/releases/download/v1.31.0/kops-linux-amd64 sudo install kops-linux-amd64 /usr/local/bin/kops kops update cluster mycluster.example.com
Defensive patterns
Strategy: validation
Validate before calling
// pin and verify the kops binary version before applying
v, err := exec.Command("kops", "version").Output()
if err != nil || !supportedKopsVersion(string(v)) {
return fmt.Errorf("upgrade kops binary before applying")
} Try / catch
if err := cmd.Run(ctx); err != nil && strings.Contains(err.Error(), "kops upgrade is required") {
// upgrade the kops binary; only set KOPS_RUN_OBSOLETE_VERSION=1 for testing
} Prevention
- Keep the kops binary current with the latest release
- Pin a supported kops version in CI images and update it regularly
- Re-check kops version after channel/stable updates
- Never rely on KOPS_RUN_OBSOLETE_VERSION in production pipelines
When it happens
Trigger: Running `kops update cluster` (or apply/GetAssetBuilder paths) with a kops binary version that the channel's kopsVersions spec marks as required-to-upgrade, with KOPS_RUN_OBSOLETE_VERSION unset.
Common situations: Using an EOL kops release months/years old; channel file updated to retire old kops versions while users still run stale binaries; CI pipelines pinning an outdated kops version; air-gapped clusters that never upgraded.
Related errors
- kubernetes upgrade is required
- building menu for %q: %w
- error loading channel %q: %v
- invalid channel location: %q
- invalid base channel location: %q
AI-assisted analysis of kubernetes/kops@4c8573c808 (2026-09-05).
Data as JSON: /api/errors/ac7747c89f3331b7.
Report an issue: GitHub.