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

B2K Skips NodePort Services - Evaluate supporting it #143

Closed
GKilm opened this issue Jan 10, 2023 · 14 comments
Closed

B2K Skips NodePort Services - Evaluate supporting it #143

GKilm opened this issue Jan 10, 2023 · 14 comments
Assignees
Labels
good first issue Good for newcomers inprogress production fix/feature deployed to prod waiting for response Waiting for a response by the original author of the ticket

Comments

@GKilm
Copy link

GKilm commented Jan 10, 2023

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

export DEFAULT_ANSIBLESERVER_PORT='tcp://10.98.132.103:30890'
export DEFAULT_ANSIBLESERVER_PORT_30890_TCP='tcp://10.98.132.103:30890'
export DEFAULT_ANSIBLESERVER_PORT_30890_TCP_ADDR='10.98.132.103'
export DEFAULT_ANSIBLESERVER_PORT_30890_TCP_PORT='30890'
export DEFAULT_ANSIBLESERVER_PORT_30890_TCP_PROTO='tcp'
export DEFAULT_ANSIBLESERVER_SERVICE_HOST='10.98.132.103'
export DEFAULT_ANSIBLESERVER_SERVICE_PORT='30890'
export DEFAULT_ANSIBLESERVER_SERVICE_PORT_API='30890'
export DEFAULT_APIGATEWAY_PORT='tcp://10.106.234.148:30300'
export DEFAULT_APIGATEWAY_PORT_30300_TCP='tcp://10.106.234.148:30300'
export DEFAULT_APIGATEWAY_PORT_30300_TCP_ADDR='10.106.234.148'
export DEFAULT_APIGATEWAY_PORT_30300_TCP_PORT='30300'
export DEFAULT_APIGATEWAY_PORT_30300_TCP_PROTO='tcp'
export DEFAULT_APIGATEWAY_PORT_30443_TCP='tcp://10.106.234.148:30443'
export DEFAULT_APIGATEWAY_PORT_30443_TCP_ADDR='10.106.234.148'
export DEFAULT_APIGATEWAY_PORT_30443_TCP_PORT='30443'
export DEFAULT_APIGATEWAY_PORT_30443_TCP_PROTO='tcp'
export DEFAULT_APIGATEWAY_SERVICE_HOST='10.106.234.148'
export DEFAULT_APIGATEWAY_SERVICE_PORT='30300'
export DEFAULT_APIGATEWAY_SERVICE_PORT_API='30300'
export DEFAULT_APIGATEWAY_SERVICE_PORT_WS='30443'
export DEFAULT_CLOUDEVENT_PORT='tcp://10.103.129.124:30892'
export DEFAULT_CLOUDEVENT_PORT_30892_TCP='tcp://10.103.129.124:30892'
export DEFAULT_CLOUDEVENT_PORT_30892_TCP_ADDR='10.103.129.124'
export DEFAULT_CLOUDEVENT_PORT_30892_TCP_PORT='30892'
export DEFAULT_CLOUDEVENT_PORT_30892_TCP_PROTO='tcp'
export DEFAULT_CLOUDEVENT_SERVICE_HOST='10.103.129.124'
export DEFAULT_CLOUDEVENT_SERVICE_PORT='30892'
export DEFAULT_CLOUDEVENT_SERVICE_PORT_API='30892'
export DEFAULT_CLOUDID_PORT='tcp://10.111.27.107:30893'
export DEFAULT_CLOUDID_PORT_30893_TCP='tcp://10.111.27.107:30893'
export DEFAULT_CLOUDID_PORT_30893_TCP_ADDR='10.111.27.107'
export DEFAULT_CLOUDID_PORT_30893_TCP_PORT='30893'
export DEFAULT_CLOUDID_PORT_30893_TCP_PROTO='tcp'
export DEFAULT_CLOUDID_SERVICE_HOST='10.111.27.107'
export DEFAULT_CLOUDID_SERVICE_PORT='30893'
export DEFAULT_CLOUDID_SERVICE_PORT_API='30893'
export DEFAULT_CLOUDPROXY_PORT='tcp://10.105.131.38:30882'
export DEFAULT_CLOUDPROXY_PORT_30882_TCP='tcp://10.105.131.38:30882'
export DEFAULT_CLOUDPROXY_PORT_30882_TCP_ADDR='10.105.131.38'
export DEFAULT_CLOUDPROXY_PORT_30882_TCP_PORT='30882'
export DEFAULT_CLOUDPROXY_PORT_30882_TCP_PROTO='tcp'
export DEFAULT_CLOUDPROXY_SERVICE_HOST='10.105.131.38'
export DEFAULT_CLOUDPROXY_SERVICE_PORT='30882'
export DEFAULT_CLOUDPROXY_SERVICE_PORT_API='30882'
export DEFAULT_DEVTOOL_PORT='tcp://10.107.68.212:30997'
export DEFAULT_DEVTOOL_PORT_30997_TCP='tcp://10.107.68.212:30997'
export DEFAULT_DEVTOOL_PORT_30997_TCP_ADDR='10.107.68.212'
export DEFAULT_DEVTOOL_PORT_30997_TCP_PORT='30997'
export DEFAULT_DEVTOOL_PORT_30997_TCP_PROTO='tcp'
export DEFAULT_DEVTOOL_SERVICE_HOST='10.107.68.212'
export DEFAULT_DEVTOOL_SERVICE_PORT='30997'
export DEFAULT_DEVTOOL_SERVICE_PORT_API='30997'
export DEFAULT_ETCD_CLIENT_PORT='tcp://10.108.95.44:2379'
export DEFAULT_ETCD_CLIENT_PORT_2379_TCP='tcp://10.108.95.44:2379'
export DEFAULT_ETCD_CLIENT_PORT_2379_TCP_ADDR='10.108.95.44'
export DEFAULT_ETCD_CLIENT_PORT_2379_TCP_PORT='2379'
export DEFAULT_ETCD_CLIENT_PORT_2379_TCP_PROTO='tcp'
export DEFAULT_ETCD_CLIENT_SERVICE_HOST='10.108.95.44'
export DEFAULT_ETCD_CLIENT_SERVICE_PORT='2379'
export DEFAULT_ETCD_CLIENT_SERVICE_PORT_CLIENT='2379'
export DEFAULT_GLANCE_PORT='tcp://10.101.254.31:30292'
export DEFAULT_GLANCE_PORT_30292_TCP='tcp://10.101.254.31:30292'
export DEFAULT_GLANCE_PORT_30292_TCP_ADDR='10.101.254.31'
export DEFAULT_GLANCE_PORT_30292_TCP_PORT='30292'
export DEFAULT_GLANCE_PORT_30292_TCP_PROTO='tcp'
export DEFAULT_GLANCE_SERVICE_HOST='10.101.254.31'
export DEFAULT_GLANCE_SERVICE_PORT='30292'
export DEFAULT_GLANCE_SERVICE_PORT_API='30292'
export DEFAULT_INFLUXDB_PORT='tcp://10.98.42.173:30086'
export DEFAULT_INFLUXDB_PORT_30086_TCP='tcp://10.98.42.173:30086'
export DEFAULT_INFLUXDB_PORT_30086_TCP_ADDR='10.98.42.173'
export DEFAULT_INFLUXDB_PORT_30086_TCP_PORT='30086'
export DEFAULT_INFLUXDB_PORT_30086_TCP_PROTO='tcp'
export DEFAULT_INFLUXDB_SERVICE_HOST='10.98.42.173'
export DEFAULT_INFLUXDB_SERVICE_PORT='30086'
export DEFAULT_INFLUXDB_SERVICE_PORT_API='30086'
export DEFAULT_KEYSTONE_PORT='tcp://10.108.188.31:30500'
export DEFAULT_KEYSTONE_PORT_30357_TCP='tcp://10.108.188.31:30357'
export DEFAULT_KEYSTONE_PORT_30357_TCP_ADDR='10.108.188.31'
export DEFAULT_KEYSTONE_PORT_30357_TCP_PORT='30357'
export DEFAULT_KEYSTONE_PORT_30357_TCP_PROTO='tcp'
export DEFAULT_KEYSTONE_PORT_30500_TCP='tcp://10.108.188.31:30500'
export DEFAULT_KEYSTONE_PORT_30500_TCP_ADDR='10.108.188.31'
export DEFAULT_KEYSTONE_PORT_30500_TCP_PORT='30500'
export DEFAULT_KEYSTONE_PORT_30500_TCP_PROTO='tcp'
export DEFAULT_KEYSTONE_SERVICE_HOST='10.108.188.31'
export DEFAULT_KEYSTONE_SERVICE_PORT='30500'
export DEFAULT_KEYSTONE_SERVICE_PORT_ADMIN='30357'
export DEFAULT_KEYSTONE_SERVICE_PORT_PUBLIC='30500'
export DEFAULT_KUBESERVER_PORT='tcp://10.102.253.133:30442'
export DEFAULT_KUBESERVER_PORT_30442_TCP='tcp://10.102.253.133:30442'
export DEFAULT_KUBESERVER_PORT_30442_TCP_ADDR='10.102.253.133'
export DEFAULT_KUBESERVER_PORT_30442_TCP_PORT='30442'
export DEFAULT_KUBESERVER_PORT_30442_TCP_PROTO='tcp'
export DEFAULT_KUBESERVER_SERVICE_HOST='10.102.253.133'
export DEFAULT_KUBESERVER_SERVICE_PORT='30442'
export DEFAULT_KUBESERVER_SERVICE_PORT_API='30442'
export DEFAULT_LOGGER_PORT='tcp://10.96.203.44:30999'
export DEFAULT_LOGGER_PORT_30999_TCP='tcp://10.96.203.44:30999'
export DEFAULT_LOGGER_PORT_30999_TCP_ADDR='10.96.203.44'
export DEFAULT_LOGGER_PORT_30999_TCP_PORT='30999'
export DEFAULT_LOGGER_PORT_30999_TCP_PROTO='tcp'
export DEFAULT_LOGGER_SERVICE_HOST='10.96.203.44'
export DEFAULT_LOGGER_SERVICE_PORT='30999'
export DEFAULT_LOGGER_SERVICE_PORT_API='30999'
export DEFAULT_MONITOR_PORT='tcp://10.104.80.24:30093'
export DEFAULT_MONITOR_PORT_30093_TCP='tcp://10.104.80.24:30093'
export DEFAULT_MONITOR_PORT_30093_TCP_ADDR='10.104.80.24'
export DEFAULT_MONITOR_PORT_30093_TCP_PORT='30093'
export DEFAULT_MONITOR_PORT_30093_TCP_PROTO='tcp'
export DEFAULT_MONITOR_SERVICE_HOST='10.104.80.24'
export DEFAULT_MONITOR_SERVICE_PORT='30093'
export DEFAULT_MONITOR_SERVICE_PORT_API='30093'
export DEFAULT_NOTIFY_PORT='tcp://10.101.230.232:30777'
export DEFAULT_NOTIFY_PORT_30777_TCP='tcp://10.101.230.232:30777'
export DEFAULT_NOTIFY_PORT_30777_TCP_ADDR='10.101.230.232'
export DEFAULT_NOTIFY_PORT_30777_TCP_PORT='30777'
export DEFAULT_NOTIFY_PORT_30777_TCP_PROTO='tcp'
export DEFAULT_NOTIFY_SERVICE_HOST='10.101.230.232'
export DEFAULT_NOTIFY_SERVICE_PORT='30777'
export DEFAULT_NOTIFY_SERVICE_PORT_API='30777'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_PORT='tcp://10.96.149.72:30885'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_PORT_30885_TCP='tcp://10.96.149.72:30885'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_PORT_30885_TCP_ADDR='10.96.149.72'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_PORT_30885_TCP_PORT='30885'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_PORT_30885_TCP_PROTO='tcp'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_SERVICE_HOST='10.96.149.72'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_SERVICE_PORT='30885'
export DEFAULT_ONECLOUD_SERVICE_OPERATOR_SERVICE_PORT_API='30885'
export DEFAULT_OVN_NORTH_PORT='tcp://10.97.163.240:32241'
export DEFAULT_OVN_NORTH_PORT_32241_TCP='tcp://10.97.163.240:32241'
export DEFAULT_OVN_NORTH_PORT_32241_TCP_ADDR='10.97.163.240'
export DEFAULT_OVN_NORTH_PORT_32241_TCP_PORT='32241'
export DEFAULT_OVN_NORTH_PORT_32241_TCP_PROTO='tcp'
export DEFAULT_OVN_NORTH_PORT_32242_TCP='tcp://10.97.163.240:32242'
export DEFAULT_OVN_NORTH_PORT_32242_TCP_ADDR='10.97.163.240'
export DEFAULT_OVN_NORTH_PORT_32242_TCP_PORT='32242'
export DEFAULT_OVN_NORTH_PORT_32242_TCP_PROTO='tcp'
export DEFAULT_OVN_NORTH_SERVICE_HOST='10.97.163.240'
export DEFAULT_OVN_NORTH_SERVICE_PORT='32241'
export DEFAULT_OVN_NORTH_SERVICE_PORT_NORTH_DB='32241'
export DEFAULT_OVN_NORTH_SERVICE_PORT_SOUTH_DB='32242'
export DEFAULT_REGION_PORT='tcp://10.99.71.89:30888'
export DEFAULT_REGION_PORT_30888_TCP='tcp://10.99.71.89:30888'
export DEFAULT_REGION_PORT_30888_TCP_ADDR='10.99.71.89'
export DEFAULT_REGION_PORT_30888_TCP_PORT='30888'
export DEFAULT_REGION_PORT_30888_TCP_PROTO='tcp'
export DEFAULT_REGION_SERVICE_HOST='10.99.71.89'
export DEFAULT_REGION_SERVICE_PORT='30888'
export DEFAULT_REGION_SERVICE_PORT_API='30888'
export DEFAULT_SCHEDULEDTASK_PORT='tcp://10.101.58.236:30978'
export DEFAULT_SCHEDULEDTASK_PORT_30978_TCP='tcp://10.101.58.236:30978'
export DEFAULT_SCHEDULEDTASK_PORT_30978_TCP_ADDR='10.101.58.236'
export DEFAULT_SCHEDULEDTASK_PORT_30978_TCP_PORT='30978'
export DEFAULT_SCHEDULEDTASK_PORT_30978_TCP_PROTO='tcp'
export DEFAULT_SCHEDULEDTASK_SERVICE_HOST='10.101.58.236'
export DEFAULT_SCHEDULEDTASK_SERVICE_PORT='30978'
export DEFAULT_SCHEDULEDTASK_SERVICE_PORT_API='30978'
export DEFAULT_SCHEDULER_PORT='tcp://10.106.173.254:30887'
export DEFAULT_SCHEDULER_PORT_30887_TCP='tcp://10.106.173.254:30887'
export DEFAULT_SCHEDULER_PORT_30887_TCP_ADDR='10.106.173.254'
export DEFAULT_SCHEDULER_PORT_30887_TCP_PORT='30887'
export DEFAULT_SCHEDULER_PORT_30887_TCP_PROTO='tcp'
export DEFAULT_SCHEDULER_SERVICE_HOST='10.106.173.254'
export DEFAULT_SCHEDULER_SERVICE_PORT='30887'
export DEFAULT_SCHEDULER_SERVICE_PORT_API='30887'
export DEFAULT_WEBCONSOLE_PORT='tcp://10.101.185.55:30899'
export DEFAULT_WEBCONSOLE_PORT_30899_TCP='tcp://10.101.185.55:30899'
export DEFAULT_WEBCONSOLE_PORT_30899_TCP_ADDR='10.101.185.55'
export DEFAULT_WEBCONSOLE_PORT_30899_TCP_PORT='30899'
export DEFAULT_WEBCONSOLE_PORT_30899_TCP_PROTO='tcp'
export DEFAULT_WEBCONSOLE_SERVICE_HOST='10.101.185.55'
export DEFAULT_WEBCONSOLE_SERVICE_PORT='30899'
export DEFAULT_WEBCONSOLE_SERVICE_PORT_API='30899'
export DEFAULT_WEB_PORT='tcp://10.105.199.244:443'
export DEFAULT_WEB_PORT_443_TCP='tcp://10.105.199.244:443'
export DEFAULT_WEB_PORT_443_TCP_ADDR='10.105.199.244'
export DEFAULT_WEB_PORT_443_TCP_PORT='443'
export DEFAULT_WEB_PORT_443_TCP_PROTO='tcp'
export DEFAULT_WEB_PORT_8080_TCP='tcp://10.105.199.244:8080'
export DEFAULT_WEB_PORT_8080_TCP_ADDR='10.105.199.244'
export DEFAULT_WEB_PORT_8080_TCP_PORT='8080'
export DEFAULT_WEB_PORT_8080_TCP_PROTO='tcp'
export DEFAULT_WEB_PORT_8081_TCP='tcp://10.105.199.244:8081'
export DEFAULT_WEB_PORT_8081_TCP_ADDR='10.105.199.244'
export DEFAULT_WEB_PORT_8081_TCP_PORT='8081'
export DEFAULT_WEB_PORT_8081_TCP_PROTO='tcp'
export DEFAULT_WEB_SERVICE_HOST='10.105.199.244'
export DEFAULT_WEB_SERVICE_PORT='443'
export DEFAULT_WEB_SERVICE_PORT_DOCS='8081'
export DEFAULT_WEB_SERVICE_PORT_HTTPS='443'
export DEFAULT_WEB_SERVICE_PORT_OVERVIEW='8080'
export DEFAULT_YUNIONCONF_PORT='tcp://10.96.202.10:30889'
export DEFAULT_YUNIONCONF_PORT_30889_TCP='tcp://10.96.202.10:30889'
export DEFAULT_YUNIONCONF_PORT_30889_TCP_ADDR='10.96.202.10'
export DEFAULT_YUNIONCONF_PORT_30889_TCP_PORT='30889'
export DEFAULT_YUNIONCONF_PORT_30889_TCP_PROTO='tcp'
export DEFAULT_YUNIONCONF_SERVICE_HOST='10.96.202.10'
export DEFAULT_YUNIONCONF_SERVICE_PORT='30889'
export DEFAULT_YUNIONCONF_SERVICE_PORT_API='30889'
export HOME='/root'
export HOSTNAME='default-region-7549678866-465vf'
export KUBERNETES_PORT='tcp://10.96.0.1:443'
export KUBERNETES_PORT_443_TCP='tcp://10.96.0.1:443'
export KUBERNETES_PORT_443_TCP_ADDR='10.96.0.1'
export KUBERNETES_PORT_443_TCP_PORT='443'
export KUBERNETES_PORT_443_TCP_PROTO='tcp'
export KUBERNETES_SERVICE_HOST='10.96.0.1'
export KUBERNETES_SERVICE_PORT='443'
export KUBERNETES_SERVICE_PORT_HTTPS='443'
export PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
export PWD='/'
export ROUTINGMANAGER_SERVICE_PORT='tcp://10.100.24.142:8766'
export ROUTINGMANAGER_SERVICE_PORT_8766_TCP='tcp://10.100.24.142:8766'
export ROUTINGMANAGER_SERVICE_PORT_8766_TCP_ADDR='10.100.24.142'
export ROUTINGMANAGER_SERVICE_PORT_8766_TCP_PORT='8766'
export ROUTINGMANAGER_SERVICE_PORT_8766_TCP_PROTO='tcp'
export ROUTINGMANAGER_SERVICE_SERVICE_HOST='10.100.24.142'
export ROUTINGMANAGER_SERVICE_SERVICE_PORT='8766'
export SHLVL='1'
export TERM='xterm'
export TZ='UTC'

