Skip to content

Commit

Permalink
feat(platform): remove kubeadm packge (tkestack#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo Ryu committed Dec 23, 2020
1 parent be4e509 commit bc71158
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 21 deletions.
3 changes: 0 additions & 3 deletions build/docker/tools/provider-res/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ COPY linux-arm64/docker-*.tar.gz res/linux-arm64/
COPY linux-amd64/kubernetes-*.tar.gz res/linux-amd64/
COPY linux-arm64/kubernetes-*.tar.gz res/linux-arm64/

COPY linux-amd64/kubeadm-*.tar.gz res/linux-amd64/
COPY linux-arm64/kubeadm-*.tar.gz res/linux-arm64/

COPY linux-amd64/NVIDIA-*.tar.gz res/linux-amd64/

COPY linux-amd64/nvidia-container-*.tar.gz res/linux-amd64/
Expand Down
10 changes: 0 additions & 10 deletions build/docker/tools/provider-res/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,6 @@ function download::kubernetes() {
done
}

function download::kubeadm() {
for version in ${K8S_VERSIONS}; do
wget -c "https://storage.googleapis.com/kubernetes-release/release/${version}/bin/${os}/${arch}/kubeadm"
chmod +x kubeadm
GZIP=-n tar cvzf "kubeadm-${platform}-${version}.tar.gz" kubeadm
rm kubeadm
done
}

function download::nvidia_driver() {
if ! { [ "${os}" == "linux" ] && [ "${arch}" == "amd64" ]; }; then
return
Expand Down Expand Up @@ -120,7 +111,6 @@ for os in ${OSS}; do
download::cni_plugins
download::docker
download::kubernetes
download::kubeadm
download::nvidia_driver
download::nvidia_container_runtime
download::pkgs
Expand Down
4 changes: 4 additions & 0 deletions pkg/platform/provider/baremetal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const (
KubeSchedulerPodManifestFile = KubeletPodManifestDir + "kube-scheduler.yaml"
KeepavlivedManifestFile = KubeletPodManifestDir + "keepalived.yaml"

KubeadmPathInNodePackge = "kubernetes/node/bin/kubeadm"
KubeletPathInNodePackge = "kubernetes/node/bin/kubelet"
KubectlPathInNodePackge = "kubernetes/node/bin/kubectl"

DstTmpDir = "/tmp/k8s/"
DstBinDir = "/usr/bin/"
CNIBinDir = "/opt/cni/bin/"
Expand Down
6 changes: 3 additions & 3 deletions pkg/platform/provider/baremetal/phases/kubeadm/kubeadm.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ var (
)

func Install(s ssh.Interface, version string) error {
dstFile, err := res.Kubeadm.CopyToNode(s, version)
dstFile, err := res.KubernetesNode.CopyToNode(s, version)
if err != nil {
return err
}

cmd := "tar xvaf %s -C %s "
_, stderr, exit, err := s.Execf(cmd, dstFile, constants.DstBinDir)
cmd := "tar -C %s -xvaf %s %s --strip-components=3"
_, stderr, exit, err := s.Execf(cmd, constants.DstBinDir, dstFile, constants.KubeadmPathInNodePackge)
if err != nil || exit != 0 {
return fmt.Errorf("exec %q failed:exit %d:stderr %s:error %s", cmd, exit, stderr, err)
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/platform/provider/baremetal/res/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ var (
Versions: spec.ConntrackToolsVersions,
TargetDir: "/",
}

Kubeadm = Package{
Name: "kubeadm",
Versions: spec.K8sValidVersionsWithV,
}
KubernetesNode = Package{
Name: "kubernetes-node",
Versions: spec.K8sValidVersionsWithV,
Expand Down

0 comments on commit bc71158

Please sign in to comment.