ingress-nginx icon indicating copy to clipboard operation
ingress-nginx copied to clipboard

How to use StorageBucket resource with ingress nginx on GCP?

Open jkabat opened this issue 4 years ago • 21 comments

K8s documentation shows that StorageBucket resource can easily be configured for an ingress (v1.19+). However I did not find any example how to make it work with ingress-nginx on GKE. Is there any piece of puzzle missing? Is it possible or is it not yet ready to use like that?

K8s documentation GCP tutorial for backend bucket creation

jkabat avatar Feb 15 '21 19:02 jkabat

https://github.com/kubernetes/ingress-nginx/issues/1809

toredash avatar Feb 15 '21 20:02 toredash

@toredash thank you for your response.

I have seen the issue. I have also seen #33 on ingress-gce but both are pretty old and StorageBucket resource is new feature. I just hoped it can be used out of the box but it is not well documented yet.

Can anybody shed a light on it?

jkabat avatar Feb 16 '21 07:02 jkabat

Something like this ?

apiVersion: v1
kind: Service
metadata:
  name: googlestoragebucket
spec:
  externalName: storage.googleapis.com
  ports:
  - name: https
    port: 443
    protocol: TCP
    targetPort: 443
  type: ExternalName
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
    nginx.ingress.kubernetes.io/rewrite-target: /<bucketnameingoogle>/$1
  name: googlestorage
spec:
  rules:
  - host: your.domain.info
    http:
      paths:
      - backend:
          serviceName: googlestoragebucket
          servicePort: 443
        path: /(.+)

This is course assume your bucket is public. Need tio m

toredash avatar Feb 16 '21 08:02 toredash

@toredash thank you for your help, but my question is regarding StorageBucket resource not the way it was done before kubernetes v1.19. In the first link you can find an example:

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource-backend
spec:
  defaultBackend:
    resource:
      apiGroup: k8s.example.com
      kind: StorageBucket
      name: static-assets
  rules:
    - http:
        paths:
          - path: /icons
            pathType: ImplementationSpecific
            backend:
              resource:
                apiGroup: k8s.example.com
                kind: StorageBucket
                name: icon-assets

jkabat avatar Feb 16 '21 09:02 jkabat

I'm not sure if this is supported in ingress-nginx at all, sorry. The code i provided above should work though expose resources in the bucket.

toredash avatar Feb 16 '21 10:02 toredash

@jkabat , you found any example usage this api ?

KiPSOFT avatar Mar 07 '21 15:03 KiPSOFT

@KiPSOFT unfortunately not. I had to use old service way to use GCS bucket...

jkabat avatar Mar 08 '21 09:03 jkabat

I'm in the dark also, I thought that apiGroup: k8s.example.com might be storage.googleapis.com but I'm really lost as to what it should be.

tibers avatar Mar 10 '21 21:03 tibers

Has there been any resolution on this issue? I have been trying to update my current GKE ingress controller to point to a GCS bucket. Cluster has been updated to 1.19.9-gke.140. Every time I attempt to use the example posted by jkabat I keep getting the following error?

invalid ingress spec: could not find service "default/"; could not find service "default/

I do have a service created that interacts fine with my ingress controller. Normally you point at the correct service, but I have not found an example for interacting with a StorageBucket. Is there an additional service that needs to be created and pointed at? If so, what key needs to be added to Bucket resource.

EX: of ingress working fine with service paths: - path: /* backend: serviceName: qa-example servicePort: 8050

jprogramtech avatar Jun 01 '21 18:06 jprogramtech

@jprogramtech as far as I know kind: StorageBucket is still not supported by ingress-nginx.

jkabat avatar Jun 02 '21 06:06 jkabat

It sounds it is yet need to implement: https://issuetracker.google.com/issues/182815525?pli=1

Unless kind: StorageBucket comes as custom resource from nginx controller. Is there any guru who can confirm that?

devopsangel avatar Jun 17 '21 15:06 devopsangel

/help

iamNoah1 avatar Aug 26 '21 14:08 iamNoah1

@iamNoah1: This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Aug 26 '21 14:08 k8s-ci-robot

@rikatz @strongjz can you clarify?

iamNoah1 avatar Nov 17 '21 17:11 iamNoah1

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 15 '22 17:02 k8s-triage-robot

/assign @strongjz

strongjz avatar Mar 15 '22 16:03 strongjz

/triage accepted /priority backlog

iamNoah1 avatar Apr 12 '22 08:04 iamNoah1

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar May 12 '22 09:05 k8s-triage-robot

/remove-lifecycle rotten

On Thu, May 12, 2022 at 5:00 AM Kubernetes Triage Robot < @.***> wrote:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

Please send feedback to sig-contributor-experience at kubernetes/community https://github.com/kubernetes/community.

/lifecycle rotten

— Reply to this email directly, view it on GitHub https://github.com/kubernetes/ingress-nginx/issues/6875#issuecomment-1124715955, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABMAT4FMUS26TD25O5VNDEDVJTCDTANCNFSM4XVHBX6A . You are receiving this because you commented.Message ID: @.***>

tibers avatar May 12 '22 21:05 tibers

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 10 '22 22:08 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Sep 09 '22 22:09 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Oct 09 '22 23:10 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

k8s-ci-robot avatar Oct 09 '22 23:10 k8s-ci-robot