<p>I'm running <code>flink run-application</code> targetting Kubernetes, using these options:</p>
<pre><code>-Dmetrics.reporter.prom.class=org.apache.flink.metrics.prometheus.PrometheusReporter
-Dmetrics.reporter.prom.port=9249
</code></pre>
<p>I specify a container image which has the Prometheus plugin copied into <code>/opt/flink/plugins</code>. From within the job manager container I can download Prometheus metrics on port 9249. However, <code>kubectl describe</code> on the flink pod does not show that the Prometheus port is exposed. The ports line in the kubectl output is:</p>
<p><code>    Ports:         8081/TCP, 6123/TCP, 6124/TCP</code></p>
<p>Therefore, I expect that nothing outside the container will be able to read the Prometheus metrics.</p>

<p>You are misunderstanding the concept of <strong>exposed ports</strong>.<br />
When you expose a port in kubernetes with the <code>ports</code> option (the same apply with Docker and the <code>EXPOSE</code> tag), nothing is open on this port from the outside world.</p>
<p>It's basically just a hint for users of that image to tell them <em>&quot;Hey, you want to use this image ? Ok, you may want to have a look at this port on this container.&quot;</em></p>
<p>So if your port does not appear when you do <code>kubectl describe</code>, then it does not mean that you can't reach that port. You can still map it with a service targetting this port.</p>
<p>Furthermore, if you really want to make it appear with <code>kubectl describe</code>, then you just have to add it to your kubernetes descriptor file :</p>
<pre><code>...
  containers:
  - ports:
      - name: prom-http
        containerPort: 9249
</code></pre>
