Serving the phpmyadmin container with nginx container, both inside the same kubernetes cluster

3/9/2020

1.My problem

Disclaimer: I specify that I ask this question within the framework of an IT school project

Inside our kubernetes cluster, we have a nginx container and a phpmyadmin container, both built 'FROM alpine:3.11.3' with the help of 2 dockerfiles.

We just would like to use the nginx container to serve the phpmyadmin container and then be able to access the phpmyadmin service from outside the cluster.

Unfortunately when we access the phpmyadmin service it shows us a blank page instead of the usual login form ...

Here are the nginx and phpfpm logs written inside:

  • nginx_container:var/log/nginx/access.log
  • nginx_container:var/log/nginx/error.log
  • nginx_container:var/log/php7/error.log

2.What we tried

Lot of things. Our actual strategy to meet the subject requirements is the following: With kubernetes we created shared volumes '/usr/share/nginx/html/' which contains the phpmyadmin directory(1) and we try to access it from the nginx.conf as this the path specified for the root directive

(1) downloaded on https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip

3.My code

See our code on https://github.com/Fraberg/ft_services/tree/master/nieyraud_services/v6

  • The nginx container path: /srcs/nginx/.
  • The phpmyadmin container path: /srcs/phpmyadmin/.

We use the script ./setup.sh to launch the cluster on virtualbox, build the container, apply the yaml configs, etc. We use ingress.


We use:

  • macOS Mojave version 10.14.6
  • Docker version 19.03.5
  • Minikube 1.8.1 with Virtualbox version 6.0.14

Any suggestions are welcome !

Also please feel free to invit me to edit this question if needed

-- francis berger
docker
kubernetes
nginx
nginx-config
phpmyadmin

0 Answers