Skip to content

Commit ea5cf1c

Browse files
committed
Disallow the use of legacy addons
1 parent 8e4f9d1 commit ea5cf1c

File tree

3 files changed

+16
-5
lines changed

3 files changed

+16
-5
lines changed

addons/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
## Addons
22

3-
Read on [addons](../docs/addons.md)
3+
**Legacy addons are deprecated and unmaintained!!!**
4+
5+
Use [managed addons](../docs/addons.md) instead.

channels/pkg/cmd/apply_channel.go

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import (
2626

2727
"github.com/blang/semver/v4"
2828
"github.com/spf13/cobra"
29+
"k8s.io/klog/v2"
2930
"k8s.io/kops/channels/pkg/channels"
31+
"k8s.io/kops/pkg/apis/kops/util"
3032
"k8s.io/kops/util/pkg/tables"
3133
)
3234

@@ -88,13 +90,20 @@ func RunApplyChannel(ctx context.Context, f Factory, out io.Writer, options *App
8890
// We recognize the following "well-known" format:
8991
// <name> with no slashes ->
9092
if strings.Contains(name, "/") {
91-
return fmt.Errorf("Channel format not recognized (did you mean to use `-f` to specify a local file?): %q", name)
93+
return fmt.Errorf("channel format not recognized (did you mean to use `-f` to specify a local file?): %q", name)
9294
}
9395
expanded := "https://raw.githubusercontent.com/kubernetes/kops/master/addons/" + name + "/addon.yaml"
9496
location, err = url.Parse(expanded)
9597
if err != nil {
9698
return fmt.Errorf("unable to parse expanded argument %q as url", expanded)
9799
}
100+
// Disallow the use of legacy addons from the "well-known" location starting Kubernetes 1.23:
101+
// https://raw.githubusercontent.com/kubernetes/kops/master/addons/<name>/addon.yaml
102+
if util.IsKubernetesGTE("1.23", kubernetesVersion) {
103+
return fmt.Errorf("legacy addons are deprecated and unmaintained, use managed addons instead of %s", expanded)
104+
} else {
105+
klog.Warningf("Legacy addons are deprecated and unmaintained, use managed addons instead of %s", expanded)
106+
}
98107
}
99108
o, err := channels.LoadAddons(name, location)
100109
if err != nil {

docs/releases/1.22-NOTES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ spec:
4040

4141
* Support for Kubernetes versions 1.15 and 1.16 has been removed.
4242

43+
* The legacy addons from `https://github.com/kubernetes/kops/tree/master/addons` have been deprecated and will not be available in Kubernetes 1.23+. Use [managed addons](https://kops.sigs.k8s.io/addons) instead.
44+
4345
* The legacy location for downloads `s3://https://kubeupv2.s3.amazonaws.com/kops/` has been deprecated and will not be used for new releases. The new canonical downloads location is `https://artifacts.k8s.io/binaries/kops/`.
4446

4547
* The `assets` phase of `kops update cluster` has been removed. It is replaced by the new `kops get assets --copy` command.
@@ -76,9 +78,7 @@ spec:
7678

7779
* Support for Ubuntu 18.04 (Bionic) is deprecated and will be removed in future versions of kOps.
7880

79-
* The [manifest based metrics server addon](https://github.com/kubernetes/kops/tree/master/addons/metrics-server) has been deprecated in favour of a configurable addon.
80-
81-
* The [manifest based cluster autoscaler addon](https://github.com/kubernetes/kops/tree/master/addons/cluster-autoscaler) has been deprecated in favour of a configurable addon.
81+
* All legacy addons are deprecated in favor of managed addons, including the [metrics server addon](https://github.com/kubernetes/kops/tree/master/addons/metrics-server) and the [autoscaler addon](https://github.com/kubernetes/kops/tree/master/addons/cluster-autoscaler).
8282

8383
* The `node-role.kubernetes.io/master` and `kubernetes.io/role` labels are deprecated and might be removed from control plane nodes in kOps 1.23.
8484

0 commit comments

Comments
 (0)