connected shell in the dev computer

export KUBERNETES_PORT_443_TCP_PORT=443
export KUBERNETES_PORT_443_TCP_PROTO=tcp
export KUBERNETES_PORT_443_TCP=tcp://10.96.0.1:443
export KUBERNETES_SERVICE_PORT_HTTPS=443
export KUBERNETES_PORT=tcp://10.96.0.1:443
export KUBERNETES_SERVICE_PORT=443
export KUBERNETES_PORT_443_TCP_ADDR=10.96.0.1
export KUBERNETES_SERVICE_HOST=10.96.0.1
export DEFAULT_WEB_SERVICE_HOST=127.0.0.1
export DEFAULT_ETCD_CLIENT_PORT=TCP://127.0.0.1:55049
export DEFAULT_ETCD_CLIENT_SERVICE_PORT_TCP=55049
export DEFAULT_ETCD_CLIENT_PORT_55049_TCP_PROTO=TCP
export DEFAULT_ETCD_CLIENT_PORT_55049_TCP=TCP://127.0.0.1:55049
export DEFAULT_ETCD_CLIENT_PORT_55049_TCP_PORT=55049
export DEFAULT_ETCD_CLIENT_SERVICE_PORT=55049
export DEFAULT_ETCD_CLIENT_PORT_55049_TCP_ADDR=127.0.0.1
export DEFAULT_ETCD_CLIENT_SERVICE_HOST=127.0.0.1
export DEFAULT_WEB_PORT=TCP://127.0.0.1:55052
export DEFAULT_WEB_SERVICE_PORT_TCP=55052
export DEFAULT_WEB_PORT_55050_TCP_PROTO=TCP
export DEFAULT_WEB_PORT_55050_TCP=TCP://127.0.0.1:55050
export DEFAULT_WEB_PORT_55050_TCP_PORT=55050
export DEFAULT_WEB_SERVICE_PORT=55052
export DEFAULT_WEB_PORT_55050_TCP_ADDR=127.0.0.1
export DEFAULT_WEB_PORT_55051_TCP_PROTO=TCP
export DEFAULT_WEB_PORT_55051_TCP=TCP://127.0.0.1:55051
export DEFAULT_WEB_PORT_55051_TCP_PORT=55051
export DEFAULT_WEB_PORT_55051_TCP_ADDR=127.0.0.1
export DEFAULT_WEB_PORT_55052_TCP_PROTO=TCP
export DEFAULT_WEB_PORT_55052_TCP=TCP://127.0.0.1:55052
export DEFAULT_WEB_PORT_55052_TCP_PORT=55052
export DEFAULT_WEB_PORT_55052_TCP_ADDR=127.0.0.1
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT=TCP://127.0.0.1:55054
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_SERVICE_PORT_TCP=55054
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55053_TCP_PROTO=TCP
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55053_TCP=TCP://127.0.0.1:55053
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55053_TCP_PORT=55053
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_SERVICE_PORT=55054
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55053_TCP_ADDR=127.0.0.1
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_SERVICE_HOST=127.0.0.1
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55054_TCP_PROTO=TCP
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55054_TCP=TCP://127.0.0.1:55054
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55054_TCP_PORT=55054
export DEFAULT_ETCD_PRPFJ8T5SM_DEFAULT_ETCD_PORT_55054_TCP_ADDR=127.0.0.1

