-
Notifications
You must be signed in to change notification settings - Fork 59
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
B2K Skips NodePort Services - Evaluate supporting it #143
Comments
Thanks for raising this issue. Can you share the logs from /tmp/Bridge To Kubernetes folder ? I can see following error
|
@hsubramanianaks Thanks for your reply. I think By comparing with kubernete's service ,it hits to me that only these services which type is For invoking other services,using service name like first unsuccessful log second successful log |
@GKilm Thanks for providing the logs, we will look into it. |
I'm sorry that I didn't make it clear. Two questions are mentioned above.One is that connecting to the cluster by the B2K fail sometimes, the other is that these services which have I'm not very concerned about the first question because I could fix it by retrying. For the second question, I hope these services which are in the cluster could be connected in the program being debugged.This article tells me that service name cann't be used with using VS Code Remote SSH,but using I really want to use service name like So I just want to connect to these service which type is Thanks. |
@GKilm B2K debugging works at Pod level not service level, even though VS code extension or VS extension allows user to select a service via UI. Behind the scenes B2K redirections are between pods. Here is the link for the documentation about it. Also, if you want to make a service available (ex: in your case services with type NodePort), you can try by defining it KubernetesLocalProcessConfig.yaml here is the link for the documentation about it. Please try and let us know, thank you. Also note: we released a new version of B2K on 01/17 , please try again using latest version and see if it resolves the issues. |
@hsubramanianaks I have tried the latest version which is I read the documentation about B2K in the website over and over again and learn how it should work. With defining the configure file KubernetesLocalProcessConfig.yaml version: 0.1
env:
- name: DEFAULT_KEYSTONE_SERVICE_HOST
value: $(services:default-keystone) environment variable in the connected terminal In this cluster, apiVersion: v1
kind: Service
metadata:
labels:
app: keystone
app.kubernetes.io/component: keystone
app.kubernetes.io/instance: onecloud-cluster-hqj5
app.kubernetes.io/managed-by: onecloud-operator
app.kubernetes.io/name: onecloud-cluster
name: default-keystone
namespace: onecloud
ownerReferences:
- apiVersion: onecloud.yunion.io/v1alpha1
blockOwnerDeletion: true
controller: true
kind: OnecloudCluster
name: default
uid: a264ee32-809e-45cf-bcfc-ae0303875553
resourceVersion: "15789641"
selfLink: /api/v1/namespaces/onecloud/services/default-keystone
uid: 097baf49-9c56-41ef-9875-2a81dd103d42
spec:
clusterIP: 10.108.188.31
externalTrafficPolicy: Cluster
ports:
- name: public
nodePort: 30500
port: 30500
protocol: TCP
targetPort: 30500
- name: admin
nodePort: 30357
port: 30357
protocol: TCP
targetPort: 30357
selector:
app: keystone
app.kubernetes.io/component: keystone
app.kubernetes.io/instance: onecloud-cluster-hqj5
app.kubernetes.io/managed-by: onecloud-operator
app.kubernetes.io/name: onecloud-cluster
sessionAffinity: None
type: NodePort
status:
loadBalancer: {} By the way,how can I establish a connection for the service with more than one port by using |
Hi @GKilm! I believe syntax you are using on yaml file is wrong, can you try with below (below assumes service is in default namespace) and let me know if it works.
This section explains more about it and I added screenshoot below of the relevant part. Let me know if this does not help. It is also worth noting that all the services in the namespace of the service you are debugging will be added by default to env variables when you are running using useKubernetesServiceEnvironmentVariables=true. You only need to manually add it for service outside the namespace your service being debugged is (per task.json config you shared the target namespace is onecloud so that is why service from default namespace are not being added by default). |
My question is exactly that not all the services in the namespace of the service are added.By contrast,I found services that have not been added are those port types are It is maybe helpful by reviewing this issue |
@GKilm , could you provide an example of what is in task.json and what service you expect that is not added by default? From looking at the messages I noticed the task.json has a different namespace than the namespace of the service you said you expected to see. There were a lot of message so apologies if I missed anything. Thank you! |
@GKilm, you are correct today B2K skips NodePort type of service. Could you share how your services connect to those of type node port? Does it use dns or hardcoded ip? In other words if serviceA wants to talk to serviceB of type NodePort, would it to IP:port or serviceB:port? Thank you! Below would be where NodePort is excluded. I believe in the past decision to do so has been because services of type NodePort cannot be reached using DNS and bridge only works with services that have dns enabled. I will add this to our planning to triage.
|
Thanks for your work.I think it could be solved by your submit. |
@GKilm no problem! I am hoping this can go in this week and rollout next week. Will keep you updated :) |
@GKilm This is rolled out, can you try and see if it works for you. Thank you. |
@GKilm Closing this issue since it's been a month and hoping latest release fixed your issue. Thank you. |
Describe the bug
The program being debugged by B2K can't connect other services in the cluster.
Here are the environment variable in the debugged pod and the dev computer.
the debugged pod
connected shell in the dev computer
For example,I want to get the
keystone
service in the cluster by the debug process on my computer,but the errordial tcp: lookup default-keystone on 10.0.14.14:53: no such host
occurs.By reading the document, I think
kubectl port-forward
is a failure. Meanwhile,the/etc/hosts
file on the remote machine isn't changed.I use B2K in remote machine by
Remote Development
, makeuseKubernetesServiceEnvironmentVariables
as true in thetask.json
file.Mention the platform you are using
To Reproduce
example project:
cloudpods
vscode config
.vscode/task.json
.vscode/task.json
debug
Expected behavior
I want to connect to service in the cluster on the development machine.
Screenshots
Additional context
vscode log
vscode-b2k.log
The text was updated successfully, but these errors were encountered: