kubernetes1.20.0 rpm包制作、部署测试

06/17 13:58
阅读数 236

X86下kubernetes1.20.0 RPM包构建、测试步骤:

镜像构建和本地centos构建两种方式/镜像构建:
1、cd /root/go/src/k8s.io/release/packages/rpm 
2、./docker-build.sh

屏蔽多arch,只生成amd64
 27   ARCHS=(
 28     amd64/x86_64
 29 #    arm/armhfp
 30 #    arm64/aarch64
 31 #    ppc64le/ppc64le
 32 #    s390x/s390x
 33   )

3、ls output/x86_64/
cri-tools-1.13.0-0.x86_64.rpm  kubeadm-1.20.0-0.x86_64.rpm  kubectl-1.20.0-0.x86_64.rpm  kubelet-1.20.0-0.x86_64.rpm  kubernetes-cni-0.8.7-0.x86_64.rpm

部署测试:
0、卸载master环境
kubeadm reset 
kubeadm reset 
sh /home/reset.sh

1、卸载rpm包
rpm -e kubeadm-1.20.0-0.x86_64 kubectl-1.20.0-0.x86_64 kubelet-1.20.0-0.x86_64 kubernetes-cni-0.8.7-0.x86_64 cri-tools-1.13.0-0.x86_64

2、重新安装
rpm -ivh cri-tools-1.13.0-0.x86_64.rpm  kubeadm-1.20.0-0.x86_64.rpm  kubectl-1.20.0-0.x86_64.rpm  kubelet-1.20.0-0.x86_64.rpm  kubernetes-cni-0.8.7-0.x86_64.rpm

3、部署测试
kubeadm init --config=/home/init_default.yaml

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
export KUBECONFIG=/etc/kubernetes/admin.conf

kubectl get nodes -A
kubectl get pods -A
...网络calico/flannel部署测试


LA-server6下RPM包构建、测试步骤:
----------需要准备材料,均需要重新构建
kubernetes二进制1.20.0
make all WHAT=cmd/kubectl GOFLAGS=-v KUBE_GIT_TREE_STATE=”clean”
make all WHAT=cmd/kubelet GOFLAGS=-v KUBE_GIT_TREE_STATE=”clean”
make all WHAT=cmd/kubeadm GOFLAGS=-v KUBE_GIT_TREE_STATE=”clean”

cni-plugins-linux-amd64-v0.8.7.tgz
crictl-v1.13.0-linux-amd64.tar.gz

----------RPM工具列表&&rpmbuild环境搭建
yum install -y rpm-build rpmdevtools createrepo

-----------拷贝构建需要二进制和spec以及配置文件
/root/go/src/k8s.io/release/packages/rpm
[root@master rpm]# ls
10-kubeadm-post-1.11.conf           crictl-v1.13.0-linux-amd64.tar.gz  Dockerfile  kubeadm  kubelet      kubelet.service  output
cni-plugins-linux-amd64-v0.8.7.tgz  docker-build.sh                    entry.sh    kubectl  kubelet.env  kubelet.spec     OWNERS

cp -r * /root/rpmbuild/SPECS/

rpm -ivh kubelet-1.20.0-0.loongarch64.rpm cri-tools-1.20.0-0.loongarch64.rpm kubeadm-1.20.0-0.loongarch64.rpm kubectl-1.20.0-0.loongarch64.rpm kubernetes-cni-0.8.7-0.loongarch64.rpm

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
返回顶部
顶部