Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kubeasz+kubeedge 使用kubectl logs xxx报错no such host #1439

Open
bimoQi opened this issue Jan 25, 2025 · 3 comments
Open

kubeasz+kubeedge 使用kubectl logs xxx报错no such host #1439

bimoQi opened this issue Jan 25, 2025 · 3 comments

Comments

@bimoQi
Copy link

bimoQi commented Jan 25, 2025

What happened? 发生了什么问题?

我用kubeasz3.2.0版本安装的k8s,再此基础上安装了kubeedge,但是使用kubectl logs -f xxx 报错,截图如下:

Image Image

再用另一个安装k8s的教程中kubesphere安装的k8s可以获取到日志,关键点是kubectl请求到kube-apiserver,但是apiserver没有将域名正确映射为ip,下面截图是正确映射ip的结果:

Image

What did you expect to happen? 期望的结果是什么?

期望能帮忙排查下这个是什么原因导致的,是因为kubeasz本身没有做hostname域名映射吗

How can we reproduce it (as minimally and precisely as possible)? 尽可能最小化、精确地描述如何复现问题

kubeasz3.2.0版本安装k8s、 再安装kubeedge官方教程安装 https://release-1-17.docs.kubeedge.io/docs/faq/setup/
然后通过kubectl logs 请求边缘节点日志即可复现

Anything else we need to know? 其他需要说明的情况

No response

Kubernetes version k8s 版本

k8s版本1.23.1、docker20.x

Kubeasz version

kubeasz版本3.2.0

OS version 操作系统版本

# On Linux:
ubuntu
$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.4 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
$ uname -a
Linux k8s-master 5.15.0-122-generic #132-Ubuntu SMP Thu Aug 29 13:45:52 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Related plugins (CNI, CSI, ...) and versions (if applicable) 其他网络插件等需要说明的情况

@gjmzj
Copy link
Collaborator

gjmzj commented Jan 29, 2025

是的,低版本没有做映射,3.6.2以上版本有hostname映射的

@gjmzj
Copy link
Collaborator

gjmzj commented Jan 29, 2025

低版本的话,你只能手动添加下

@bimoQi
Copy link
Author

bimoQi commented Feb 9, 2025

低版本的话,你只能手动添加下

请问下怎么添加呢,是每个节点都需要将节点host和ip添加到 master节点上的/etc/hosts文件中吗,
想问下这个是k8s本身版本的问题呢,还是当前部署流程里就没有支持自动host解析。
还是说是否和kube-apiserver、coredns分别部署在systemd和pod有关;因为我同样用kubesphere安装的k8s 1.23.1他就能自动解析到我新加的节点并映射了ip(这个用的是kubeadm的脚本安装的),而且master节点的host中也没有生成新节点的host->ip的映射

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants