Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Support for backend buckets #214

Open
process0 opened this issue Feb 4, 2019 · 4 comments
Open

Support for backend buckets #214

process0 opened this issue Feb 4, 2019 · 4 comments

Comments

@process0
Copy link

process0 commented Feb 4, 2019

Is there a way to define a route to a backend bucket on GCP using the MCI yaml file? I know I can edit the Load Balancer to add the route manually using the GCP web UI. I can also manually edit the URL maps file using gcloud and a file editor, but there is no nice way to automate this.

I suggest having bucketName and bucketCdn elements for the backend section. We could check for the existence of the cloud storage bucket, and create the backend bucket if it exists or fail if it does not exist.

spec:
  backend:
    serviceName: default-http-backend
    servicePort: 8080
  rules:
  - http:
      paths:
      - path: "/api/*"
        backend:
          serviceName: "api"
          servicePort: 3000
      - path: "/static/*"
        backend:
          bucketName: "api-assets"
          bucketCdn: true
@nikhiljindal
Copy link
Contributor

MCI does not support this currently. We reuse the single cluster ingress spec and hence we will need to change that to add the bucket params as suggested here.

The workarounds you enumerated for using GCP Web UI or gcloud will work. Note that they will be overwritten anytime you run kubemci create again.

@cagataygurturk
Copy link

cagataygurturk commented Mar 9, 2019

Hello @nikhiljindal , I am planning to add storage bucket storage support to kubemci. The design in my mind is like following:

  • Every cluster would have a headless service with an annotation pointing out to storage bucket
apiVersion: v1
kind: Service
metadata:
  name: prod-static-bucket
  labels:
    app: djangoapp
  annotations:
    kubernetes.io/ingress.storage-bucket-name: "bucket_name"
spec:
  clusterIP: None
  • Then this service would be referred in standard Ingress resource:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: zoneprinter
  annotations:
    kubernetes.io/ingress.class: gce-multi-cluster
    kubernetes.io/ingress.global-static-ip-name: $ZP_KUBEMCI_IP
spec:
  rules:
  - http:
      paths:
      - path: "/static/*"
        backend:
          serviceName: prod-static-bucket
          servicePort: 3000 #Simply ignored

In addition, BackendConfig can be supported by kubemci to enable CDN for this endpoints.

What do you think?

@nevelis
Copy link

nevelis commented May 9, 2019

@cagataygurturk Heya, did you make any progress on this?

@dinvlad
Copy link

dinvlad commented Feb 24, 2020

Any updates on this? Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants