k8s pod查看日志server misbehaving

一、pod查看日志server misbehaving

问题:

Get https://k8s-node6:10250/containerLogs/default/xxxxx-5b65979f96-7q7c7/xxxx?follow=true: dial tcp: lookup k8s-node6 on 172.18.0.1:53: server misbehaving

[root@k8s-master1 ~]# kubectl logs -f jic-open-api-center-5b65979f96-7q7c7
Error from server: Get https://k8s-node6:10250/containerLogs/default/jic-open-api-center-5b65979f96-7q7c7/jic-open-api-center?follow=true: dial tcp: lookup k8s-node6 on 172.18.0.1:53: server misbehaving

解决:

  1. 怀疑DNS的问题
  2. 在集群所有服务器修改 /etc/hosts,缺失的进行完善
    [root@wfwtest1 ~]# vi /etc/hosts
    127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
    172.18.0.108 k8s-master1
    172.18.0.120 k8s-node1
    172.18.0.121 k8s-node2
    172.18.0.206 k8s-node3
    172.18.0.207 k8s-node4
    172.18.0.11 k8s-node5
    172.18.1.32 k8s-node6
    172.18.1.33 k8s-node7
    
  3. 问题解决

二、启动Pod网络报错

问题:

networkPlugin cni failed to set up pod network: failed to set bridge addr: “cni0” already has an IP address different from 10.244.8.1/24

Warning  FailedCreatePodSandBox  21m  kubelet, k8s-node6  Failed to create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "40543d3f5cc9b01ff89b367aa7faad0c88eac617bdef214fbcae5a1d7e4d103d" network for pod "jic-open-api-center-5b65979f96-gglfr": networkPlugin cni failed to set up pod "jic-open-api-center-5b65979f96-gglfr_default" network: failed to set bridge addr: "cni0" already has an IP address different from 10.244.8.1/24

在这里插入图片描述

解决:

  1. "cni0"的ip跟10.244.8.1/24不同
  2. 查看k8s-node6的ip
    [root@wfwtest1 ~]# ifconfig
    


​ flannel.1的IP为10.244.9.0,查看cat /run/flannel/subnet.env发现cni0不一致
在这里插入图片描述
3. 修改cni0的IP段

  • 方法1是将cni0的IP段修改为10.244.9.1。
  • 方法2是将这个错误的网卡删除掉,然后自动重建。
    [root@wfwtest1 ~]# ifconfig cni0 down
    [root@wfwtest1 ~]# ip link delete cni0
    
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值