From e8ede32ae7e2a601d101688563141ecab5885e3c Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Thu, 17 Aug 2023 21:24:13 -0500 Subject: [PATCH] Stop installing misc utils on RHEL distros --- docs/releases/1.28-NOTES.md | 2 ++ nodeup/pkg/model/miscutils.go | 66 ----------------------------------- upup/pkg/fi/nodeup/command.go | 1 - 3 files changed, 2 insertions(+), 67 deletions(-) delete mode 100644 nodeup/pkg/model/miscutils.go diff --git a/docs/releases/1.28-NOTES.md b/docs/releases/1.28-NOTES.md index 3ed9a4c1cb..88b023a0d1 100644 --- a/docs/releases/1.28-NOTES.md +++ b/docs/releases/1.28-NOTES.md @@ -28,6 +28,8 @@ This is a document to gather the release notes prior to the release. * Support for Canal, Flannel, and Kube-Router has been removed for Kubernetes 1.28 and later. +* RHEL-based distros will no longer have `wget`, `curl`, `python2`, and `git` packages installed. Install them with [hooks](/cluster_spec/#hooks) if needed. + # Deprecations * Support for Kubernetes version 1.23 is deprecated and will be removed in kOps 1.29. diff --git a/nodeup/pkg/model/miscutils.go b/nodeup/pkg/model/miscutils.go deleted file mode 100644 index cfd2c6e658..0000000000 --- a/nodeup/pkg/model/miscutils.go +++ /dev/null @@ -1,66 +0,0 @@ -/* -Copyright 2019 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package model - -import ( - "k8s.io/klog/v2" - "k8s.io/kops/upup/pkg/fi" - "k8s.io/kops/upup/pkg/fi/nodeup/nodetasks" - "k8s.io/kops/util/pkg/distributions" -) - -// MiscUtilsBuilder ensures that some system packages that are -// required for kubernetes are installed (e.g. socat) -type MiscUtilsBuilder struct { - *NodeupModelContext -} - -var _ fi.NodeupModelBuilder = &MiscUtilsBuilder{} - -// Build is responsible for configuring the miscellaneous packages we want installed -func (b *MiscUtilsBuilder) Build(c *fi.NodeupModelBuilderContext) error { - switch b.Distribution { - case distributions.DistributionContainerOS: - klog.V(2).Infof("Detected ContainerOS; won't install misc. utils") - return nil - case distributions.DistributionFlatcar: - klog.V(2).Infof("Detected Flatcar; won't install misc. utils") - return nil - } - - var packages []string - if b.Distribution.IsRHELFamily() { - // TODO: These packages have been auto-installed for a long time, and likely we don't need all of them any longer - packages = append(packages, "wget") - if b.Distribution != distributions.DistributionAmazonLinux2023 && b.Distribution != distributions.DistributionRhel9 { - packages = append(packages, "curl") - packages = append(packages, "python2") - } - packages = append(packages, "git") - } else if b.Distribution.IsDebianFamily() { - klog.V(2).Infof("Detected debian; won't install misc. utils") - } else { - klog.Warningf("unknown distribution, skipping misc utils install: %v", b.Distribution) - return nil - } - - for _, p := range packages { - c.AddTask(&nodetasks.Package{Name: p}) - } - - return nil -} diff --git a/upup/pkg/fi/nodeup/command.go b/upup/pkg/fi/nodeup/command.go index cd5f656b1a..41eb58733b 100644 --- a/upup/pkg/fi/nodeup/command.go +++ b/upup/pkg/fi/nodeup/command.go @@ -285,7 +285,6 @@ func (c *NodeUpCommand) Run(out io.Writer) error { loader := &Loader{} loader.Builders = append(loader.Builders, &model.EtcHostsBuilder{NodeupModelContext: modelContext}) loader.Builders = append(loader.Builders, &model.NTPBuilder{NodeupModelContext: modelContext}) - loader.Builders = append(loader.Builders, &model.MiscUtilsBuilder{NodeupModelContext: modelContext}) loader.Builders = append(loader.Builders, &model.DirectoryBuilder{NodeupModelContext: modelContext}) loader.Builders = append(loader.Builders, &model.UpdateServiceBuilder{NodeupModelContext: modelContext}) loader.Builders = append(loader.Builders, &model.VolumesBuilder{NodeupModelContext: modelContext})