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

VirtualService regex match should be case insensitive #3726

Open
kevinmingtarja opened this issue Jun 7, 2024 · 0 comments
Open

VirtualService regex match should be case insensitive #3726

kevinmingtarja opened this issue Jun 7, 2024 · 0 comments
Labels

Comments

@kevinmingtarja
Copy link
Contributor

kevinmingtarja commented Jun 7, 2024

/kind bug

What steps did you take and what happened:
I have an InferenceService my-classifier.

When i try to curl from another pod inside the same namespace, it works fine when the domain name is all lowercase (expectedly), but it doesn't when there are some uppercase letters (404 not found).

But if i try to curl the private service created by knative (my-classifier-predictor-00001-private), it works for both cases (i'm guessing bcos it doesn't go through Istio).

% curl http://my-classifier.test.svc.cluster.local | jq
{
  "status": "alive"
}

% curl http://MY-Classifier.test.svc.cluster.local -v  
> ...
> Host: MY-classifier.test.svc.cluster.local
> 
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< server: envoy
< content-length: 0

% curl http://MY-Classifier-predictor-00001-private.test.svc.cluster.local | jq
{
  "status": "alive"
}

What did you expect to happen:
I expect curl http://MY-Classifier.test.svc.cluster.local to work, since DNS names aren't case sensitive.

My use case is that the application code i'm writing which will be talking to kserve models may have uppercase letters in the domain name. I can always make it all lowercase in the application code too, but I feel like we should solve this on the kserve/knative/istio side.

What's the InferenceService yaml:

apiVersion: serving.kserve.io/v1beta1
kind: InferenceService
metadata:
  name: my-classifier
  namespace: test
spec:
  ...
status:
  ...
  url: http://my-classifier.test.svc.cluster.local

Anything else you would like to add:
This is the VirtualService created by KServe for this InferenceService:

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
  name: my-classifier
  namespace: test
  ownerReferences:
  - apiVersion: serving.kserve.io/v1beta1
    blockOwnerDeletion: true
    controller: true
    kind: InferenceService
    name: my-classifier
  ...
spec:
  gateways:
  - knative-serving/knative-local-gateway
  hosts:
  - my-classifier.test.svc.cluster.local
  http:
  - headers:
      request:
        set:
          Host: my-classifier-predictor.test.svc.cluster.local
    match:
    - authority:
        regex: ^my-classifier\.test(\.svc(\.cluster\.local)?)?(?::\d{1,5})?$
      gateways:
      - knative-serving/knative-local-gateway
    route:
    - destination:
        host: knative-local-gateway.istio-system.svc.cluster.local
        port:
          number: 80
      weight: 100

If i add (?i) to the regex match (so ^(?i)my-classifier\.test(\.svc(\.cluster\.local)?)?(?::\d{1,5})?$), the failing curl http://MY-Classifier.test.svc.cluster.local will work because the "i" modifier specifies a case-insenitive match, so maybe we should do that?

Environment:

  • Istio Version: v1.20.3
  • Knative Version: v1.13.1
  • KServe Version: v0.12.0
  • Cloud Environment: k8s_istio
  • Kubernetes version: (use kubectl version): v1.27.13-eks-3af4770
@oss-prow-bot oss-prow-bot bot added the kind/bug label Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant