Kubectl desribe为Ingress返回404

时间:2019-07-10 12:37:14

标签: kubernetes kubectl kubernetes-ingress

我今天重新安装了系统,由于无法使用kubectl describe访问我的Ingress,get可以正常工作并返回预期的Ingress。

kubectl describe ingresses
Error from server (NotFound): the server could not find the requested resource

这是我使用describe运行-v 8时得到的响应

GET host:443/apis/networking.k8s.io/v1beta1/namespaces/default/ingresses/ingress-rule
Request Headers:
    Authorization: Bearer TOKEN
    Accept: application/json, */*
    User-Agent: kubectl/v1.15.0 (linux/amd64) kubernetes/e8462b5
Response Status: 404 Not Found in 14 milliseconds
Response Headers:
    Content-Type: application/json
    Content-Length: 174
    Date: Wed, 10 Jul 2019 12:30:05 GMT
Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"the server could not find the requested resource","reason":"NotFound","details":{},"code":404}

这是kubectl版本的结果

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"12", GitVersion:"v1.12.7", GitCommit:"6f482974b76db3f1e0f5d24605a9d1d38fad9a2b", GitTreeState:"clean", BuildDate:"2019-03-25T02:41:57Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}

2 个答案:

答案 0 :(得分:3)

使用不同版本的kubectl客户端和服务器时遇到问题。您需要将kubectl客户端降级到1.12

在k8s v.15中,入口networking.k8s.io组之前是"extensions/v1beta1"组的一部分

  

v1.19中的extensions / v1beta1将不再提供入口资源。从v1.14开始,可将其迁移至networking.k8s.io/v1beta1 API。可以通过networking.k8s.io/v1beta1 API检索现有的持久数据。k8s CHANGELOG-1.15.md

答案 1 :(得分:-1)

尝试运行

kubectl get ingress

如果您在名称空间中定义的入口不是默认名称,请使用以下内容:

kubectl get ingress -n <NSNAME>

一旦有了入口资源列表,就可以使用以下内容进行描述:

kubectl describe ingress <IngressName> -n <Namespace>