From 1fb8a03186350d113422fdd42355ec5046a1445d Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 20 Dec 2019 20:37:03 -0600 Subject: [PATCH 1/2] Add deprecation warning for older k8s versions As discussed during yesterday's office hours. This should be cherry-picked back to 1.16. We'll need to bump the minor version in the 1.17 and master branches. Once we officially drop support we could make this a sliding window that uses the `kops.Version` variable. I think we could have deprecation warnings for the 2 oldest versions still supported by the kops version, announcing that the n+2 Kops version will no longer support the specified k8s version. --- permalinks/upgrade_k8s.md | 6 ++++++ upup/pkg/fi/cloudup/apply_cluster.go | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/permalinks/upgrade_k8s.md b/permalinks/upgrade_k8s.md index f0678ea96d3f5..ee6907f5c3f5a 100644 --- a/permalinks/upgrade_k8s.md +++ b/permalinks/upgrade_k8s.md @@ -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. \ No newline at end of file diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index 5f1faf4290a8e..8f1b91c0944f1 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -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 { @@ -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_kops", "")) + fmt.Printf("\n") + fmt.Printf(starline) + fmt.Printf("\n") + + } + // TODO: make util.ParseKubernetesVersion not return a pointer kubernetesVersion := *parsed From 699bbaab5e3979c98810d65d3d0c019a62e09687 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Fri, 27 Dec 2019 17:41:55 -0800 Subject: [PATCH 2/2] Fix link printed in k8s version deprecation message --- upup/pkg/fi/cloudup/apply_cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/upup/pkg/fi/cloudup/apply_cluster.go b/upup/pkg/fi/cloudup/apply_cluster.go index 8f1b91c0944f1..fb417d59e0ccf 100644 --- a/upup/pkg/fi/cloudup/apply_cluster.go +++ b/upup/pkg/fi/cloudup/apply_cluster.go @@ -1053,7 +1053,7 @@ func (c *ApplyClusterCmd) validateKubernetesVersion() error { 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_kops", "")) + fmt.Printf("More information: %s\n", buildPermalink("upgrade_k8s", "")) fmt.Printf("\n") fmt.Printf(starline) fmt.Printf("\n")