<p>Ok here is the story:</p>

<p>I am using minikube to host my application:</p>

<p>1 pod running redis (redis on ubuntu:14.04)</p>

<p>1 pod running my php application (php7-apache)</p>

<p>I realised that if I setup my redis pod first then my php pod, my php pod will have these extra env variables:</p>

<pre><code>REDIS_SERVICE_PORT=6379
REDIS_PORT_6379_TCP_ADDR=10.0.0.229
REDIS_PORT_6379_TCP_PORT=6379
REDIS_PORT_6379_TCP=tcp://10.0.0.229:6379
REDIS_PORT=tcp://10.0.0.229:6379
REDIS_SERVICE_HOST=10.0.0.229
</code></pre>

<p>These variables override the port I setup for my php project.</p>

<p>To counter it, I have to explicitly set the REDIS_PORT in my yaml file for my php deployment.</p>

<p>Any idea why this happened?  And clean way to simply avoid this?</p>

<p>Thanks!</p>

<p>Ooooook, got the answer.</p>

<p>Credits to @aschepis.</p>

<p>For some mysterious reason, if I name my deployment to be exactly "redis" in the redis pod, the env variables will be injected to other pods who comes later.</p>

<p>As long as I renamed the deployment to another name, things went back to normal...</p>

<p>Thanks again to @aschepis.</p>
