bentoml / yatai-deployment

🚀 Launching Bento in a Kubernetes cluster
17 stars 14 forks source link

Default TLS for BentoDeployment model servers #116

Open rauerhans opened 1 year ago

rauerhans commented 1 year ago

Closes https://github.com/bentoml/yatai-deployment/issues/87

This feature allows the yatai-deployment controller to add TLS config to the ingress of a Bento deployment through added parameters to the network ConfigMap.

Previously this was only possible by adding the ingress TLS config to the BentoDeployment CRD, which limited the usability of the UI. (Cert-manager dedicated ingress annotations could be added through the network ConfigMap, but the ingress TLS config with host and secretName had to be set manually in the CRD.)

Changes

Setup can be validated using this image rauerhans/yatai-deployment:1.1.12 in the yatai-deployment deployment and playing by adding the new fields to the network ConfigMap.

Functionality

Depending on the new ingress-tls-mode field in the network ConfigMap, the controller will add the TLS config (hosts is reused, secretName is inferred, based on setting) to the ingress of the Bento deployment.

Mode: None

As previously, only way to add TLS is through the field in the deployment CRD.

Mode: Static

The controller will create a wildcard certificate for each deployment.


yetone commented 1 year ago

Thank you! You have done a great job!

rauerhans commented 1 year ago

cool, lmk if you want to change anything, this is an important feature for us

yetone commented 1 year ago

How about adding a relevant e2e test?

rauerhans commented 1 year ago

okay I will see what I can do when I find the time, where do I put this, somewhere here I suppose? https://github.com/bentoml/yatai-deployment/tree/main/tests/e2e

rauerhans commented 1 year ago

Hey just finished with the tests, I tested everything locally. Because of your triage job I have no way of testing it your GH action setup, but I can vouch that "it works on my machine" 😄 with the image I built locally. Hope you find it to your liking.

TIA for your time reviewing this ❤️

yetone commented 1 year ago

You are amazing, this PR is too professional!

yetone commented 1 year ago

/run-e2e

Update: You can check the progress here

rauerhans commented 1 year ago

hmmm, it's still running on the old test setup though, you need to set it up to use the new github actions

yetone commented 1 year ago

Can you work on a separate PR for .github/workflows? The current mechanism is that only .github/workflows under the main branch can be used to execute github actions

davidspek commented 1 year ago

@yetone I've just created https://github.com/bentoml/yatai-deployment/pull/120 to update the github workflow. I tried to do it in a way that hopefully doesn't break tests before the PR is merged but I'd still aim to merge this PR quickly after https://github.com/bentoml/yatai-deployment/pull/120.

yetone commented 1 year ago

CI related PR has been merged.

davidspek commented 1 year ago

@yetone This PR has been rebased on main so it should be possible to run the e2e test now.

FogDong commented 1 year ago

/run-e2e Update: You can check the progress here

davidspek commented 1 year ago

@FogDong @yetone It seems that I needed to do a chmod +x so that the script is executable. Can you rerun the e2e tests?

yetone commented 1 year ago

/run-e2e Update: You can check the progress here

davidspek commented 1 year ago

@yetone It looks like the e2e is erroring on waiting for the yatai-deployment-default-domain to be complete saying it can't be found, but the pods output from the previous command shows the job has already run and was successful.

davidspek commented 1 year ago

Could it be that the current e2e test is a bit flaky?

yetone commented 1 year ago

@DavidSpek You may need to change the configuration of the kind cluster so that it installs loadbalancer.

https://kind.sigs.k8s.io/docs/user/loadbalancer/

yetone commented 1 year ago

/run-e2e Update: You can check the progress here

yetone commented 1 year ago

/run-e2e Update: You can check the progress here

davidspek commented 1 year ago

Sorry @yetone I was away on vacation the past few weeks. Had you already tried updating the kind config to add the load balancer before rerunning the E2E tests? Or is there something we should do on our end?

a-pichard commented 8 months ago

Similar to https://github.com/bentoml/yatai-deployment/pull/123 I believe we should close this one