-
Notifications
You must be signed in to change notification settings - Fork 10.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Environment variable collision with Kubernetes #24999
Comments
what redis driver do you use in Laravel? Predis or phpredis? |
Predis and the setup in the documentation of laravel. |
Interesting thing I found out now: When i call
But this is in my
|
Appendix: Looks like Kubernetes and Laravel are using the same ENV-variable but in a different way. Because I have another container, the database, called
So, my issue is specific, when you have a container called |
I'm not sure what we can do here, if Kubernetes changes environment variables you have to either open an issue with them, or maybe just add your own |
I think, the framework is fine, nothing to do here. My solution was to change the config in
Now, the config checks first, if the Advantage of this solution is, that |
This issue also resurface if you host your laravel projects using same php files. even when multiple instance of php are running. environment variable collision occurs. I had to name all variable differently across all projects. |
Description:
I don't know, if this issue is related to the Laravel framework, but this is the output, if I am running my application as a kubernetes pod. The following log is from my laravel.log after hitting the application. The app tries to fetch some cached data from redis, but you have to look at the hostname in the brackets.
[tcp://redis:tcp://10.7.240.204:6379]
-> 'redis' is the internal hostname from my ENV-file and the IP is the IP coming from kubernetes. The correct string would be[tcp://redis:6379]
, all data coming from my ENV-file.Maybe some of you have a solution or maybe it's a framework bug. By the way: the application is running on my docker-compose setup very well, without hostname issues.
These are my ENV-Settings:
The text was updated successfully, but these errors were encountered: