Skip to content
This repository was archived by the owner on Dec 31, 2025. It is now read-only.
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
1 change: 0 additions & 1 deletion cmd/nodereset.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ func cleanupBinaries() {
os.RemoveAll(filepath.Join(constants.BaseInstallDir, "kubeadm"))
os.RemoveAll(filepath.Join(constants.BaseInstallDir, "kubectl"))

os.RemoveAll(constants.KubeVersionInstallDir)
os.RemoveAll(constants.ConfInstallDir)
os.RemoveAll(constants.CNIBaseDir)
}
Expand Down
14 changes: 5 additions & 9 deletions constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,17 @@ const (
KubeadmConfig = "/tmp/kubeadm.yaml"
KubeDNSVersion = "1.14.8"
KeepalivedImage = "platform9/keepalived:v2.0.4"
CacheBaseDir = "/var/cache/nodeadm/"
CacheDir = "/var/cache/nodeadm/"
Execute = 0744
Read = 0644
ServiceNodePortRange = "80-32767"
)

var KubeDirName = "kubernetes-" + KubernetesVersion
var CNIDirName = "cni-" + CNIVersion
var FlannelDirName = "flannel-" + FlannelVersion
var NodeadmDirName = "noedadm-" + KubernetesVersion

var KubeVersionInstallDir = filepath.Join(BaseInstallDir, KubeDirName)
var CniVersionInstallDir = filepath.Join(CNIBaseDir, CNIDirName)
var KubeDirName = filepath.Join("kubernetes", KubernetesVersion)
var FlannelDirName = filepath.Join("flannel", FlannelVersion)
var CNIDirName = filepath.Join("cni", CNIVersion)
var CniVersionInstallDir = filepath.Join(CNIBaseDir, CNIVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: CNIVersionInstallDir

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Daniel, will address in the next commit

var ConfInstallDir = filepath.Join(BaseInstallDir, ConfigDir)
var CacheDir = filepath.Join(CacheBaseDir, KubernetesVersion)
var ImagesCacheDir = filepath.Join(CacheDir, "images")

const (
Expand Down
11 changes: 3 additions & 8 deletions utils/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,9 @@ func placeAndModifyNodeadmKubeletSystemdDropin(netConfig apis.Networking) {
}

func placeKubeComponents() {
err := os.MkdirAll(constants.KubeVersionInstallDir, constants.Execute)
if err != nil {
log.Fatalf("Failed to create dir %s with error %v\n", constants.KubeVersionInstallDir, err)
}
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubectl"), filepath.Join(constants.KubeVersionInstallDir, "kubectl"))
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubeadm"), filepath.Join(constants.KubeVersionInstallDir, "kubeadm"))
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubelet"), filepath.Join(constants.KubeVersionInstallDir, "kubelet"))
CreateSymLinks(constants.KubeVersionInstallDir, constants.BaseInstallDir, true)
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubectl"), filepath.Join(constants.BaseInstallDir, "kubectl"))
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubeadm"), filepath.Join(constants.BaseInstallDir, "kubeadm"))
deprecated.Run("", "cp", filepath.Join(constants.CacheDir, constants.KubeDirName, "kubelet"), filepath.Join(constants.BaseInstallDir, "kubelet"))
}

func placeCNIPlugin() {
Expand Down