For example,I want to get the keystone service in the cluster by the debug process on my computer,but the error dial 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, make useKubernetesServiceEnvironmentVariables as true in the task.json file.

Mention the platform you are using

  • System : Windows 10
  • Remote Machine : Centos 7.9
  • vscode version: 1.72.2

To Reproduce

  1. example project:
    cloudpods

  2. vscode config

    .vscode/task.json

    {
        // See https://go.microsoft.com/fwlink/?LinkId=733558
        // for the documentation about the tasks.json format
        "version": "2.0.0",
        "tasks": [
            {
                "label": "bridge-to-kubernetes.resource",
                "type": "bridge-to-kubernetes.resource",
                "resource": "default-region",
                "resourceType": "service",
                "ports": [
                    0
                ],
                "targetCluster": "kubernetes",
                "targetNamespace": "onecloud",
                "useKubernetesServiceEnvironmentVariables": true,
                "isolateAs": "root-b062"
            }
        ]
    }

    .vscode/task.json

    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "attach-server-cmd/region with Kubernetes",
                "type": "go",
                "request": "launch",
                "mode": "debug", 
                "preLaunchTask": "bridge-to-kubernetes.resource",
                "program": "${workspaceFolder}/cmd/region",
                "args": [
                    "--conf",
                    "/etc/yunion/region.conf"
                ],
                "env": {
                    "GRPC_DNS_RESOLVER": "native"
                }
            }
        ]
    }
  3. debug

