Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Environment variable KUBERNETES_SERVICE_HOST not redirected to the host #622

Open
coderyangyangyang opened this issue Mar 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@coderyangyangyang
Copy link

Describe the bug
I use mac vscode Kubernetes and import the kubeconfig file to add a remote k8s cluster, and use Bridge to Kubernetes debug local. due to my service using k8s go client to create the k8s job, the environment variable KUBERNETES_SERVICE_HOST is needed, the kubernetes service dns is redirected to the host, but environment variable KUBERNETES_SERVICE_HOST is not redirected to the host, it's remote host ip, we set the jump server, so remote host port cannot connect derectly, so I got connection refused error when creating a k8s cleint in my program.

version info
vscode Bridge to Kubernetes v2.0.120240111
vscode Kubernetes v1.3.15
MacOS 13.5

Logs:
Deployment 'default/fine-tuning-job-service' patched to run agent.
Remote agent deployed in container 'fine-tuning-job-service' in pod 'fine-tuning-job-service-855bdb64db-q74sd'.
Preparing to run Bridge To Kubernetes configured as pod default/fine-tuning-job-service-855bdb64db-q74sd ...
Connection established.
Hosts file updated.
Service 'model-management-service' is available on 127.1.1.1:8080.
Service 'model-management-service' is available on 127.1.1.1:8081.
Service 'model-management-service' is available on 127.1.1.1:8082.
Service 'chatbot-service' is available on 127.1.1.9:8022.
Service 'kubernetes' is available on 127.1.1.10:443. // redirected to host
Service 'chatbot-demo' is available on 127.1.1.11:8022.
Container port 8090 is available at localhost:5567.
Container port 8091 is available at localhost:null.
Container port 8092 is available at localhost:null.
Downloading volume 'kube-api-access-5wv92' from '/var/run/secrets/kubernetes.io/serviceaccount' ...
Downloading from '/var/run/secrets/kubernetes.io/serviceaccount' ...
Download completed.
##################### Environment started. #############################################################
Run /var/folders/cd/rz2jslxd40b3nyt0w8l6n645jq3w_7/T/tmp-28101CsVEicjVgl0M.env.cmd in your existing console to also get connected.
Service connected: fine-tuning-job-service

Local service IPs:
Local DNS service is not running.
Environment variables:
KUBERNETES_PORT_443_TCP_ADDR=xxx.xx.xx.163 // remote server ip
KUBERNETES_PORT_443_TCP_PROTO=tcp
KUBERNETES_SERVICE_PORT_HTTPS=443
KUBERNETES_PORT=tcp://xxx.xx.xx.163:443
KUBERNETES_SERVICE_PORT=443
KUBERNETES_PORT_443_TCP=tcp://xxx.xx.xx.163:443
KUBERNETES_SERVICE_HOST=xxx.xx.xx.163
KUBERNETES_PORT_443_TCP_PORT=443

@coderyangyangyang coderyangyangyang added the bug Something isn't working label Mar 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant