我是靠谱客的博主 外向衬衫,最近开发中收集的这篇文章主要介绍k8s from server (NotFound): the server could not find the requested resource,觉得挺不错的,现在分享给大家,希望可以做个参考。
概述
学习部署k8s 时,外界访问 NodePort 端口不成功,在查看日志 kubectl logs时,报错
[root@centos7-12 application]# kubectl logs whoami-deployment-678b64444d-r29dw
Error from server (NotFound): the server could not find the requested resource ( pods/log whoami-deployment-678b64444d-r29dw)
原来是 /etc/hosts 文件的配置有错
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.1.1 centos7-12 centos7-12
192.168.1.132 vm132
192.168.1.133 vm133
192.168.1.134 vm134
我的主机名是 centos7-12,所以修改成:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
127.0.1.1 centos7-12 centos7-12
192.168.1.132 centos7-12 centos7-12
192.168.1.133 centos7-13
192.168.1.134 centos7-14
就可以了,外界可以访问了,日志也可以查看了。
参考了:
https://blog.csdn.net/u012972390/article/details/112853747
最后
以上就是外向衬衫为你收集整理的k8s from server (NotFound): the server could not find the requested resource的全部内容,希望文章能够帮你解决k8s from server (NotFound): the server could not find the requested resource所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复