Expected behavior

I want to connect to service in the cluster on the development machine.

Screenshots
b2k

Additional context

vscode log
vscode-b2k.log

@hsubramanianaks
Copy link
Collaborator

Thanks for raising this issue. Can you share the logs from /tmp/Bridge To Kubernetes folder ? I can see following error

Connect operation failed.\nAn unexpected error occurred: 'The JSON value could not be converted to k8s.Models.V1ServiceStatus. Path: $.status | LineNumber: 0 | BytePositionInLine: 67.'\nTo see our active issues or file a bug report, please visit https://aka.ms/bridge-to-k8s-report.\nFor diagnostic information, see logs at '/tmp/Bridge To Kubernetes```

@GKilm
Copy link
Author

GKilm commented Jan 12, 2023

@hsubramanianaks Thanks for your reply.
This error occurs when the B2k run firstly or in the next connection after success. As this issue #90 says retrying is helpful,I has been ignored it. @elenavillamil Maybe it is helpful to solve the issue #90 . By the way,routing manager is always here and only deployed once,but the error occurs at intervals.

I think ServicePortForwarder doesn't work correctly for all k8s service env. As shown on the first commit, some env variable is lost.

By comparing with kubernete's service ,it hits to me that only these services which type is ClusterIp are connected in the dev machine. these services which type is NodePort cann't be connected.

