node.jsobjectlambdaminioknative

Make Min.IO on Kubernetes to send correct presigned URL to object lambda on knative


I'm having this trouble: I have a minio instance on kubernetes with my minio-dev.example.io dominio, I also have my object lambda to transform some files but this one is on Knative pod: http://object-transform.example.com/transformFiles. Then I'm using Node.js SDK to create a new presignedURL to retrive my transformed file with this object:

const minioClient = new Minio.Client({
endPoint: 'minio-dev.example.io',
useSSL: true,
accessKey: 'MyUser',
secretKey: 'MyPassword',})

And this is the way that I'm requesting my transformed file: await minioClient.presignedGetObject('dev', 'large_dataset.csv', 10000, { lambdaArn: 'arn:minio:s3-object-lambda::transformParquet:webhook' })

My issue is when Min.IO is sending the inputS3Url to the object-lambda is like this: http://localhost:9000/dev/large_dataset.csv?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=MyUser.... Min.IO is signing the url as localhost and this is making my object lambda to not reach my Min.IO back with a ECONNREFUSED error.

I was reading Min.IO docs and found this deprecated environment variable MINIO_SERVER_URL that I think could help me but since is deprecated I wonder if there is a modern way to solve this. Or if this is no more on my side and can request some changes to my infrastructure team. I read that this could be solved with some changes with NGINX but this is beyond my knowledge. Thank you for any help you could grant me.


Solution

  • https://github.com/minio/minio/issues/8007#issuecomment-2044634015 suggests that using MINIO_SERVER_URL and MINIO_BROWSER_REDIRECT_URL is the mechanism for this scenario.