markhilton / larakube

Laravel app deployment for auto scaled Kubernetes cluster
MIT License
173 stars 38 forks source link

App secrets not being loaded by laravel #3

Open joaogl opened 6 years ago

joaogl commented 6 years ago

Hello,

I've been playing around this and actually added a secret for the laravel app settings (.env file), on Laravel 5.7 I'm not being able to use the env settings on the laravel.

If I enter the php-fpm container and run echo $MYSQL_USER I get homestead (correct, is what I passed in the docker variables) but when I run php artisan migrate for example it uses the forge user (which is the default when no variable is found). If I create a .env file it uses that file correctly. having this said, how can I get this to work with the docker environment variables?

markhilton commented 5 years ago

It's possible that individual .env files were not linked to specific containers maybe? I've refactored the code a bit and for local development, I've moved environment variables directly into docker-compose.yml

For Kubernetes deployment I've switched to Helm package manager, as its easier to deploy / upgrade / remove entire application with a single command.

I realize README.md still lacks proper documentation and Helm chart itself could be improved to provide more installation options (Load Balancer or Ingress, other variables), but this is all my free time today.