Kubernetes Namespace Env Headers

9/7/2018

I have noticed that Kubernetes adds all the workloads on the namespace into the PHP/Enviroment variables.

Example: _ENV["WORKLOAD_XXX_LB_PORT_80_TCP_ADDR"] _ENV["WORKLOAD_XXX_LB_PORT_80"]

Is there any way to remove those variables?

Thanks.

-- Chris
docker
kubernetes
php

1 Answer

9/7/2018

The quick answer is no.

However, you can add something like this to your container entry script:

env -i bash

or

for c in $(printenv | cut -d '=' -f 1); do unset $c; done
-- Rico
Source: StackOverflow