关于#errorexecutionphasepreflight#的问题,如何解决?(标签-Docker|关键词-set)

this Docker version is not on the list of validated versions: 23.0.2. Latest validated version: 19.03
error execution phase preflight: [preflight] Some fatal errors occurred

[root@localhost ~]# kubeadm init --apiserver-advertise-address=192.168.74.129 --image-repository registry.aliyuncs.com/google_containers --kubernetes-version v1.18.0 --service-cidr=10.96.0.0/12 --pod-network-cidr=10.244.0.0/16
W0403 18:13:44.410489   85998 configset.go:202] WARNING: kubeadm cannot validate component configs for API groups [kubelet.config.k8s.io kubeproxy.config.k8s.io]
[init] Using Kubernetes version: v1.18.0
[preflight] Running pre-flight checks
        [WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
        [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 23.0.2. Latest validated version: 19.03
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR Swap]: running with swap on is not supported. Please disable swap
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher
[root@localhost ~]#

img

不知道你这个问题是否已经解决, 如果还没有解决的话:
  • 看下这篇博客,也许你就懂了,链接:This error may also indicate that the docker daemon is not running.
  • 除此之外, 这篇博客: docker报错exited(137)中的 1、docker 运行指定内存 部分也许能够解决你的问题, 你可以仔细阅读以下内容或者直接跳转源博客中阅读:
    -m,--memory                  内存限制,格式是数字加单位,单位可以为 b,k,m,g。最小为 4M
    --memory-swap                内存+交换分区大小总限制。格式同上。必须必-m设置的大
    --memory-reservation         内存的软性限制。格式同上
    --oom-kill-disable           是否阻止 OOM killer 杀死容器,默认没设置
    --oom-score-adj              容器被 OOM killer 杀死的优先级,范围是[-1000, 1000],默认为 0
    --memory-swappiness          用于设置容器的虚拟内存控制行为。值为 0~100 之间的整数
    --kernel-memory              核心内存限制。格式同上,最小为 4M
    
    [root@sannian ~]# docker run -d -m 1G --memory-swap 3G -p 9999:80  --restart=always --name gitlab twang2218/gitlab-ce-zh
    a3254078a79a084f3f3bed5f4ade3e26c7d86951cd822d95b113227d75b00097
    [root@sannian ~]# docker ps
    CONTAINER ID        IMAGE                    COMMAND             CREATED             STATUS                   PORTS                                   NAMES
    a3254078a79a        twang2218/gitlab-ce-zh   "/assets/wrapper"   21 minutes ago      Up 2 minutes (healthy)   22/tcp, 443/tcp, 0.0.0.0:9999->80/tcp   gitlab
    [root@sannian ~]# docker images
    REPOSITORY                                               TAG                 IMAGE ID            CREATED             SIZE
    twang2218/gitlab-ce-zh                                   latest              18da462b5ff5        3 months ago        1.61GB
    registry-vpc.cn-hangzhou.aliyuncs.com/wenty/jumpserver   latest              055f42f305f5        7 months ago        1.41GB
    registry.cn-hangzhou.aliyuncs.com/wenty/jumpserver       latest              055f42f305f5        7 months ago        1.41GB
    registry.jumpserver.org/public/jumpserver                1.0.0               055f42f305f5        7 months ago        1.41GB
    registry.jumpserver.org/public/jumpserver                latest              055f42f305f5        7 months ago        1.41GB``
    

如果你已经解决了该问题, 非常希望你能够分享一下解决方案, 写成博客, 将相关链接放在评论区, 以帮助更多的人 ^-^

错误信息里面写的听清楚的了,而且有官方链接:https://kubernetes.io/docs/setup/cri/
请按照官方文档写的,将Docker容器的Cgroup驱动从cgroupfs改为systemd,并重新安装Kubernetes。