Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockershim depreciation since kubernetes 1.20.0, #540

Closed
oldthreefeng opened this issue Dec 3, 2020 · 9 comments
Closed

Dockershim depreciation since kubernetes 1.20.0, #540

oldthreefeng opened this issue Dec 3, 2020 · 9 comments

Comments

@oldthreefeng
Copy link
Collaborator

The next kubernetes version (1.20.0) will depreciate dockershim: kubernetes/kubernetes#94624

docs:
https://kubernetes.io/blog/2020/12/02/dockershim-faq/
https://kubernetes.io/blog/2020/12/02/dont-panic-kubernetes-and-docker/

看来需要寻找替代了. containerd 或者 cri-o.

@cuisongliu
Copy link
Collaborator

containerd , https://github.com/cuisongliu/container-install 已经支持了container的安装

@cuisongliu
Copy link
Collaborator

cuisongliu commented Dec 3, 2020

#!/bin/bash
# 本地环境安装
sh init.sh

# 解压缩tar
ip_addr=${1:-172.16.3.252}
master=${2:-false}
version=${3:-1.14.0}
tar -zxvf kube${version}.tar.gz
rm -rf kube/bin/crictl


# 安装containerd
sh containerd-uninstall.sh || true
sh containerd-install.sh

# 加载镜像
ctr -n=k8s.io image import  kube/images/images.tar

# 修改kubelet
mkdir -p /etc/systemd/system/kubelet.service.d
cat > /etc/systemd/system/kubelet.service.d/containerd.conf << eof
[Service]
Environment="KUBELET_EXTRA_ARGS=--container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:///run/containerd/containerd.sock --image-service-endpoint=unix:///run/containerd/containerd.sock"

eof
# 修改kubeadm
cat > kube/conf/kubeadm.yaml << eof
apiVersion: kubeadm.k8s.io/v1beta1
kind: ClusterConfiguration
networking:
  podSubnet: 100.64.0.0/10
kubernetesVersion: v${version}
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
---
apiVersion: kubeadm.k8s.io/v1beta1
kind: InitConfiguration
nodeRegistration:
  criSocket: /run/containerd/containerd.sock
localAPIEndpoint:
  advertiseAddress: ${ip_addr}
  bindPort: 6443
eof
sed -i "/docker/d" kube/shell/init.sh
sed -i "/driver=/d" kube/shell/init.sh

# cgroupfs
export driver=cgroupfs
cd kube/shell
sh init.sh
sh /etc/sysconfig/modules/ipvs.modules
if $master; then
sh master.sh
cat >> ~/.bashrc   << eof
source <(kubectl completion bash)
eof
kubectl get nodes
echo "等待master节点Ready后执行 source ~/.bashrc "
fi
cd ../../

@cuisongliu
Copy link
Collaborator

这个是之前的脚本 后来可试一下。应该问题不大

@currycan
Copy link
Contributor

currycan commented Dec 4, 2020

有没有考虑将containerd的安装也二进制装算了?安装逻辑也用go来写

@cuisongliu
Copy link
Collaborator

这个container-install项目已经实现 后面需要集成一下

@oldthreefeng
Copy link
Collaborator Author

oldthreefeng commented Dec 4, 2020

有没有考虑将containerd的安装也二进制装算了?

containerdcri-o 的二进制安装挺尴尬.
官方没有发布 arm64架构的二进制... 如果是arm64 架构, 得从源码build binary . 或者使用 docker仓库里面的 .rpm 或者 .deb 进行安装.

这边已经通过手动拉取containerd源码.通过官方的makefile进行构建 根据tag进行构建containerd. 并发布二进制. 打包方式和官方release linux-amd64 windows-amd64 一样. 有效性已验证. ok

@fanux
Copy link
Member

fanux commented Dec 6, 2020

cri-o不需要了啊 已经整合到containerd里面去了啊

@oldthreefeng
Copy link
Collaborator Author

kubernetes的版本号大于等于1.20.

1. sealos 与docker相关的去除.

2. 仅使用containerd部署. 使用 v1beta2 版本的配置文件.

oldthreefeng added a commit to oldthreefeng/sealos that referenced this issue Dec 7, 2020
@oldthreefeng
Copy link
Collaborator Author

已经实现

