k8s 二进制安装,前面一系列工作都顺利完成,在用kubectl 命令时总是出现如下错误,无法解决:
[root@node01 ~]# kubectl api-versions
error: error loading config file "/etc/sysctl.d/k8s.conf": couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:"apiVersion,omitempty""; Kind string "json:"kind,omitempty"" }
[root@node01 ~]# cat /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables=1
net.bridge.bridge-nf-call-iptables=1
net.ipv4.ip_forward=1
net.ipv6.conf.all.disable_ipv6=1
错误位置:
error: error loading config file "/etc/sysctl.d/k8s.conf": couldn't get version/kind; json parse error: json: cannot unmarshal string into Go value of type struct { APIVersion string "json:"apiVersion,omitempty""; Kind string "json:"kind,omitempty"" }
请问哪位同志有遇到同样的情况,能给予指教吗?