diff --git a/api-frontend/src/main/java/io/seldon/apife/grpc/SeldonGrpcServer.java b/api-frontend/src/main/java/io/seldon/apife/grpc/SeldonGrpcServer.java index 8a0375ac9d..7205c67aa2 100644 --- a/api-frontend/src/main/java/io/seldon/apife/grpc/SeldonGrpcServer.java +++ b/api-frontend/src/main/java/io/seldon/apife/grpc/SeldonGrpcServer.java @@ -217,7 +217,7 @@ public void deploymentAdded(SeldonDeployment resource) { else { final String namespace = k8sUtil.getNamespace(resource); - final String endpoint = resource.getSpec().getName() + "." + namespace; + final String endpoint = k8sUtil.getSeldonId(resource) + "." + namespace; final ManagedChannel channel = ManagedChannelBuilder.forAddress(endpoint, appProperties.getEngineGrpcContainerPort()).usePlaintext(true).build(); if (appProperties.isSingleNamespace()) channelStore.put(resource.getSpec().getOauthKey(),channel); diff --git a/api-frontend/src/main/java/io/seldon/apife/k8s/KubernetesUtil.java b/api-frontend/src/main/java/io/seldon/apife/k8s/KubernetesUtil.java index 38acc5bf07..12ece9be30 100644 --- a/api-frontend/src/main/java/io/seldon/apife/k8s/KubernetesUtil.java +++ b/api-frontend/src/main/java/io/seldon/apife/k8s/KubernetesUtil.java @@ -13,5 +13,10 @@ public String getNamespace(SeldonDeployment d) else return d.getMetadata().getNamespace(); } + + public String getSeldonId(SeldonDeployment mlDep) + { + return mlDep.getSpec().getName() + "-" + mlDep.getMetadata().getName(); + } } diff --git a/api-frontend/src/main/java/io/seldon/apife/service/PredictionService.java b/api-frontend/src/main/java/io/seldon/apife/service/PredictionService.java index 469eef71de..ed6c998f8b 100644 --- a/api-frontend/src/main/java/io/seldon/apife/service/PredictionService.java +++ b/api-frontend/src/main/java/io/seldon/apife/service/PredictionService.java @@ -44,7 +44,7 @@ public String predict(String request,String clientId) { SeldonDeployment deployment = deploymentStore.getDeployment(clientId); if (deployment != null) { - final String endpoint = deployment.getSpec().getName() + "." + k8sUtil.getNamespace(deployment); + final String endpoint = k8sUtil.getSeldonId(deployment) + "." + k8sUtil.getNamespace(deployment); return internalPredictionService.getPrediction(request, endpoint); } else @@ -56,7 +56,7 @@ public void sendFeedback(String feedback, String deploymentId){ SeldonDeployment deployment = deploymentStore.getDeployment(deploymentId); if (deployment != null) { - final String endpoint = deployment.getSpec().getName() + "." + k8sUtil.getNamespace(deployment); + final String endpoint = k8sUtil.getSeldonId(deployment) + "." + k8sUtil.getNamespace(deployment); internalPredictionService.sendFeedback(feedback, endpoint); } else