minioopenfaas

OpenFaaS Function cannot access Minio


I have OpenFaaS and Minio both deployed on Kubernetes. I am following this tutorial to try to get an OpenFaaS function to interact with Minio buckets: https://blog.alexellis.io/openfaas-storage-for-your-functions/

However, whenever I try to invoke the processimages function (which accesses a Minio bucket) in OpenFaaS, the program runs for a few seconds before returning a 502 Bad Gateway error. In fact, this happens anytime I try to access MinIO from within any OpenFaaS function.

Interestingly, MinIO seems to work fine in functions that are not running in OpenFaaS, but as soon as I try to run them from within OpenFaaS, I get 502 Bad Gateway.

What could be causing this?


Solution

  • Figured it out, when I first configured Minio, I set the IP address of the endpoint/hostname to localhost:9000. This worked fine on my local machine, but inside an OpenFaaS container, localhost refers to the container's IP, not my machine's IP, so OpenFaaS functions could not access Minio.