1.  修改/etc/resolv.conf

[root@master ~]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 10.8.1.6

其中ip是kubelet启动地址

2. 修改/etc/hosts, 添加对应的域名解析

[root@master ~]# kubectl get nodes
NAME     STATUS   ROLES    AGE   VERSION
master   Ready    <none>   46d   v1.14.4

[root@master ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
10.8.1.6 master

3. container正常启动

[root@master ~]# kubectl logs node-exporter-s8lz8 -n kube-ops
time="2019-08-26T07:26:38Z" level=info msg="Starting node_exporter (version=0.18.1, branch=HEAD, revision=3db77732e925c08f675d7404a8c46466b2ece83e)" source="node_exporter.go:156"
time="2019-08-26T07:26:38Z" level=info msg="Build context (go=go1.12.5, user=root@b50852a1acba, date=20190604-16:41:18)" source="node_exporter.go:157"
time="2019-08-26T07:26:38Z" level=info msg="Enabled collectors:" source="node_exporter.go:97"
time="2019-08-26T07:26:38Z" level=info msg=" - arp" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - bcache" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - bonding" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - conntrack" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - cpu" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - cpufreq" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - diskstats" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - edac" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - entropy" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - filefd" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - filesystem" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - hwmon" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - infiniband" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - ipvs" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - loadavg" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - mdadm" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - meminfo" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - netclass" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - netdev" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - netstat" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - nfs" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - nfsd" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - pressure" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - sockstat" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - stat" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - textfile" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - time" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - timex" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - uname" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - vmstat" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - xfs" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg=" - zfs" source="node_exporter.go:104"
time="2019-08-26T07:26:38Z" level=info msg="Listening on :9100" source="node_exporter.go:170"

参考链接: https://github.com/kubernetes/kubernetes/issues/39026

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