bitpoke / wordpress-operator

Bitpoke Kubernetes operator for WordPress
Apache License 2.0
226 stars 35 forks source link

Unable to get S3 media bucket to work #77

Open RichardMills opened 4 years ago

RichardMills commented 4 years ago

What happened:

I'm setting up a Wordpress site using the wordpress-operator. For media backing store, I was hoping to use S3.

I read through the CRD spec and found that it supports s3: media library as well as gcs: media library. So I created a definition block that should have made use of a bucket and stored media there. I tested it by visiting my Media library and upload/view some images. Instead of pushing/pulling the images from S3, it created a wp-content/uploads directory and stored the sample images in there.

spec:
  media: # where to find the media files
    # For S3, see: https://github.com/presslabs/wordpress-operator/blob/ce3af26178f206075ba7bde57985beb4181f59cb/config/crds/wordpress.presslabs.org_wordpresses.yaml#L1868
    s3:
      bucket: my-bucket
      prefix: mysite
      env:
        - name: AWS_ACCESS_KEY_ID
          valueFrom:
            secretKeyRef:
              name: wordpress-aws-secret
              key: aws_access_key_id
        - name: AWS_SECRET_ACCESS_KEY
          valueFrom:
            secretKeyRef:
              name: wordpress-aws-secret
              key: aws_secret_access_key

I also created the wordpress-aws-secret with proper credentials.

What you expected to happen:

I expected that after starting up mysite with the wordpress-operator, the Media library would either read/write images to S3 or at least start spewing errors due to misconfiguration. That is what happened when I put some dummy gcs: configuration settings in. (I don't actually have a GCS account.)

How to reproduce it (as minimally and precisely as possible):

Anything else?:

Is there anything else that needs to be done to configure Wordpress to use S3?

AMecea commented 4 years ago

Hi, @RichardMills did you installed stack-mu-plugin? In order to work, you have to install this plugin which creates a stream wrapper, more details can be found here

RichardMills commented 4 years ago

I will attempt to get this plugin installed. Let me know if there's any docs associated with making this work within the operator or if there's any slick way to tell the operator about mu plugins. I think my plan is:

AMecea commented 4 years ago

Here are two examples:

everythings-gonna-be-alright commented 1 year ago

As i understand this plugin support only gcp

amanmallsops commented 4 months ago

hi, @AMecea I followed all the instructions when I tried to use stack-mu-plugin with S3, but I still can't get it to function. I am receiving an error message saying "Invalid protocol S3 for media storage." can you please suggest me. image