Describe the bug
Kubernetes port environment variables (KUBERNETES_SERVICE_PORT and KUBERNETES_SERVICE_PORT_HTTPS) are blank if you are using a kcp exposed via the default port (443) and don't explicitly add it to the server url.
Use a kubeconfig that does not specify the port of the server url e.g. server: kcp.mykcp.com
Add a workload cluster and sync it
Deploy an application
Pod will complain if it is trying to do anything with the default kube client, something like:
W0613 16:55:57.404049 1 client_config.go:622] error creating inClusterConfig, falling back to default config: unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined
Describe the bug Kubernetes port environment variables (KUBERNETES_SERVICE_PORT and KUBERNETES_SERVICE_PORT_HTTPS) are blank if you are using a kcp exposed via the default port (443) and don't explicitly add it to the server url.
Environment that is added by kcp:
To Reproduce Steps to reproduce the behavior:
server: kcp.mykcp.com
Note: Adding port 443 to the server URL (kcp.mykcp.com:443) in the kubeconfig gets round the issue. Code here must be returning nothing https://github.com/kcp-dev/kcp/blob/af114bdd7c0a3105e79485fd4176de1693e465ea/pkg/syncer/spec/mutators/deployment.go#L112
Expected behavior Environment variable should be set
Additional context Only tested with 0.5.0