I started by creating a service running a single wordpress container and it worked. Wordpress could connect to the database, and show the pages i wanted.
Now, after adding an nginx proxy to enforce basic authentication, suddendly i get the usual "could not connect to database page", the one saying that class-phpdb.php does not exist but maybe it is the database's fault.
Ok, so what i tried then was to run a single mysql container with a script as startup command, which got me the output i was looking for. And once again, after adding another container (the proxy because i was lazy) the output was: "Can't connect to local MySQL server through socket '/cloudsql/project:region:dbname'"
So the next idea was to do all the tests done before by replacing the startup command with an "ls -l /cloudsql" command and of course i got what i expected, said a find in single container pods, and a no such file in dual container pods.
Also i had made these test both with a single container database mount an dual, just to put aside the hypothesis where concurrent mounts were impossible.
Has anyone of you met this issue or know why it happens ?
Hi Naesa, as a workaround could you try to deploy cloud sql proxy as a sidecar as shown here and let us know if that's an acceptable solution for you? Thanks
Hello Sagarrandive,
First of all thanks for your answer.
Yes, i did that and it works. But since my team really is "google made it so it's done this way", and i understand it, i don't know if it will be considered a good solution (especially as they are already happy with GKE and i'm only trying to explore new ways to optimise our workloads). And personally, i'm not really at ease giving up something that has no apparent reason not to work, let aside adding weight to the pod doing so.
There is no non-workaround solution then ?