This is an automated email from the ASF dual-hosted git repository.
mmarshall pushed a commit to branch branch-2.8
in repository https://gitbox.apache.org/repos/asf/pulsar.git
The following commit(s) were added to refs/heads/branch-2.8 by this push:
new 7cc29cb [Functions][k8s] Expose function container metrics port
(#12065)
7cc29cb is described below
commit 7cc29cb0964ee9dfd4bf8078e5ab8c65d3098aaf
Author: Peter Tinti <[email protected]>
AuthorDate: Thu Dec 2 22:22:29 2021 -0800
[Functions][k8s] Expose function container metrics port (#12065)
(cherry picked from commit 4dd4bd66db68283fc8486178df6f71a803654e29)
---
.../functions/runtime/kubernetes/KubernetesRuntime.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
index 1301596..70839fc 100644
---
a/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
+++
b/pulsar-functions/runtime/src/main/java/org/apache/pulsar/functions/runtime/kubernetes/KubernetesRuntime.java
@@ -1130,20 +1130,23 @@ public class KubernetesRuntime implements Runtime {
private List<V1ContainerPort> getFunctionContainerPorts() {
List<V1ContainerPort> ports = new ArrayList<>();
+ ports.add(getGRPCPort());
+ ports.add(getPrometheusPort());
+ return ports;
+ }
+
+ private V1ContainerPort getGRPCPort() {
final V1ContainerPort port = new V1ContainerPort();
port.setName("grpc");
port.setContainerPort(grpcPort);
- ports.add(port);
- return ports;
+ return port;
}
- private List<V1ContainerPort> getPrometheusContainerPorts() {
- List<V1ContainerPort> ports = new ArrayList<>();
+ private V1ContainerPort getPrometheusPort() {
final V1ContainerPort port = new V1ContainerPort();
port.setName("prometheus");
port.setContainerPort(metricsPort);
- ports.add(port);
- return ports;
+ return port;
}
public static String createJobName(Function.FunctionDetails
functionDetails, String jobName) {