Recommended way of serving static content like videos/images on k8s

7/4/2019

I'm pretty green with Kubernetes but have some experience with Google Container Engine. I'm struggling to find a good solution for serving media content from applications.

I've currently got media stored in a public bucket on Google Cloud Platform, and i'm running an NGINX proxy on local to take any path /images to the bucket for example:

    location /videos {
      proxy_pass https://storage.googleapis.com/bucket-name/videos;
      proxy_intercept_errors on;
      error_page 500 502 503 504 404 = @localmedia;
    }

What way would you recommend to serve media content on applications running on k8s?

-- jwtea
cdn
google-cloud-platform
google-kubernetes-engine
kubernetes
static-files

1 Answer

7/4/2019

If you need to serve static files form Google Cloud Storage the best way is to use directly the custom domain bucket feature no use K8S.

https://cloud.google.com/storage/docs/hosting-static-website

Basically you need to create your bucket as public with the name of the domain or subdomain you want to use and pint it as a CNAME to the special domain c.storage.googleapis.com

With that said, what is the main reason to use k8s?

-- wolmi
Source: StackOverflow