Open rauerhans opened 1 year ago
Thank you! You have done a great job!
cool, lmk if you want to change anything, this is an important feature for us
How about adding a relevant e2e test?
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
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.
.github/workflows/e2e.yaml
: This file includes changes to the workflow for running end-to-end tests. It adds new steps to test the BentoML deployment with different ingress TLS modes: 'none', 'auto', and 'static'. The appropriate environment variables are set for each test.controllers/bentodeployment_controller.go
: Updated ingress configuration handling for different TLS modes.helm/yatai-deployment/templates/configmap-network.yaml
: Added ingress TLS mode and static TLS secret name configuration options. helm/yatai-deployment/values.yaml
: Added ingress TLS mode and static TLS secret name configuration options. The layers.network section includes ingressTlsMode and ingressStaticTlsSecretName values to configure the ingress TLS mode and static TLS secret name.scripts/quick-install-yatai-deployment.sh
: Updated the script to include the INGRESS_TLS_MODE and INGRESS_STATIC_TLS_SECRET_NAME environment variables. These variables are used to set the ingress TLS mode and static TLS secret name during the installation of the BentoML deployment.tests/e2e/e2e_test.go
: Added tests for ingress creation and TLS mode configuration. It validates the creation of the Ingress resource and checks the correctness of the TLS configuration based on the configured TLS mode.tests/e2e/example_with_ingress.yaml
: New example configuration file for BentoML deployment with ingress enabled.tests/e2e/installation_test.sh
: Pass INGRESS_TLS_MODE
and INGRESS_STATIC_TLS_SECRET_NAME
tests/e2e/installation_test_ingress.sh
: Now also installs the Ingress controller and then installs the everything with the appropriate ingress TLS mode configuration.tests/gh-actions/kind-cluster-1-23.yaml
: Updated KinD cluster configuration with extra port mappings and node label to make it compatible with nginx ingress.tests/gh-actions/kind-cluster-1-26.yaml
: same as aboveTIA for your time reviewing this ❤️
You are amazing, this PR is too professional!
hmmm, it's still running on the old test setup though, you need to set it up to use the new github actions
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
@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.
CI related PR has been merged.
@yetone This PR has been rebased on main so it should be possible to run the e2e test now.
@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 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.
Could it be that the current e2e test is a bit flaky?
@DavidSpek You may need to change the configuration of the kind cluster so that it installs loadbalancer.
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?
Similar to https://github.com/bentoml/yatai-deployment/pull/123 I believe we should close this one
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
ingress-tls-mode
field tonetwork
ConfigMapingress-static-tls-secret
field tonetwork
ConfigMapingress-tls-mode
fieldSetup can be validated using this image
rauerhans/yatai-deployment:1.1.12
in theyatai-deployment
deployment and playing by adding the new fields to thenetwork
ConfigMap.Functionality
Depending on the new
ingress-tls-mode
field in thenetwork
ConfigMap, the controller will add the TLS config (hosts
is reused,secretName
is inferred, based on setting) to the ingress of the Bento deployment.none
, the controller will not add any TLS config to the ingress, as previously.static
, the controller will reference to a wildcard certificate to the ingress of the Bento deployment.auto
, reuse the name of the BentoDeployment CRD for the name of the TLS secret. This is useful in a scenario where the user wants to use cert-manager to generate a certificate for the ingress of the Bento deployment, so in addition you would have the appropriate annotations in thenetwork
ConfigMap, see below.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.
Mode: Auto
Use default annotations to add TLS to ingress through cert-manager. Results in a concrete TLS secret for each Bento deployment.