---
# System prepended metadata

title: 'calico报错son: cannot unmarshal string into Go struct field NetConf.mtu of type int]. '
tags: [背锅运维之路]

---

于是describe查看宿主机的事件信息

![img](https://img2023.cnblogs.com/blog/2399534/202307/2399534-20230725131702715-874000383.png)

查看日志没有相关日志

查看calico的相关配置文件值找到

![img](https://img2023.cnblogs.com/blog/2399534/202307/2399534-20230725131957062-370419743.png)

于是想着直接去修改calico的Configmap发现修改不成功

![img](https://img2023.cnblogs.com/blog/2399534/202307/2399534-20230725132055057-1157535735.png)

便去查询宿主机映射的calico挂载文件把标记部分的string给成int去掉双引号，然后重启calico

然后通过ansible分发到每台机器上

```bash
ansible all -u app -m copy -a "src=/root/my-ploybook/10-calico.conflist  dest=/etc/cni/net.d/10-calico.conflist   mode=0755" --become --become-user=root
kubectl rollout restart ds/calico-node -n kube-system
```

![img](https://img2023.cnblogs.com/blog/2399534/202307/2399534-20230725132248336-210239366.png)

 