【Kubernetes系列】Kubernetes常见报错


一、container runtime is not running

1.问题描述

执行过程可能会报以下错误:

[preflight] Running pre-flight checks
	[WARNING FileExisting-tc]: tc not found in system path
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR CRI]: container runtime is not running: output: E0610 17:03:07.643242   25405 remote_runtime.go:925] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2022-06-10T17:03:07+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
[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

2.解决方法

执行以下命令:

rm /etc/containerd/config.toml 
systemctl restart containerd

再重新执行初始化。

二、The Service “kubernetes-dashboard” is invalid: spec.ports[0].nodePort: Forbidden: may not be used when type is ‘ClusterIP’

1.问题描述

kubernetes-dashboard 报错:

The Service "kubernetes-dashboard" is invalid: spec.ports[0].nodePort: Forbidden: may not be used when type is 'ClusterIP'

2.解决方法

service中 type 没有指定时默认采用 ClusterIP,需要在配置文件中指定 type:

spec:
  type: NodePort
  ports:
    - port: 443
      targetPort: 8443
      nodePort: 30001
  selector:
    k8s-app: kubernetes-dashboard

三、modprobe: FATAL: Module nf_conntrack_ipv4 not found.

1.问题描述

配置 ipvs 前提条件时报错:

modprobe: FATAL: Module nf_conntrack_ipv4 not found.

2.解决方法

高版本内核已经把 nf_conntrack_ipv4 替换为 nf_conntrack 了,将 nf_conntrack_ipv4 改为 nf_conntrack 即可。

四、raw.githubusercontent.com 无法访问

1.问题描述

raw.githubusercontent.com 无法访问。

2.解决方法

进入 ip 查询网站:https://www.ipaddress.com,输入 raw.githubusercontent.com 搜索真实 IP:
在这里插入图片描述
取其中一个 IP,在配置文件 /etc/hosts 加入一行:

185.199.108.133 raw.githubusercontent.com

五、tc not found in system path

1.问题描述

报错:

[preflight] Running pre-flight checks
	[WARNING FileExisting-tc]: tc not found in system path

2.解决方法

下载 iproute-tc 进行安装,下载地址:
https://vault.centos.org/centos/8/BaseOS/x86_64/os/Packages/iproute-tc-5.12.0-4.el8.x86_64.rpm

安装:

rpm -ivh iproute-tc-5.12.0-4.el8.x86_64.rpm

猜你喜欢

转载自blog.csdn.net/u012069313/article/details/125264651