[ 
https://issues.apache.org/jira/browse/FLINK-27677?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17538788#comment-17538788
 ] 

Yang Wang commented on FLINK-27677:
-----------------------------------

The reason why we do not support port range is that we need to a fixed rest 
bind-port when creating the k8s service. Since each pod have an individual 
network interface, we do not care about the port conflicts.

 
{code:java}
apiVersion: v1
kind: Service
metadata:
  creationTimestamp: "2022-05-15T03:55:08Z"
  labels:
    app: flink-example-statemachine
    type: flink-native-kubernetes
  name: flink-example-statemachine-rest
  namespace: default
  ownerReferences:
  - apiVersion: apps/v1
    blockOwnerDeletion: true
    controller: true
    kind: Deployment
    name: flink-example-statemachine
    uid: 30eb5df5-328d-4c38-b31f-b791d20b1bbe
  resourceVersion: "6045181"
  uid: 621a33fb-e960-44d2-95e6-6ed3edf519ca
spec:
  clusterIP: 10.103.224.2
  clusterIPs:
  - 10.103.224.2
  internalTrafficPolicy: Cluster
  ipFamilies:
  - IPv4
  ipFamilyPolicy: SingleStack
  ports:
  - name: rest
    port: 8081
    protocol: TCP
    targetPort: 8081
  selector:
    app: flink-example-statemachine
    component: jobmanager
    type: flink-native-kubernetes
  sessionAffinity: None
  type: ClusterIP {code}

> Kubernetes reuse rest.bind-port, but do not support a range of ports
> --------------------------------------------------------------------
>
>                 Key: FLINK-27677
>                 URL: https://issues.apache.org/jira/browse/FLINK-27677
>             Project: Flink
>          Issue Type: Bug
>          Components: Deployment / Kubernetes
>    Affects Versions: 1.15.0
>            Reporter: tartarus
>            Priority: Major
>
> k8s module reuse the rest options {color:#DE350B}rest.bind-port{color},
> but do not support a range of ports
> {code:java}
>    /**
>      * Parse a valid port for the config option. A fixed port is expected, 
> and do not support a
>      * range of ports.
>      *
>      * @param flinkConfig flink config
>      * @param port port config option
>      * @return valid port
>      */
>     public static Integer parsePort(Configuration flinkConfig, 
> ConfigOption<String> port) {
>         checkNotNull(flinkConfig.get(port), port.key() + " should not be 
> null.");
>         try {
>             return Integer.parseInt(flinkConfig.get(port));
>         } catch (NumberFormatException ex) {
>             throw new FlinkRuntimeException(
>                     port.key()
>                             + " should be specified to a fixed port. Do not 
> support a range of ports.",
>                     ex);
>         }
>     }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to