[Functions][k8s] Expose function container metrics port
@@ -1129,20 +1129,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) {
