kubernetes-sigs / cloud-provider-huaweicloud

HUAWEI CLOUD Controller Manager is an external cloud controller manager for running kubernetes in a HUAWEI CLOUD cluster.
Apache License 2.0
40 stars 26 forks source link

Unable to achieve external ip #224

Closed vipcxj closed 9 months ago

vipcxj commented 1 year ago

I have deploied the cloud-provider-huaweicloud, but there is still no external ip on my nodes. All my nodes have bind eip. The node1 witch running the huawei-cloud-controller-manager is bind two internel ip, one is the local ip, and one is the eip. And there are no eip bind to other nodes, neither internalIp or externalip.

What you expected to happen:

I need a way to discovery eip for my nodes.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

vipcxj commented 1 year ago
{
 "server": {
  "fault": null,
  "id": "XXXX",
  "name": "node4",
  "addresses": {
   "47ed6caf-b823-4ad8-a8eb-7ecdba7d7086": [
    {
     "version": "4",
     "addr": "192.168.0.230",
     "primary": true,
     "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:2e:86:6c",
     "OS-EXT-IPS:type": "fixed",
     "OS-EXT-IPS:port_id": "9cb36757-0583-40f2-bfe3-0174f3bb5d2b"
    },
    {
     "version": "4",
     "addr": "60.204.201.23",
     "primary": true,
     "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:2e:86:6c",
     "OS-EXT-IPS:type": "floating",
     "OS-EXT-IPS:port_id": "9cb36757-0583-40f2-bfe3-0174f3bb5d2b"
    }
   ]
  },
  ...
}

According to the log, the cloud-provider-manager has called the ecs api showServer. Above is the result of apiExporter. You can see a Floating type IP. According to the source of cloud-provider-manager, It seems that the IP of the Floating type should be added to Externalip list. But it doesn't. Even weirder is that node1 turns this floating ip into internalip.

chengxiangdong commented 1 year ago

Sorry, I didn't quite understand the issue you described.

  1. You mentioned that the source of cloud-provider-manager, BuildAddresses is invoked when obtaining node metadata in the K8s cluster. View the infor returned by the API, name:node4, the InternalIP and ExternalIP of the node will be returned to the k8s cluster.

  2. In the K8s cluster, if you need to provide external services, you can create a LoadBalancer service. The service is integrated with ELB through CCM, and ELB forwards external traffic to applications in the k8s cluster, avoiding the need for EIP for each node.

  3. I'm not sure what you mean by "I need a way to discovery eip for my nodes" What's the purpose of using EIP for all nodes?

vipcxj commented 1 year ago

@chengxiangdong Because I want to deploy a cluster app (owt-server) which send its node ip or host to the client, then the client will use this ip or host to connect to the cluster directly. I don't know whether it breaks the mechanism of the app if I set all node's ip to a elb ip.

chengxiangdong commented 1 year ago

@chengxiangdong Because I want to deploy a cluster app (owt-server) which send its node ip or host to the client, then the client will use this ip or host to connect to the cluster directly. I don't know whether it breaks the mechanism of the app if I set all node's ip to a elb ip.

It seems you need to access the "owt-server" application from outside the cluster via the node IP. I'm not certain how you are obtaining the IP of the host where the container is located. However, it's not recommended to access the applications in the cluster through the node IP.

In Kubernetes, a service is a way of exposing a network application running as one or more pods in a cluster. If you need to expose the service to the public network, you can create an loadbalancer serivce and bind EIP through CCM.

For more details about services: https://kubernetes.io/docs/concepts/services-networking/service/

chengxiangdong commented 9 months ago

I will close this question after 30 days of inactivity.

You can reopen this issue with /reopen.

chengxiangdong commented 9 months ago

/close

k8s-ci-robot commented 9 months ago

@chengxiangdong: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/cloud-provider-huaweicloud/issues/224#issuecomment-1876255389): >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.