Skip to content

Commit

Permalink
fix: optimize installation for k8s environment (#84)
Browse files Browse the repository at this point in the history
fix: update dependency image list
  • Loading branch information
aby913 authored May 29, 2024
1 parent de2d735 commit 878de43
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 27 deletions.
34 changes: 17 additions & 17 deletions build/installer/install_cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1079,9 +1079,6 @@ install_velero_plugin_terminus() {
exit $ERR_EXIT
fi

velero_plugin_image_pull=$($sh_c "${CRICTL} pull ${image}")
velero_plugin_image_pull=$($sh_c "${CRICTL} pull ${plugin}")

terminus_backup_location=$($sh_c "${VELERO} backup-location get -n os-system | awk '\$1 == \"${storage_location}\" {count++} END{print count}'")
if [[ ${terminus_backup_location} == x"" || ${terminus_backup_location} -lt 1 ]]; then
velero_storage_location_install_cmd="${VELERO} backup-location create $storage_location"
Expand Down Expand Up @@ -1134,7 +1131,7 @@ install_containerd(){
# preinstall containerd for k8s
if command_exists containerd && [ -f /etc/systemd/system/containerd.service ]; then
ctr_cmd=$(command -v ctr)
if ! system_service_active "containerd"; then
if ! system_service_active "containerd"; then
ensure_success $sh_c "systemctl start containerd"
fi
else
Expand All @@ -1145,26 +1142,24 @@ install_containerd(){
if [ -f "$containerd_tar" ]; then
ensure_success $sh_c "cp ${containerd_tar} containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz"
else
echo "---download containerd---" # ! debug
ensure_success $sh_c "wget https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz"
fi
ensure_success $sh_c "tar Cxzvf /usr/local containerd-${CONTAINERD_VERSION}-linux-amd64.tar.gz"

if [ -f "$runc_tar" ]; then
ensure_success $sh_c "cp ${runc_tar} runc.amd64"
else
echo "---download runc---" # ! debug
ensure_success $sh_c "wget https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64"
ensure_success $sh_c "wget https://github.com/opencontainers/runc/releases/download/v${RUNC_VERSION}/runc.amd64"
fi
ensure_success $sh_c "install -m 755 runc.amd64 /usr/local/sbin/runc"

if [ -f "$cni_plugin_tar" ]; then
ensure_success $sh_c "cp ${cni_plugin_tar} cni-plugins-linux-amd64-v${CNI_PLUGIN_VERSION}.tgz"
else
ensure_success $sh_c "wget https://github.com/containernetworking/plugins/releases/download/v1.1.1/cni-plugins-linux-amd64-v1.1.1.tgz"
ensure_success $sh_c "wget https://github.com/containernetworking/plugins/releases/download/v${CNI_PLUGIN_VERSION}/cni-plugins-linux-amd64-v${CNI_PLUGIN_VERSION}.tgz"
fi
ensure_success $sh_c "mkdir -p /opt/cni/bin"
ensure_success $sh_c "tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v1.1.1.tgz"
ensure_success $sh_c "tar Cxzvf /opt/cni/bin cni-plugins-linux-amd64-v${CNI_PLUGIN_VERSION}.tgz"
ensure_success $sh_c "mkdir -p /etc/containerd"
ensure_success $sh_c "containerd config default | tee /etc/containerd/config.toml"
ensure_success $sh_c "sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g' /etc/containerd/config.toml"
Expand Down Expand Up @@ -1231,18 +1226,23 @@ install_k8s_ks() {
KKE_VERSION=0.1.20

ensure_success $sh_c "mkdir -p /etc/kke"
local kk_bin="${BASE_DIR}/components/kk"
local kk_tar="${BASE_DIR}/components/kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"

if [ ! -f "$kk_tar" ]; then
if [ x"$PROXY" != x"" ]; then
ensure_success $sh_c "curl ${CURL_TRY} -k -sfLO https://github.com/beclab/kubekey-ext/releases/download/${KKE_VERSION}/kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
ensure_success $sh_c "tar xf kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
if [ ! -f "$kk_bin" ]; then
if [ ! -f "$kk_tar" ]; then
if [ x"$PROXY" != x"" ]; then
ensure_success $sh_c "curl ${CURL_TRY} -k -sfLO https://github.com/beclab/kubekey-ext/releases/download/${KKE_VERSION}/kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
ensure_success $sh_c "tar xf kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
else
ensure_success $sh_c "curl ${CURL_TRY} -sfL https://raw.githubusercontent.com/beclab/kubekey-ext/master/downloadKKE.sh | VERSION=${KKE_VERSION} sh -"
fi
else
ensure_success $sh_c "curl ${CURL_TRY} -sfL https://raw.githubusercontent.com/beclab/kubekey-ext/master/downloadKKE.sh | VERSION=${KKE_VERSION} sh -"
ensure_success $sh_c "cp ${kk_tar} kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
ensure_success $sh_c "tar xf kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
fi
else
ensure_success $sh_c "cp ${kk_tar} kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
ensure_success $sh_c "tar xf kubekey-ext-v${KKE_VERSION}-linux-amd64.tar.gz"
else
ensure_success $sh_c "cp ${kk_bin} ./"
fi
ensure_success $sh_c "chmod +x kk"

Expand Down
7 changes: 0 additions & 7 deletions build/manifest/dependencies
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,14 @@ https://github.com/containerd/containerd/releases/download/v1.6.4/containerd-1.6

https://github.com/kubernetes-sigs/cri-tools/releases/download/v1.24.0/crictl-v1.24.0-linux-amd64.tar.gz,crictl/v1.24.0,,

https://download.docker.com/linux/static/stable/x86_64/docker-20.10.8.tgz,docker/20.10.8,,

https://github.com/coreos/etcd/releases/download/v3.4.13/etcd-v3.4.13-linux-amd64.tar.gz,etcd/v3.4.13,,

https://get.helm.sh/helm-v3.9.0-linux-amd64.tar.gz,helm/v3.9.0,,helm

https://github.com/xiaods/k8e/releases/download/v1.21.14%2Bk8e2/k8e,kube/v1.21.14,,
https://github.com/k3s-io/k3s/releases/download/v1.21.4+k3s1/k3s,kube/v1.21.4,,
https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd64/kubeadm,kube/v1.22.10,,
https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd64/kubelet,kube/v1.22.10,,
https://storage.googleapis.com/kubernetes-release/release/v1.22.10/bin/linux/amd64/kubectl,kube/v1.22.10,,

https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-linux-x86_64,registry/compose/v2.2.2,docker-compose-linux-x86_64,,
https://github.com/goharbor/harbor/releases/download/v2.5.3/harbor-offline-installer-v2.5.3.tgz,registry/harbor/v2.5.3,,
https://github.com/kubesphere/kubekey/releases/download/v2.0.0-alpha.1/registry-2-linux-amd64.tar.gz,registry/registry/2,,

https://github.com/opencontainers/runc/releases/download/v1.1.1/runc.amd64,runc/v1.1.1,,
https://github.com/opencontainers/runc/releases/download/v1.1.4/runc.amd64,runc/v1.1.4,,
10 changes: 7 additions & 3 deletions build/manifest/images
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ calico/pod2daemon-flexvol:v3.23.2
citusdata/citus:11.3.0-alpine
coredns/coredns:1.8.0
csiplugin/snapshot-controller:v4.0.0
beclab/ks-installer-ext:v0.1.7-ext
beclab/ks-installer-ext:v0.1.8-ext
kubesphere/k8s-dns-node-cache:1.15.12
kubesphere/ks-console:v3.3.0
kubesphere/ks-controller-manager:v3.3.0
kubesphere/kube-apiserver:v1.22.10
kubesphere/kube-apiserver:v1.21.4
kubesphere/kube-controller-manager:v1.22.10
kubesphere/kube-controller-manager:v1.21.4
kubesphere/kubectl:v1.22.0
kubesphere/kube-proxy:v1.22.10
kubesphere/kube-proxy:v1.21.4
kubesphere/kube-rbac-proxy:v0.11.0
kubesphere/kube-rbac-proxy:v0.8.0
kubesphere/kube-scheduler:v1.22.10
kubesphere/kube-scheduler:v1.21.4
kubesphere/pause:3.5
kubesphere/pause:3.4.1
k8s.gcr.io/pause:3.6
Expand All @@ -40,6 +44,6 @@ quay.io/argoproj/argocli:v3.5.0
quay.io/argoproj/argoexec:v3.5.0
quay.io/argoproj/workflow-controller:v3.5.0
redis:5.0.14-alpine
beclab/velero:v1.11.0
beclab/velero-plugin-for-terminus:v1.0.1
beclab/velero:v1.11.1
beclab/velero-plugin-for-terminus:v1.0.2
rancher/coredns-coredns:1.8.3

0 comments on commit 878de43

Please sign in to comment.