Skip to content
New issue

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

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

Already on GitHub? # to your account

sealo init kubernetes 1.20+ error when use yum docker-ce/containerd and is running(default) or Use systemd Cgroup driver #582

Closed
oldthreefeng opened this issue Jan 12, 2021 · 3 comments
Assignees
Labels
kind/feature New feature or request

Comments

@oldthreefeng
Copy link
Collaborator

oldthreefeng commented Jan 12, 2021

哪个命令或者组件
sealos init

描述这个缺陷
sealos init 安装1.20.+ ,

运行前提背景

用户已经安装了docker-ce / containerd. 并自定义/etc/containerd/config.toml. 使用了 systemd 作为containerd的cgroup驱动。 或者containerd 默认禁用了cri插件功能

[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR CRI]: container runtime is not running: output: time="2021-02-24T11:49:16Z" level=fatal msg="getting status of runtime failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1

临时解决方法:

对应 yum install contained.io 或者yum install docker-ce. 默认containerd是禁止了cri的. yum的配置如下:

 cat /etc/containerd/config.toml
#   Copyright 2018-2020 Docker Inc.

#   Licensed under the Apache License, Version 2.0 (the "License");
#   you may not use this file except in compliance with the License.
#   You may obtain a copy of the License at

#       http://www.apache.org/licenses/LICENSE-2.0

#   Unless required by applicable law or agreed to in writing, software
#   distributed under the License is distributed on an "AS IS" BASIS,
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#   See the License for the specific language governing permissions and
#   limitations under the License.

disabled_plugins = ["cri"]

#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0

#[grpc]
#  address = "/run/containerd/containerd.sock"
#  uid = 0
#  gid = 0

#[debug]
#  address = "/run/containerd/debug.sock"
#  uid = 0
#  gid = 0
#  level = "info"

解决方法

因为sealos 1.20+ 不支持docker. 建议用户卸载docker . 最快的解决方法

$ yum remove docker-ce  containerd.io 
$ rm /etc/containerd/config.toml

对应使用 cgroupfssystemd 有疑问的, 可以查询以下issue.

xref:
containerd/containerd#4581
kubernetes/kubernetes#89900
kubernetes/kubernetes#98112

如果需要使用systemd。 按照 98112 issue解决。
目前sealos 1.20 采用的使用默认cgroupfs
kubernetes/kubeadm#2376 这个功能完成后。 官方会默认kubelet的cgroup driver为systemd .
后面会按需修改.

This was referenced Jan 12, 2021
@oldthreefeng oldthreefeng changed the title sealo init kubernetes 1.20+ error when docker-ce is running / containerd is running with /etc/containerd/config.toml sealo init kubernetes 1.20+ error when docker-ce is running / containerd is running and Use systemd Cgroup driver Jan 16, 2021
@oldthreefeng oldthreefeng added the kind/feature New feature or request label Jan 16, 2021
oldthreefeng added a commit to oldthreefeng/sealos that referenced this issue Jan 16, 2021
Signed-off-by: oldthreefeng <louisehong4168@gmail.com>
@oldthreefeng oldthreefeng self-assigned this Jan 17, 2021
@oldthreefeng oldthreefeng changed the title sealo init kubernetes 1.20+ error when docker-ce is running / containerd is running and Use systemd Cgroup driver sealo init kubernetes 1.20+ error when use yum docker-ce/containerd and is running(default) or Use systemd Cgroup driver Jan 20, 2021
@oldthreefeng oldthreefeng pinned this issue Jan 27, 2021
@oldthreefeng
Copy link
Collaborator Author

oldthreefeng commented Mar 12, 2021

sealos使用默认的containerd配置. 默认的 snapshotter = "overlayfs"。

使用 overlayfs 时, 如果是xfs系统。 则需要设置 ftype 为1. 具体设置如下.
https://docs.docker.com/storage/storagedriver/overlayfs-driver/

查看ftype. 1表示支持, 0 表示不支持.

$ xfs_info  /var/lib/docker  | grep ftype
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1

@oldthreefeng
Copy link
Collaborator Author

tmp fixed

@yhm-amber
Copy link

由于 sealos init 安装 v1.19.x 离线包而遗留的 docker ,应该如何卸载?

sealos clean --all 并不能删掉它(见 #1050 )。

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants