dmvk opened a new pull request #16720: URL: https://github.com/apache/flink/pull/16720
## What is the purpose of the change Currently, we've been using kubernetes api server url, when constructing the connection string for REST gateway. While this might work in some cases (eg. api is not behind loadbalancer), this is wrong. The correct approach is to construct address in form of `<nodeIp>:<nodePort>`, where nodeIp can be ip of any kubernetes node (that is running kube-proxy). See [kubernetes docs](https://kubernetes.io/docs/concepts/services-networking/service/#nodeport) for more details. Unfortunately kubernetes nodes can have multiple IPs, with different type (external, internal), assigned to them and it's impossible to make this solution bullet proof without making assumptions about underlying infrastructure. Therefore I've introduced a new config option `kubernetes.rest-service.exposed.node-port-address-type`, that let's you choose which IP type you want to search for. ## Brief change log - `Fabric8FlinkKubeClient#getLoadBalancerRestEndpoint` now searches for any node ip with matching address type, that is used for connection string construction - nit: Fixed broken formatting due to deeply nested indentation ## Verifying this change Added new unit tests for the change. ## Does this pull request potentially affect one of the following parts: - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes) ## Documentation - Does this pull request introduce a new feature? (yes) - If yes, how is the feature documented? (docs) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
