You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Efrat19 (via GitHub)" <gi...@apache.org> on 2026/05/06 06:58:10 UTC
Re: [PR] [FLINK-37893][k8s] Make REST service port name configurable [flink]
Efrat19 commented on code in PR #28047:
URL: https://github.com/apache/flink/pull/28047#discussion_r3193525398
##########
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/services/ServiceType.java:
##########
@@ -109,25 +108,22 @@ public abstract Optional<Endpoint> getRestEndpoint(
*/
public abstract String getType();
- /** Get rest port from the external Service. */
+ /**
+ * Get rest port from the external Service. The rest Service is built with a single port (whose
+ * name is configurable via {@link KubernetesConfigOptions#REST_SERVICE_PORT_NAME}), so the
+ * lookup does not depend on the port name.
+ */
public int getRestPortFromExternalService(Service externalService) {
- final List<ServicePort> servicePortCandidates =
- externalService.getSpec().getPorts().stream()
- .filter(x -> x.getName().equals(Constants.REST_PORT_NAME))
- .collect(Collectors.toList());
+ final List<ServicePort> ports = externalService.getSpec().getPorts();
- if (servicePortCandidates.isEmpty()) {
+ if (ports == null || ports.isEmpty()) {
Review Comment:
Also if `.size() > 1`?
##########
flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/services/ServiceType.java:
##########
@@ -64,7 +63,7 @@ public Service buildUpExternalRestService(
.getType())
.withSelector(kubernetesJobManagerParameters.getSelectors())
.addNewPort()
- .withName(Constants.REST_PORT_NAME)
+ .withName(kubernetesJobManagerParameters.getRestServicePortName())
Review Comment:
Could you update container port name as well?
[InitJobManagerDecorator.java#L192](https://github.com/apache/flink/blob/master/flink-kubernetes/src/main/java/org/apache/flink/kubernetes/kubeclient/decorators/InitJobManagerDecorator.java#L192)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org