Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated cherry pick of #8176 and #8209: Add deprecation warning for older k8s versions #8206

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions permalinks/upgrade_k8s.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Kubernetes Upgrade Recommended

Kops has established a deprecation policy for Kubernetes version support.
Kops 1.18 will drop support for Kubernetes 1.8 and below.


You are running a version of kubernetes that we recommend upgrading.

Please see the [instructions for how to upgrade kubernetes](https://kops.sigs.k8s.io/operations/updates_and_upgrades/#upgrading-kubernetes)

Please see the deprecation policy [GitHub issue](https://github.com/kubernetes/kops/issues/7999) for more information and to leave feedback.
16 changes: 16 additions & 0 deletions upup/pkg/fi/cloudup/apply_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ var (
AlphaAllowALI = featureflag.New("AlphaAllowALI", featureflag.Bool(false))
// CloudupModels a list of supported models
CloudupModels = []string{"proto", "cloudup"}
// OldestSupportedKubernetesVersion is the oldest kubernetes version that is supported in Kops
OldestSupportedKubernetesVersion = "1.9.0"
)

type ApplyClusterCmd struct {
Expand Down Expand Up @@ -1044,6 +1046,20 @@ func (c *ApplyClusterCmd) validateKubernetesVersion() error {
return nil
}

if !util.IsKubernetesGTE(OldestSupportedKubernetesVersion, *parsed) {
fmt.Printf("\n")
fmt.Printf(starline)
fmt.Printf("\n")
fmt.Printf("Kops support for this Kubernetes version is deprecated and will be removed in a future release.\n")
fmt.Printf("\n")
fmt.Printf("Upgrading is recommended\n")
fmt.Printf("More information: %s\n", buildPermalink("upgrade_k8s", ""))
fmt.Printf("\n")
fmt.Printf(starline)
fmt.Printf("\n")

}

// TODO: make util.ParseKubernetesVersion not return a pointer
kubernetesVersion := *parsed

Expand Down