cluster service

For invoking other services,using service name like default-logger fail with the following error.
dns error

first unsuccessful log
Bridge To Kubernetes.zip

second successful log
tmp_bridgeToKubernetes.zip

@hsubramanianaks
Copy link
Collaborator

hsubramanianaks commented Jan 13, 2023

@GKilm Thanks for providing the logs, we will look into it.

@hsubramanianaks hsubramanianaks added the investigation needed Investigation is needed before a proper triage can be done label Jan 13, 2023
@GKilm
Copy link
Author

GKilm commented Jan 13, 2023

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 nodeport cann't be connected in the program being debugged.

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 environment variables is a way.But only these services which type is ClusterIP is added to environment variables,so I cann't connect to these service which type is NodePort.

I really want to use service name like default-keystone when debugging,but it's prohibited when using VS Code Remote SSh.

So I just want to connect to these service which type is NodePort when debugging.

Thanks.

@hsubramanianaks hsubramanianaks self-assigned this Jan 18, 2023
@hsubramanianaks
Copy link
Collaborator

hsubramanianaks commented Jan 23, 2023

@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.

image

@GKilm
Copy link
Author

GKilm commented Jan 30, 2023

@hsubramanianaks I have tried the latest version which is v2.0.120230118, but it has no effect.

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,I can't also get the correct environment variable value.The
generated value is an empty string.The configuration file and results are shown below.

