You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flink.apache.org by Taranpreet Kaur via dev <de...@flink.apache.org> on 2026/09/08 04:42:18 UTC
Issue in applying network policy as random ports in Jobmanager and Taskmanager are visible
Dear Team,
I have raised a jira [FLINK-40516] Needed to support network policy in Jobmanager and Task Manager - ASF Jira<https://issues.apache.org/jira/browse/FLINK-40516>. I am using flink inside a Kubernetes pod and need to apply newtwork policy but random ports are getting opened although I had provided some configuration in conf.yaml as well. The example is shown below:
bash-4.4$ ss -nap | grep LISTEN
tcp LISTEN 0 50 :9249 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=224,fd=271))
tcp LISTEN 0 4096 :8081 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=224,fd=293))
tcp LISTEN 0 4096 :6123 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=224,fd=265))
tcp LISTEN 0 1000 :6124 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=224,fd=268))
tcp LISTEN 0 4096 :35669 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=224,fd=286)) - random port
in taskmanager:
bash-4.4$ ss -nap |grep LISTEN
tcp LISTEN 0 50 :9249 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=358,fd=277))
tcp LISTEN 0 4096 :41355 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=358,fd=300)) - random port
tcp LISTEN 0 4096 :6121 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=358,fd=313))
tcp LISTEN 0 4096 :6122 *: users[cid:image001.png@01DD3F7A.8627ACD0]("java",pid=358,fd=275))
Earlier two random ports were getting opened but after following configurations, it reduces to one:
jobManagerConfig:
pekko.ask.timeout: "120s"
client.timeout: "120s"
state.checkpoints.num-retained: 1
metrics.internal.query-service.port: "6126" # ← PIN the metric query service
taskManagerConfig:
taskmanager.data.port: "6121" # ← PIN the data shuffle port
metrics.internal.query-service.port: "6126"
Thanks & Regards
Taranpreet Kaur