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 ingress class name configuration #2049

Merged
merged 7 commits into from
Feb 23, 2022

Conversation

pradithya
Copy link
Member

What this PR does / why we need it:
To allow selecting specific ingress controller when using RawDeployment

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #2048

Type of changes
Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

Feature/Issue validation/testing:

  • Run the controller with and without ingress class name in cluster and create inference service

  • Logs
    Ingress generated when ingress class name is set to "istio"

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
    queue.sidecar.serving.knative.dev/resourcePercentage: "20"
  creationTimestamp: "2022-02-18T09:48:52Z"
  generation: 1
  name: xgboost-sample-413
  namespace: test
  resourceVersion: "10446008"
  uid: 79862c9c-e97f-4da9-9d58-e39a0b5481b5
spec:
  ingressClassName: istio
  rules:
  - host: xgboost-sample-413-test.example.com
    http:
      paths:
      - backend:
          service:
            name: xgboost-sample-413-predictor-default
            port:
              number: 80
        path: /
        pathType: Prefix
  - host: xgboost-sample-413-predictor-default-test.example.com
    http:
      paths:
      - backend:
          service:
            name: xgboost-sample-413-predictor-default
            port:
              number: 80
        path: /
        pathType: Prefix

Checklist:

  • Have you added unit/e2e tests that prove your fix is effective or that this feature works?
  • Has code been commented, particularly in hard-to-understand areas?
  • Have you made corresponding changes to the documentation?

Release note:

Add `ingressClassName` configuration to allow selecting specific ingress controller for RawDeployment

@aws-kf-ci-bot
Copy link
Contributor

Hi @pradithya. Thanks for your PR.

I'm waiting for a kserve member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
@yuzisun
Copy link
Member

yuzisun commented Feb 18, 2022

/ok-to-test

Copy link
Member

@yuzisun yuzisun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @pradithya for the contribution!

@@ -190,7 +190,8 @@ func createRawIngress(scheme *runtime.Scheme, isvc *v1beta1api.InferenceService,
Annotations: isvc.Annotations,
},
Spec: netv1.IngressSpec{
Rules: rules,
IngressClassName: ingressConfig.IngressClassName,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens when IngressClassName is nil?

Copy link
Member Author

@pradithya pradithya Feb 21, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's nil all IngressClassName will be empty and will use default ingress in the cluster (https://kubernetes.io/docs/concepts/services-networking/ingress/#default-ingress-class) . In GKE case it will use create Google Ingress. But essentially it will behave the same as existing behaviour.

If inference service owner want to use specific ingress then they'll have to add ingress class annotation (kubernetes.io/ingress.class)

LocalGateway string `json:"localGateway,omitempty"`
LocalGatewayServiceName string `json:"localGatewayService,omitempty"`
IngressDomain string `json:"ingressDomain,omitempty"`
IngressClassName *string `json:"ingressClassName,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can default the IngressClassName to istio and add a comment that only for RawDeployment we allow other ingress option currently.

Let's set the default to the config and the test config, add a test case without using the ingress class annotation.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated istio as default ingress class name. We'll need to add the istio ingressClass creation (https://istio.io/latest/docs/tasks/traffic-management/ingress/kubernetes-ingress/#specifying-ingressclass) in the documentation since it's not created by default.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the test too

Pradithya Aria added 2 commits February 21, 2022 14:20
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
@pradithya
Copy link
Member Author

PR for doc update kserve/website#113

Pradithya Aria added 4 commits February 21, 2022 14:52
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
Signed-off-by: Pradithya Aria <pradithya.pura@go-jek.com>
@pradithya
Copy link
Member Author

pradithya commented Feb 21, 2022

The last e2e fails are unrelated to the PR

FAILED predictor/test_multi_model_serving.py::test_mms_sklearn_kserve[v2-gs://seldon-models/sklearn/mms/lr_model]
FAILED predictor/test_xgboost.py::test_xgboost_v2_runtime_kserve - requests.e...

@pradithya
Copy link
Member Author

/retest

@pradithya
Copy link
Member Author

@yuzisun Ready to be reviewed again

@@ -35,7 +35,6 @@ def test_raw_deployment_kserve():
service_name = "raw-sklearn"
annotations = dict()
annotations['serving.kserve.io/deploymentMode'] = 'RawDeployment'
annotations['kubernetes.io/ingress.class'] = 'istio'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removing this annotation from test as it causes some errors:

annotations.kubernetes.io/ingress.class: Invalid value: \"istio\": can not be set when the class field is also set

Somehow the cluster or istio rejects when both ingressClassName and annotations.kubernetes.io/ingress.class are being set.

@yuzisun
Copy link
Member

yuzisun commented Feb 23, 2022

Thanks @pradithya !

/lgtm
/approve

@kserve-oss-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: pradithya, yuzisun

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kserve-oss-bot kserve-oss-bot merged commit 9b4e6cd into kserve:master Feb 23, 2022
@yuzisun yuzisun mentioned this pull request May 1, 2022
15 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ingressClassName configuration
4 participants