【问题标题】:Kubectl describe returns 404 for IngressesKubectl 描述 Ingress 的返回 404
【发布时间】:2019-07-10 12:37:14
【问题描述】:

我今天重新安装了我的系统,因为我无法再使用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"}

【问题讨论】:

  • 嗨,你能不能运行kubectl version 希望客户端和服务器都没有兼容性问题
  • 嗨 @Joachim,降级 kubectl 解决了您的问题吗?

标签: kubernetes kubectl kubernetes-ingress


【解决方案1】:

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

在 k8s v.15 中,ingressnetworking.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

【讨论】:

    【解决方案2】:

    尝试运行

    kubectl get ingress
    

    如果您在命名空间中定义了入口而不是默认使用以下:

    kubectl get ingress -n <NSNAME>
    

    获得入口资源列表后,您可以使用以下方式进行描述:

    kubectl describe ingress <IngressName> -n <Namespace>
    

    【讨论】:

      猜你喜欢
      • 2019-04-23
      • 2010-11-26
      • 1970-01-01
      • 2019-09-10
      • 1970-01-01
      • 1970-01-01
      • 2021-11-06
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多