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

kubeasz v3.6.1 启用systemReserved时,kubelet报错 #1281

Closed
piano-wow opened this issue Jun 8, 2023 · 3 comments
Closed

kubeasz v3.6.1 启用systemReserved时,kubelet报错 #1281

piano-wow opened this issue Jun 8, 2023 · 3 comments

Comments

@piano-wow
Copy link
Contributor

What happened? 发生了什么问题?

背景信息:
kubeasz v3.6.1

[root@master-1 ~]# cat /etc/redhat-release
AlmaLinux release 9.2 (Turquoise Kodkod)

[root@master-1 ~]# /etc/kubeasz/ezdown
Usage: ezdown [options] [args]
option:
-C stop&clean all local containers
-D download default binaries/images into "/etc/kubeasz"
-P download system packages of the OS (ubuntu_22,debian_11,...)
-R download Registry(harbor) offline installer
-S start kubeasz in a container
-X download extra images
-d set docker-ce version, default "20.10.24"
-e set kubeasz-ext-bin version, default "1.7.1"
-k set kubeasz-k8s-bin version, default "v1.27.2"
-m set docker registry mirrors, default "CN"(used in Mainland,China)
-z set kubeasz version, default "3.6.1"
[root@master-1 ~]#

情况一:
使用默认安装方式
ezctl start-aio
能正常安装和启动,无报错

情况二:
ezctl new cluster-01
vi /etc/kubeasz/clusters/cluster-01/config.yml # 开启下面任意一项
KUBE_RESERVED_ENABLED: "yes"
SYS_RESERVED_ENABLED: "yes"

安装报错,定位到kubelet无法启动,报错
手动启动
/opt/kube/bin/kubelet
--config=/var/lib/kubelet/config.yaml
--container-runtime-endpoint=unix:///run/containerd/containerd.sock
--hostname-override=master-01
--kubeconfig=/etc/kubernetes/kubelet.kubeconfig
--root-dir=/var/lib/kubelet
--v=2
报错
[root@master-1 ~]# /opt/kube/bin/kubelet --config=/var/lib/kubelet/config.yaml --container-runtime-endpoint=unix:///run/containerd/containerd.sock --hostname-override=master-01 --kubeconfig=/etc/kubernetes/kubelet.kubeconfig --root-dir=/var/lib/kubelet --v=2
Flag --container-runtime-endpoint has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.
E0608 11:26:14.448652 20656 run.go:74] "command failed" err="failed to load kubelet config file, error: failed to load Kubelet config file /var/lib/kubelet/config.yaml, error failed to decode: json: cannot unmarshal number into Go struct field KubeletConfiguration.systemReserved of type string, path: /var/lib/kubelet/config.yaml"

尝试修改:
vi /var/lib/kubelet/config.yaml
systemReserved:
cpu: 200m
memory: 500Mi
pid: "5000"

把pid参数值加上引号

修改后kubelet能正常启动,集群也正常
[root@master-1 ~]# kubectl get cs
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME STATUS MESSAGE ERROR
controller-manager Healthy ok
scheduler Healthy ok
etcd-0 Healthy {"health":"true","reason":""}

问题

  1. 需要处理吗?
    Flag --container-runtime-endpoint has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag.

What did you expect to happen? 期望的结果是什么?

How can we reproduce it (as minimally and precisely as possible)? 尽可能最小化、精确地描述如何复现问题

Anything else we need to know? 其他需要说明的情况

No response

Kubernetes version k8s 版本

Kubeasz version

OS version 操作系统版本

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

Related plugins (CNI, CSI, ...) and versions (if applicable) 其他网络插件等需要说明的情况

@gjmzj
Copy link
Collaborator

gjmzj commented Jun 10, 2023

Flag --container-runtime-endpoint has been deprecated, This parameter should be set via the config file specified by the Kubelet's --config flag.
这个暂时不用处理,下次版本升级我会改掉;

kubelet无法启动原因应该是pid限制值必须是string;

感谢提供详细的问题反馈与解决方案👍

@piano-wow
Copy link
Contributor Author

piano-wow commented Jun 10, 2023 via email

@sceosun
Copy link

sceosun commented Jun 20, 2023

我和你遇到了同样的问题,非常感谢!

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

3 participants