k3s-io / k3s

Lightweight Kubernetes
https://k3s.io
Apache License 2.0
27.99k stars 2.34k forks source link

Error when trying to fetch log #11181

Open davidshen84 opened 5 days ago

davidshen84 commented 5 days ago

Environmental Info: K3s Version:

k3s version v1.30.5+k3s1 (9b586704)
go version go1.22.6

Node(s) CPU architecture, OS, and Version:

Linux xps9560 6.6.57-gentoo-dist #1 SMP PREEMPT_DYNAMIC Thu Oct 17 15:43:30 -00 2024 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux

Cluster Configuration: 1 single node

Describe the bug: Got this error when trying to view pod logs:

stream logs failed Get "https://172.17.0.1:10250/containerLogs/kube-system/metrics-server-cdcc87586-2vrwx/metrics-server?follow=true&tailLines=100&timestamps=true": tls: failed to verify certificate: x509: certificate is valid for 127.0.0.1, 192.168.86.27, 2400:..., not 172.17.0.1 for kube-system/ metrics-server-cdcc87586-2vrwx (metrics-server)

Steps To Reproduce:

Expected behavior: Can view log at anytime

Actual behavior: Got TLS error after some random time.

Additional context / logs:

I could view the logs just minutes ago, then when I issued the command again, I got this error. I have had these errors before, and I have to reinstall the k3s system.

brandond commented 4 days ago

How many nodes do you have in your cluster? Are you running docker alongside k3s on these nodes? Do the nodes have multiple interfaces, and if so did you want to set --node-ip to the address of the interface you wanted it to use? For some reason the kubelet has detected a node IP of 172.17.0.1 but k3s was expecting this node to be at 192.168.86.27.

davidshen84 commented 4 days ago

I have only one node.

I have docker running. Are you saying the k3s service can pick up the docer0 IF as the node IP. I will try setting the node IP explicitly.

Thanks

On Tue, 29 Oct 2024, 06:56 Brad Davidson, @.***> wrote:

How many nodes do you have in your cluster? Are you running docker alongside k3s on these nodes? Do the nodes have multiple interfaces, and if so did you want to set --node-ip to the address of the interface you wanted it to use? For some reason the kubelet has detected a node IP of 172.17.0.1 but k3s was expecting this node to be at 192.168.86.27.

— Reply to this email directly, view it on GitHub https://github.com/k3s-io/k3s/issues/11181#issuecomment-2442497584, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAQBTJ5GKP46DCBHXCISQ3Z52JG5AVCNFSM6AAAAABQWJI6QWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBSGQ4TONJYGQ . You are receiving this because you authored the thread.Message ID: @.***>

brandond commented 4 days ago

I've not seen this happen before, but that does appear to be what's going on.