Open titansmc opened 7 months ago
Hello titansmc,
if KUBERNETES_SERVICE_HOST
and KUBERNETES_SERVICE_PORT
are defined then pyos loads the incluster config else it loads kube config.
if os.getenv('KUBERNETES_SERVICE_HOST') and os.getenv('KUBERNETES_SERVICE_PORT') :
config.load_incluster_config() # set up the client from within a k8s pod
else:
config.load_kube_config()
This could be the source of this issue, could you try to unset KUBERNETES_SERVICE_HOST
and KUBERNETES_SERVICE_PORT
and use kube config.
I hope this will help you
Alexandre
We are overwriting
KUBERNETES_SERVICE_HOST
andKUBERNETES_SERVICE_PORT
because we need pyos to reach the API servers directly, since after applying some network policies, the default namespace service cannot be reached. What is it failing still why it still tries to use kubernetes.default.svc instead ?