KubernetesLocalProcessConfig.yaml

version: 0.1
env:
  - name: DEFAULT_KEYSTONE_SERVICE_HOST
    value: $(services:default-keystone)

environment variable in the connected terminal

keystone value

In this cluster, default-keystone service is defined like this.

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 KubernetesLocalProcessConfig.yaml? When using VS Code Remote SSH, the result of $(services:default-web) is 127.0.0.1 and the result of $(services:any-service) is 127.0.0.1 or ''.

@elenavillamil
Copy link
Contributor

elenavillamil commented Feb 16, 2023

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.

env:
  - name: adding_keystone_service
    value: $(services:keystone.default)

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).

Screenshot 2023-02-16 at 3 31 58 PM

@elenavillamil elenavillamil added waiting for response Waiting for a response by the original author of the ticket and removed investigation needed Investigation is needed before a proper triage can be done labels Feb 16, 2023
@GKilm
Copy link
Author

GKilm commented Feb 17, 2023

@elenavillamil

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.

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 NodePort.

It is maybe helpful by reviewing this issue

@elenavillamil
Copy link
Contributor

@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!

@elenavillamil
Copy link
Contributor

elenavillamil commented Mar 10, 2023

@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.

if ((s.Spec.Type == "ClusterIP" || s.Spec.Type == "LoadBalancer") && !string.IsNullOrWhiteSpace(s.Spec.ClusterIP) && (s.Spec.Ports?.Any() ?? false))