cuisongliu added a commit that referenced this issue Dec 9, 2021
* rewrite install and delete for app, app.tar don't send if already exist
* read byte to remote file by sftp
* add etcd health check
* restore only one node to local
* use subcommad instead Flag
* single node save, healthcheck and restore test ok
* recovery kube system when err happend by restore
* use tar to compress instead of zip.
* slove in docker use with save.
* add --docker bool flag , if true , this will auto add unix timestamp to your snapshot suffix.
* add save snapshot to oss. sealos config add oss-conf
* feat(develop): 修复 #430
* fix ETCD CaCert or key file is not exist occurs panic,  #427
* add kubernetes cronjob example yaml file
* fix #441
* fix issue #443
* implementaion for sealos exec #429
* fix bug --label & --node will exec cmd twice and add example exec cmd
* support exec scp local dir to remote
* refactor exec command and use get ip  by node name & by labelselector method to avoid for loop
* fix sealos etcd health check for mutil master
* add bash/zsh completion for sealos. from kubectl
* fix kubeadm not found on old sealos package && fix port in exec cmd #469  && fix --service-cidr on old version && delete route cmd
* fix 1.19.1 kube-controller-manager and kube-scheduler use the LocalAPIEndpoint instead of the ControlPlaneEndpoint.
* add sealos route cmd docs
* rm original sealos in old package to aviod some problem.
add multi network install docs stage
add upx in dockerfile, add upx in drone. change image to golang:15.2-alpine
* dockerfile add upx stage build
* fix versiontointall when version like v1.16.14 >= 1191
* add test record for upgrade cmd
* when init , do not send twice, if valid copy md5 success ,do not logger
* sepreate install master0 and other master when send ca and key and kubeconfig
* fix --config when use customer config.
* validate copy kubetarball
* fix #499
* fix #509.
* fix #534 only for 1.19.1 and 1.19.2
* /root/.kube/config设置为600,否则默认其它组有r权限,导致helm工具执行有警告
* when kubernetes gt 1.20, use Containerd instead of docker, #540 suport 1.20 containerd
* fix #566, sealos clean --node 不小心写了 masterip  add cleanCmd example
* fix #571. handle unexpected error
* fix #577, join node use config file, fix ipformat
comment to oss when push to develop, only to  tag to release
Fix 1.14.x has no kubeadm.k8s.io/v1beta2 by use cli kubeadm join --xxxx.
* fix #586,  drain node is too danger for prod use; do not drain nodes
drain worker node is too danger for prod use; do not drain nodes if worker nodes~
* fix build status (#610)
* fix arm64 tags
* fix #613, delete -i for cp command
* fix #621. join node or master should not exsit in kubernetes.
* feat(develop): fix  ipip param not set false (#653)
* # 决绝路径取消拼接,防止出错。 (#654)
* feat(develop): fix cni config too long (#655)
* fix version 3.19.1 yaml file lint error. (#656)
* fix calico (#657)
* fix calico version nil yaml file retrun null. (#658)
* Update upgrade.md (#665)
* use new const for kubeletconfig (#589)
Signed-off-by: oldthreefeng <[email protected]>
* [WIP]Sealos kubeadm 1.23 v1beta3 (#673)
* fix #671
* feat(develop): fix ci dir for sealos (#735)
* fix  bootstrapToken (#737)
* feat(develop): rc6 release (#738)
* ci(develop) fix golint for code and lic (#736)

Co-authored-by: steven <[email protected]>
Co-authored-by: oldthreefeng <[email protected]>
Co-authored-by: 中弈 <[email protected]>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Louis <[email protected]>
Co-authored-by: ysicing <[email protected]>
Co-authored-by: huizhi.szh <[email protected]>
Co-authored-by: aiyijing <[email protected]>
Co-authored-by: scott lewis <[email protected]>
Co-authored-by: wenshihong <[email protected]>
Co-authored-by: wisheen <[email protected]>
Co-authored-by: Cluas <[email protected]>
Co-authored-by: currycan <[email protected]>
Co-authored-by: zhangzhitao <[email protected]>
Co-authored-by: rick <[email protected]>
Co-authored-by: panda-lab <[email protected]>
Co-authored-by: 付亮 <[email protected]>
Co-authored-by: SorryMaker <[email protected]>
cuisongliu added a commit that referenced this issue Dec 29, 2021
* ci(develop) fix golint for code and lic (#736)

* merge to master (#739)

* rewrite install and delete for app, app.tar don't send if already exist
* read byte to remote file by sftp
* add etcd health check
* restore only one node to local
* use subcommad instead Flag
* single node save, healthcheck and restore test ok
* recovery kube system when err happend by restore
* use tar to compress instead of zip.
* slove in docker use with save.
* add --docker bool flag , if true , this will auto add unix timestamp to your snapshot suffix.
* add save snapshot to oss. sealos config add oss-conf
* feat(develop): 修复 #430
* fix ETCD CaCert or key file is not exist occurs panic,  #427
* add kubernetes cronjob example yaml file
* fix #441
* fix issue #443
* implementaion for sealos exec #429
* fix bug --label & --node will exec cmd twice and add example exec cmd
* support exec scp local dir to remote
* refactor exec command and use get ip  by node name & by labelselector method to avoid for loop
* fix sealos etcd health check for mutil master
* add bash/zsh completion for sealos. from kubectl
* fix kubeadm not found on old sealos package && fix port in exec cmd #469  && fix --service-cidr on old version && delete route cmd
* fix 1.19.1 kube-controller-manager and kube-scheduler use the LocalAPIEndpoint instead of the ControlPlaneEndpoint.
* add sealos route cmd docs
* rm original sealos in old package to aviod some problem.
add multi network install docs stage
add upx in dockerfile, add upx in drone. change image to golang:15.2-alpine
* dockerfile add upx stage build
* fix versiontointall when version like v1.16.14 >= 1191
* add test record for upgrade cmd
* when init , do not send twice, if valid copy md5 success ,do not logger
* sepreate install master0 and other master when send ca and key and kubeconfig
* fix --config when use customer config.
* validate copy kubetarball
* fix #499
* fix #509.
* fix #534 only for 1.19.1 and 1.19.2
* /root/.kube/config设置为600,否则默认其它组有r权限,导致helm工具执行有警告
* when kubernetes gt 1.20, use Containerd instead of docker, #540 suport 1.20 containerd
* fix #566, sealos clean --node 不小心写了 masterip  add cleanCmd example
* fix #571. handle unexpected error
* fix #577, join node use config file, fix ipformat
comment to oss when push to develop, only to  tag to release
Fix 1.14.x has no kubeadm.k8s.io/v1beta2 by use cli kubeadm join --xxxx.
* fix #586,  drain node is too danger for prod use; do not drain nodes
drain worker node is too danger for prod use; do not drain nodes if worker nodes~
* fix build status (#610)
* fix arm64 tags
* fix #613, delete -i for cp command
* fix #621. join node or master should not exsit in kubernetes.
* feat(develop): fix  ipip param not set false (#653)
* # 决绝路径取消拼接,防止出错。 (#654)
* feat(develop): fix cni config too long (#655)
* fix version 3.19.1 yaml file lint error. (#656)
* fix calico (#657)
* fix calico version nil yaml file retrun null. (#658)
* Update upgrade.md (#665)
* use new const for kubeletconfig (#589)
Signed-off-by: oldthreefeng <[email protected]>
* [WIP]Sealos kubeadm 1.23 v1beta3 (#673)
* fix #671
* feat(develop): fix ci dir for sealos (#735)
* fix  bootstrapToken (#737)
* feat(develop): rc6 release (#738)
* ci(develop) fix golint for code and lic (#736)

Co-authored-by: steven <[email protected]>
Co-authored-by: oldthreefeng <[email protected]>
Co-authored-by: 中弈 <[email protected]>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Louis <[email protected]>
Co-authored-by: ysicing <[email protected]>
Co-authored-by: huizhi.szh <[email protected]>
Co-authored-by: aiyijing <[email protected]>
Co-authored-by: scott lewis <[email protected]>
Co-authored-by: wenshihong <[email protected]>
Co-authored-by: wisheen <[email protected]>
Co-authored-by: Cluas <[email protected]>
Co-authored-by: currycan <[email protected]>
Co-authored-by: zhangzhitao <[email protected]>
Co-authored-by: rick <[email protected]>
Co-authored-by: panda-lab <[email protected]>
Co-authored-by: 付亮 <[email protected]>
Co-authored-by: SorryMaker <[email protected]>

* Revert "merge to master (#739)" (#741)

This reverts commit c8349b0.

* Update README.md

* ci(master): add dockerfile

* hotfix(master): clean panic fix by lock (#750)

* refactor(ci): add auto invite (#762)

* refactor(ci): add auto invite (#763)

* refactor(ci): add auto invite

* docs: readme align

* refactor(dev): fix docs site (#773)

* refactor(master): cloud,app feature close (#774)

* refactor(master): cloud,app feature close

* 缺陷: 最新版本sealos init 安装k8s 失败 (#778)

Fixes #691

* refactor(master): release rc.8 (#782)

* refactor(master): changelog (#784)

* update changelog to master (#785)

* refactor(master): changelog

Co-authored-by: steven <[email protected]>
Co-authored-by: oldthreefeng <[email protected]>
Co-authored-by: 中弈 <[email protected]>
Co-authored-by: Ryan <[email protected]>
Co-authored-by: Louis <[email protected]>
Co-authored-by: ysicing <[email protected]>
Co-authored-by: huizhi.szh <[email protected]>
Co-authored-by: aiyijing <[email protected]>
Co-authored-by: scott lewis <[email protected]>
Co-authored-by: wenshihong <[email protected]>
Co-authored-by: wisheen <[email protected]>
Co-authored-by: Cluas <[email protected]>
Co-authored-by: currycan <[email protected]>
Co-authored-by: zhangzhitao <[email protected]>
Co-authored-by: rick <[email protected]>
Co-authored-by: panda-lab <[email protected]>
Co-authored-by: 付亮 <[email protected]>
Co-authored-by: SorryMaker <[email protected]>
Co-authored-by: jiangyanfei <[email protected]>
Co-authored-by: ldseraph <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants