Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TLS endpoint for ModelMesh payload processors. #268

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/inference_services.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func (r *TrustyAIServiceReconciler) patchEnvVarsByLabelForDeployments(ctx contex
}

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

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

url := generateServiceURL(crName, namespace)
url := generateNonTLSServiceURL(crName, namespace)

if remove {
if infService.Spec.Predictor.Logger == nil || *infService.Spec.Predictor.Logger.URL != url {
Expand Down
9 changes: 7 additions & 2 deletions controllers/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,12 @@ func (r *TrustyAIServiceReconciler) GetDeploymentsByLabel(ctx context.Context, n
return deployments.Items, nil
}

// generateServiceURL generates an internal URL for a TrustyAI service
func generateServiceURL(crName string, namespace string) string {
// generateTLSServiceURL generates an internal URL for a TLS-enabled TrustyAI service
func generateTLSServiceURL(crName string, namespace string) string {
return "https://" + crName + "." + namespace + ".svc"
}

// generateNonTLSServiceURL generates an internal URL for a TrustyAI service
func generateNonTLSServiceURL(crName string, namespace string) string {
return "http://" + crName + "." + namespace + ".svc"
}
Loading