@elenavillamil elenavillamil added the good first issue Good for newcomers label Mar 10, 2023
@elenavillamil elenavillamil changed the title Can't connect cluster service to debug in the connected dev machine B2K Skips NodePort Services Mar 15, 2023
@elenavillamil elenavillamil changed the title B2K Skips NodePort Services B2K Skips NodePort Services - Evaluate supporting it Mar 15, 2023
@elenavillamil elenavillamil self-assigned this Mar 15, 2023
@GKilm
Copy link
Author

GKilm commented Mar 18, 2023

Thanks for your work.I think it could be solved by your submit.
I'm sorry for replying so late,and couldn't provide the requested information.Maybe it's enough.😆

@elenavillamil
Copy link
Contributor

@GKilm no problem! I am hoping this can go in this week and rollout next week. Will keep you updated :)

@hsubramanianaks
Copy link
Collaborator

@GKilm This is rolled out, can you try and see if it works for you. Thank you.

@hsubramanianaks hsubramanianaks added the production fix/feature deployed to prod label Mar 31, 2023
@hsubramanianaks
Copy link
Collaborator

@GKilm Closing this issue since it's been a month and hoping latest release fixed your issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers inprogress production fix/feature deployed to prod waiting for response Waiting for a response by the original author of the ticket
Projects
Development

No branches or pull requests

3 participants