Ingress 中的 StorageBucket 支持

StorageBucket support in Ingress

我在GKE 1.18.17-gke.700

根据参考,api 参考似乎支持它:

但是我收到这个错误:

The Ingress "sample-ingress" is invalid: spec.rules[0].http.paths[0].backend.resource: Forbidden: not supported; only service backends are supported in this version

示例配置如下所示:

...
...
...
spec:
  rules:
    - host: "example.example.com"
      http:
        paths:
          - path: "/hello"
            pathType: ImplementationSpecific
            backend:
              resource:
                kind: StorageBucket
                name: hello-bucket
          - path:
...
...
...

目前无法设置 GKE Ingress 以将请求发送到 GCS 存储桶。已创建一个功能请求来解决它(您可以关注它以获取将来的更新):

这是您遇到的问题之外的信息,我将在下面解决。


您无法创建 Ingress 资源:

The Ingress "sample-ingress" is invalid: spec.rules[0].http.paths[0].backend.resource: Forbidden: not supported; only service backends are supported in this version

因为以下消息:

Forbidden: not supported; only service backends are supported in this version

简而言之,您的 Kubernetes API 拒绝此清单,因为它在此特定版本中仅支持 Service 后端。


Ingress 在版本 1.19 中有一些重大更改(从 Beta 更改为 GA (General Availability):

为了:spec.rules.http.paths.backend.resourceAPI 接受,您需要更新您的 GKE 集群到版本 1.19(或更新版本)。(这仍然无法工作)

A side note!

If you've decided to upgrade your GKE cluster to version 1.19 and newer, please use:

  • networking.k8s.io/v1
  • instead of networking.k8s.io/v1beta (deprecated in v1.19+, unavailable in v1.22+)

我鼓励您查看其他资源: