We are overwriting KUBERNETES_SERVICE_HOST and KUBERNETES_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 ?
[root@moscardo ~]# kubectl exec -ti -n abcdesktop-ns pyos-od-598d4d6989-49ffm -- env|grep KUB
KUBERNETES_SERVICE_HOST=k1api.domain.de
KUBERNETES_SERVICE_PORT=6443
KUBERNETES_SERVICE_PORT_HTTPS=6443
KUBERNETES_PORT_443_TCP=tcp://10.133.0.1:443
KUBERNETES_PORT_443_TCP_PORT=443
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_PORT=tcp://10.133.0.1:443
KUBERNETES_PORT_443_TCP_ADDR=10.133.0.1