Skip to content

Commit 91ba2c5

Browse files
authored
Add TLS endpoint for ModelMesh payload processors. (trustyai-explainability#268)
Keep non-TLS endpoint for KServe Serverless (disabled by default)
1 parent 1515872 commit 91ba2c5

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

controllers/inference_services.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ func (r *TrustyAIServiceReconciler) patchEnvVarsByLabelForDeployments(ctx contex
147147
}
148148

149149
// Build the payload processor endpoint
150-
url := generateServiceURL(crName, namespace) + "/consumer/kserve/v2"
150+
url := generateTLSServiceURL(crName, namespace) + "/consumer/kserve/v2"
151151

152152
// Patch environment variables for the Deployments
153153
if shouldContinue, err := r.patchEnvVarsForDeployments(ctx, instance, deployments, envVarName, url, remove); err != nil {
@@ -240,7 +240,7 @@ func (r *TrustyAIServiceReconciler) handleInferenceServices(ctx context.Context,
240240
// patchKServe adds a TrustyAI service as an InferenceLogger to a KServe InferenceService
241241
func (r *TrustyAIServiceReconciler) patchKServe(ctx context.Context, instance *trustyaiopendatahubiov1alpha1.TrustyAIService, infService kservev1beta1.InferenceService, namespace string, crName string, remove bool) error {
242242

243-
url := generateServiceURL(crName, namespace)
243+
url := generateNonTLSServiceURL(crName, namespace)
244244

245245
if remove {
246246
if infService.Spec.Predictor.Logger == nil || *infService.Spec.Predictor.Logger.URL != url {

controllers/utils.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ func (r *TrustyAIServiceReconciler) GetDeploymentsByLabel(ctx context.Context, n
6262
return deployments.Items, nil
6363
}
6464

65-
// generateServiceURL generates an internal URL for a TrustyAI service
66-
func generateServiceURL(crName string, namespace string) string {
65+
// generateTLSServiceURL generates an internal URL for a TLS-enabled TrustyAI service
66+
func generateTLSServiceURL(crName string, namespace string) string {
67+
return "https://" + crName + "." + namespace + ".svc"
68+
}
69+
70+
// generateNonTLSServiceURL generates an internal URL for a TrustyAI service
71+
func generateNonTLSServiceURL(crName string, namespace string) string {
6772
return "http://" + crName + "." + namespace + ".svc"
6873
}

0 commit comments

Comments
 (0)