Skip to content

Conversation

phuhung273
Copy link

@phuhung273 phuhung273 commented Sep 29, 2025

What type of PR is this?
/kind test
/area conformance-test

What this PR does / why we need it:
This PR introduces basic same namespace conformance tests for TLSRoute with Terminate mode

Contour test
$ go test -v ./conformance -run TestConformance/TLSRouteTerminateSimpleSameNamespace -args         --gateway-class=contour         --supported-features=Gateway,TLSRoute,TLSRouteModeTerminate
=== RUN   TestConformance
    conformance.go:129: Running conformance tests with:
    conformance.go:147:   GatewayClass: contour
    conformance.go:148:   Cleanup Resources: true
    conformance.go:149:   Debug: false
    conformance.go:150:   Enable All Features: false
    conformance.go:151:   Supported Features: [TLSRoute TLSRouteModeTerminate Gateway]
    conformance.go:152:   ExemptFeatures: []
    conformance.go:153:   ConformanceProfiles: []
    suite.go:364: 2025-10-14T10:40:31.536874607Z: Test Setup: Ensuring GatewayClass has been accepted
    suite.go:370: 2025-10-14T10:40:31.54168476Z: Test Setup: Applying base manifests
    apply.go:275: 2025-10-14T10:40:31.549375547Z: Creating gateway-conformance-infra Namespace
    apply.go:275: 2025-10-14T10:40:31.568433482Z: Creating same-namespace Gateway
    apply.go:275: 2025-10-14T10:40:31.582987438Z: Creating same-namespace-with-https-listener Gateway
    apply.go:275: 2025-10-14T10:40:31.605646907Z: Creating all-namespaces Gateway
    apply.go:275: 2025-10-14T10:40:31.628341063Z: Creating backend-namespaces Gateway
    apply.go:275: 2025-10-14T10:40:31.64786284Z: Creating infra-backend-v1 Service
    apply.go:275: 2025-10-14T10:40:31.666651814Z: Creating infra-backend-v1 Deployment
    apply.go:275: 2025-10-14T10:40:31.68642487Z: Creating infra-backend-v2 Service
    apply.go:275: 2025-10-14T10:40:31.725707379Z: Creating infra-backend-v2 Deployment
    apply.go:275: 2025-10-14T10:40:31.755275533Z: Creating infra-backend-v3 Service
    apply.go:275: 2025-10-14T10:40:31.797018148Z: Creating infra-backend-v3 Deployment
    apply.go:275: 2025-10-14T10:40:31.823411912Z: Creating tls-backend Service
    apply.go:275: 2025-10-14T10:40:31.866265347Z: Creating tls-backend Deployment
    apply.go:275: 2025-10-14T10:40:31.878875947Z: Creating gateway-conformance-app-backend Namespace
    apply.go:275: 2025-10-14T10:40:31.900839302Z: Creating tls-backend Service
    apply.go:275: 2025-10-14T10:40:31.930821709Z: Creating tls-backend Deployment
    apply.go:275: 2025-10-14T10:40:31.948406979Z: Creating app-backend-v1 Service
    apply.go:275: 2025-10-14T10:40:31.980075275Z: Creating app-backend-v1 Deployment
    apply.go:275: 2025-10-14T10:40:31.993180668Z: Creating app-backend-v2 Service
    apply.go:275: 2025-10-14T10:40:32.026162884Z: Creating app-backend-v2 Deployment
    apply.go:275: 2025-10-14T10:40:32.051267115Z: Creating gateway-conformance-web-backend Namespace
    apply.go:275: 2025-10-14T10:40:32.074254762Z: Creating web-backend Service
    apply.go:275: 2025-10-14T10:40:32.100927679Z: Creating web-backend Deployment
    apply.go:275: 2025-10-14T10:40:32.121254238Z: Creating grpc-infra-backend-v1 Service
    apply.go:275: 2025-10-14T10:40:32.147606933Z: Creating grpc-infra-backend-v1 Deployment
    apply.go:275: 2025-10-14T10:40:32.160406977Z: Creating grpc-infra-backend-v2 Service
    apply.go:275: 2025-10-14T10:40:32.242989969Z: Creating grpc-infra-backend-v2 Deployment
    apply.go:275: 2025-10-14T10:40:32.280355667Z: Creating grpc-infra-backend-v3 Service
    apply.go:275: 2025-10-14T10:40:32.309092926Z: Creating grpc-infra-backend-v3 Deployment
    apply.go:275: 2025-10-14T10:40:32.330882513Z: Creating coredns Service
    apply.go:275: 2025-10-14T10:40:32.375345714Z: Creating coredns Deployment
    apply.go:275: 2025-10-14T10:40:32.407727539Z: Creating coredns ConfigMap
    suite.go:373: 2025-10-14T10:40:32.418934Z: Test Setup: Applying programmatic resources
    apply.go:226: 2025-10-14T10:40:33.011870187Z: Creating certificate
    apply.go:226: 2025-10-14T10:40:35.073327386Z: Creating tls-validity-checks-certificate
    apply.go:226: 2025-10-14T10:40:35.64861915Z: Creating tls-passthrough-checks-certificate
    apply.go:226: 2025-10-14T10:40:36.339184571Z: Creating tls-passthrough-checks-certificate
    apply.go:226: 2025-10-14T10:40:37.224360685Z: Creating tls-checks-ca-certificate
    apply.go:226: 2025-10-14T10:40:38.242317059Z: Creating tls-checks-certificate
    apply.go:226: 2025-10-14T10:40:39.24729919Z: Creating tls-terminate-checks-certificate
    apply.go:226: 2025-10-14T10:40:39.621476009Z: Creating mismatch-ca-certificate
    suite.go:395: 2025-10-14T10:40:39.648050652Z: Test Setup: Ensuring Gateways and Pods from base manifests are ready
    helpers.go:216: 2025-10-14T10:40:39.654121844Z: Gateway gateway-conformance-infra/backend-namespaces expected observedGeneration to be updated to 1 for all conditions, only 1/2 were updated. stale conditions are: Programmed (generation 0)
    helpers.go:240: 2025-10-14T10:40:40.661134107Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:40.661203191Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:40.661214523Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:41.662440063Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:41.662515799Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:41.662532157Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:42.659272555Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:42.659326962Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:42.659336749Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:43.660777067Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:43.660839719Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:43.660849193Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:44.658647682Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:44.658692974Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:44.658701238Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:45.658907805Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:45.658990013Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:45.659003103Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:46.658513239Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:46.658542862Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:46.658549457Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:47.656851399Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:47.65690045Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:47.656912621Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:49.133725912Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:49.133774606Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:49.133783451Z: Pod gateway-conformance-infra/contour-all-namespaces-8966ff59-qdkjf not ready yet
    helpers.go:240: 2025-10-14T10:40:50.1334241Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:50.133490703Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:50.133506519Z: Pod gateway-conformance-infra/envoy-same-namespace-with-https-listener-l7gbq not ready yet
    helpers.go:240: 2025-10-14T10:40:51.13329612Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:51.133430384Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:51.133450087Z: Pod gateway-conformance-infra/envoy-same-namespace-with-https-listener-l7gbq not ready yet
    helpers.go:240: 2025-10-14T10:40:52.135497033Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:52.135545119Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:52.135554705Z: Pod gateway-conformance-infra/envoy-same-namespace-with-https-listener-l7gbq not ready yet
    helpers.go:248: 2025-10-14T10:40:53.140929979Z: Gateways and Pods in gateway-conformance-infra, gateway-conformance-app-backend, gateway-conformance-web-backend namespaces ready
=== RUN   TestConformance/TLSRouteTerminateSimpleSameNamespace
    conformance.go:70: 2025-10-14T10:40:53.143400913Z: Applying tests/tlsroute-terminate-simple-same-namespace.yaml
    apply.go:275: 2025-10-14T10:40:53.150529739Z: Creating gateway-conformance-mqtt-test TLSRoute
    apply.go:275: 2025-10-14T10:40:53.158485913Z: Creating gateway-tlsroute-terminate Gateway
    apply.go:275: 2025-10-14T10:40:53.172033468Z: Creating mqtt-backend Service
    apply.go:275: 2025-10-14T10:40:53.18441166Z: Creating mqtt-backend Deployment
    apply.go:275: 2025-10-14T10:40:53.199159668Z: Creating mosquitto-config ConfigMap
    conformance.go:75: 2025-10-14T10:40:53.203412286Z: Running TLSRouteTerminateSimpleSameNamespace, relying on the following features: Gateway-standard, TLSRoute-experimental, TLSRouteModeTerminate-experimental
    helpers.go:216: 2025-10-14T10:40:53.228597913Z: Gateway gateway-conformance-infra/gateway-tlsroute-terminate expected observedGeneration to be updated to 1 for all conditions, only 0/2 were updated. stale conditions are: Accepted (generation 0), Programmed (generation 0)
    helpers.go:216: 2025-10-14T10:40:54.215892907Z: Gateway gateway-conformance-infra/gateway-tlsroute-terminate expected observedGeneration to be updated to 1 for all conditions, only 1/2 were updated. stale conditions are: Programmed (generation 0)
    helpers.go:240: 2025-10-14T10:40:55.212981056Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:55.213051186Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:55.213062308Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:40:56.214190745Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:56.21423974Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:56.214252274Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:40:57.213249204Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:57.213303798Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:57.213316714Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:40:58.212574263Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:58.212625967Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:58.212635283Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:40:59.214912718Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:40:59.215011294Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:40:59.215020613Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:41:00.21253474Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:41:00.212585017Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:41:00.212594514Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:41:01.213725917Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:41:01.2137914Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:41:01.213802575Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:240: 2025-10-14T10:41:02.212610221Z: Ready condition set to False, expected True
    helpers.go:240: 2025-10-14T10:41:02.212662501Z: Ready was not in conditions list
    helpers.go:243: 2025-10-14T10:41:02.212672397Z: Pod gateway-conformance-infra/envoy-gateway-tlsroute-terminate-x9flc not ready yet
    helpers.go:248: 2025-10-14T10:41:03.213903275Z: Gateways and Pods in gateway-conformance-infra namespaces ready
    helpers.go:661: 2025-10-14T10:41:03.219776494Z: Conditions matched expectations
    helpers.go:661: 2025-10-14T10:41:03.219825272Z: Route gateway-conformance-infra/gateway-conformance-mqtt-test Parents matched expectations
=== RUN   TestConformance/TLSRouteTerminateSimpleSameNamespace/Simple_MQTT_TLS_request_matching_TLSRoute_should_reach_mqtt-backend
    tlsroute-terminate-simple-same-namespace.go:73: Establishing MQTT connection to host tls.example.com via 172.18.0.8:1883
    tlsroute-terminate-simple-same-namespace.go:94: Connected to MQTT broker
    tlsroute-terminate-simple-same-namespace.go:103: Subscribed, publishing test message...
    tlsroute-terminate-simple-same-namespace.go:97: Received message: Hello TLSRoute Terminate MQTT!
    tlsroute-terminate-simple-same-namespace.go:122: Round-trip test succeeded
=== NAME  TestConformance/TLSRouteTerminateSimpleSameNamespace
    apply.go:283: 2025-10-14T10:41:03.228325597Z: Deleting mosquitto-config ConfigMap
    apply.go:283: 2025-10-14T10:41:03.234444829Z: Deleting mqtt-backend Deployment
    apply.go:283: 2025-10-14T10:41:03.23997154Z: Deleting mqtt-backend Service
    apply.go:283: 2025-10-14T10:41:03.274745637Z: Deleting gateway-tlsroute-terminate Gateway
    apply.go:283: 2025-10-14T10:41:03.293694666Z: Deleting gateway-conformance-mqtt-test TLSRoute
=== NAME  TestConformance
    apply.go:239: 2025-10-14T10:41:03.308455771Z: Deleting mismatch-ca-certificate
    apply.go:239: 2025-10-14T10:41:03.326924918Z: Deleting tls-terminate-checks-certificate
    apply.go:239: 2025-10-14T10:41:03.344737046Z: Deleting tls-checks-certificate
    apply.go:239: 2025-10-14T10:41:03.353682776Z: Deleting tls-checks-ca-certificate
    apply.go:239: 2025-10-14T10:41:03.364284143Z: Deleting tls-passthrough-checks-certificate
    apply.go:239: 2025-10-14T10:41:03.380636607Z: Deleting tls-passthrough-checks-certificate
    apply.go:239: 2025-10-14T10:41:03.402274404Z: Deleting tls-validity-checks-certificate
    apply.go:239: 2025-10-14T10:41:03.438444535Z: Deleting certificate
    apply.go:283: 2025-10-14T10:41:03.476824694Z: Deleting coredns ConfigMap
    apply.go:283: 2025-10-14T10:41:03.491916652Z: Deleting coredns Deployment
    apply.go:283: 2025-10-14T10:41:03.500145564Z: Deleting coredns Service
    apply.go:283: 2025-10-14T10:41:03.53806594Z: Deleting grpc-infra-backend-v3 Deployment
    apply.go:283: 2025-10-14T10:41:03.55540863Z: Deleting grpc-infra-backend-v3 Service
    apply.go:283: 2025-10-14T10:41:03.628143446Z: Deleting grpc-infra-backend-v2 Deployment
    apply.go:283: 2025-10-14T10:41:03.651671221Z: Deleting grpc-infra-backend-v2 Service
    apply.go:283: 2025-10-14T10:41:03.693015103Z: Deleting grpc-infra-backend-v1 Deployment
    apply.go:283: 2025-10-14T10:41:03.712697961Z: Deleting grpc-infra-backend-v1 Service
    apply.go:283: 2025-10-14T10:41:03.751845852Z: Deleting web-backend Deployment
    apply.go:283: 2025-10-14T10:41:03.767773953Z: Deleting web-backend Service
    apply.go:283: 2025-10-14T10:41:03.818228272Z: Deleting gateway-conformance-web-backend Namespace
    apply.go:283: 2025-10-14T10:41:03.843865961Z: Deleting app-backend-v2 Deployment
    apply.go:283: 2025-10-14T10:41:03.864781992Z: Deleting app-backend-v2 Service
    apply.go:283: 2025-10-14T10:41:03.895398335Z: Deleting app-backend-v1 Deployment
    apply.go:283: 2025-10-14T10:41:03.913557453Z: Deleting app-backend-v1 Service
    apply.go:283: 2025-10-14T10:41:03.954843217Z: Deleting tls-backend Deployment
    apply.go:283: 2025-10-14T10:41:03.96696597Z: Deleting tls-backend Service
    apply.go:283: 2025-10-14T10:41:03.992668558Z: Deleting gateway-conformance-app-backend Namespace
    apply.go:283: 2025-10-14T10:41:04.003318843Z: Deleting tls-backend Deployment
    apply.go:283: 2025-10-14T10:41:04.014734542Z: Deleting tls-backend Service
    apply.go:283: 2025-10-14T10:41:04.046094039Z: Deleting infra-backend-v3 Deployment
    apply.go:283: 2025-10-14T10:41:04.058245166Z: Deleting infra-backend-v3 Service
    apply.go:283: 2025-10-14T10:41:04.089168904Z: Deleting infra-backend-v2 Deployment
    apply.go:283: 2025-10-14T10:41:04.105045377Z: Deleting infra-backend-v2 Service
    apply.go:283: 2025-10-14T10:41:04.13405205Z: Deleting infra-backend-v1 Deployment
    apply.go:283: 2025-10-14T10:41:04.143643141Z: Deleting infra-backend-v1 Service
    apply.go:283: 2025-10-14T10:41:04.177954261Z: Deleting backend-namespaces Gateway
    apply.go:283: 2025-10-14T10:41:04.192253116Z: Deleting all-namespaces Gateway
    apply.go:283: 2025-10-14T10:41:04.230402092Z: Deleting same-namespace-with-https-listener Gateway
    apply.go:283: 2025-10-14T10:41:04.25559532Z: Deleting same-namespace Gateway
    apply.go:283: 2025-10-14T10:41:04.314379625Z: Deleting gateway-conformance-infra Namespace
--- PASS: TestConformance (32.49s)
    --- PASS: TestConformance/TLSRouteTerminateSimpleSameNamespace (10.17s)
        --- PASS: TestConformance/TLSRouteTerminateSimpleSameNamespace/Simple_MQTT_TLS_request_matching_TLSRoute_should_reach_mqtt-backend (0.01s)
PASS
ok      sigs.k8s.io/gateway-api/conformance     32.520s

Which issue(s) this PR fixes:
Relates #3466

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none Denotes a PR that doesn't merit a release note. kind/test area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 29, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @phuhung273!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 29, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @phuhung273. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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-sigs/prow repository.

@mikemorris
Copy link
Contributor

/ok-to-test

I'm not quite sure if this is specified explicitly (I don't see it mentioned in https://gateway-api.sigs.k8s.io/reference/spec/#listenertlsconfig or https://gateway-api.sigs.k8s.io/geps/gep-2907), but is mode: Terminate with TLSRoute a core conformance expectation now, or extended conformance and thus should have a new, specific feature flag like features.SupportTLSRouteModeTerminate?

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 29, 2025
@phuhung273
Copy link
Author

is mode: Terminate with TLSRoute a core conformance expectation now, or extended ?

Thanks for taking a look @mikemorris. I'm not sure about that, but can see we have a current features.SupportTLSRoute

@youngnick
Copy link
Contributor

Yeah, this absolutely should have a new feature name, so that implementations can support as they are ready to.

@youngnick
Copy link
Contributor

@phuhung273, thanks for getting us started!

Also, while it's valid to use HTTP as the inner protocol, we should also end up testing bare TCP functions as well.

@phuhung273
Copy link
Author

Also, while it's valid to use HTTP as the inner protocol, we should also end up testing bare TCP functions as well.

Thank you also for taking a look @youngnick. Absolutely i will try this (although having no idea what youre saying currently 😅)

Right now Im just trying to complete a simple case. This one seems useful https://github.com/projectcontour/contour/blob/main/internal/featuretests/v3/tlsroute_test.go, im trying to replicate the same.

@phuhung273 phuhung273 force-pushed the tls-terminate-conformance branch from 3e280d9 to 82b0822 Compare September 30, 2025 08:11
@phuhung273 phuhung273 changed the title [WIP] conformance: TLSRoute with Terminate mode conformance: TLSRoute with Terminate mode Sep 30, 2025
@phuhung273 phuhung273 marked this pull request as ready for review September 30, 2025 08:17
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 30, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: phuhung273
Once this PR has been reviewed and has the lgtm label, please assign danwinship for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@phuhung273
Copy link
Author

Verified with Contour, please see PR description for test output. Also added features.SupportTLSRouteModeTerminate as discussed. Let me know what you think @mikemorris @youngnick. Thank you so much.

@rikatz
Copy link
Member

rikatz commented Sep 30, 2025

So, just clarifying: per our TLS Guide we have the following supports and cases:

  • TLS = Passthrough + TLSRoute = Passthrough
  • TLS = Terminate + TLSRoute = Not supported (and you should be achieving this with HTTPRoute?)
  • TLS = Passthrough + TCPRoute = Not supported (you need to do it with PT + TLSRoute)
  • TLS = Terminate + TCPRoute = TLS offload (supported)
  • TLS = Terminate + HTTP/GRPCRoutes = supported

I am wondering why we are considering a TLS = Terminate + TLSRoute here? Is this just an alternative to TLS = Terminate + TCPRoute?

I think in this case it may be a bit misleading on which route I want / should use, if 2 do the same job.

Also, we are explicitly saying on the TLSRoute GEP that we don't support TLSRoute termination (https://github.com/kubernetes-sigs/gateway-api/pull/4064/files#diff-7e6544694a096dc122ce2ef4d38e4a47bfe14b72d5ae3603af9c17f6ccf23339R33) so if we can first agree on the GEP on if we should or not, then move to Conformance I would appreciate for my own sanity 😅

Thanks!

@phuhung273
Copy link
Author

phuhung273 commented Sep 30, 2025

Ok can see this table in the guide
image

Thanks @rikatz for the update. I will wait for GEP-2643 to finalize.

But currently we don't have any conformance for TCPRoute in Terminate mode. So I can add one rite ?

@mikemorris
Copy link
Contributor

mikemorris commented Sep 30, 2025

@rikatz TLSRoute support for attaching to Gateway listeners with mode: Terminate was added in #3458. More detail on the use cases for this combination can be found in #2111 and #3458 (comment).

It sounds like we may need to resolve some inconsistent documentation as mentioned in #1474?

@rikatz
Copy link
Member

rikatz commented Sep 30, 2025

thanks Mike. I have missed those, or maybe and inconsistently left them behind. Will take a look on them, but I am wondering if it would be good/proper that we have all of this mapped on the GEP before moving with more conformance that may not reflect the final state of the GEP

@mikemorris
Copy link
Contributor

mikemorris commented Sep 30, 2025

wondering if it would be good/proper that we have all of this mapped on the GEP before moving with more conformance that may not reflect the final state of the GEP

We've been somewhat inconsistent about this, but we generally haven't enforced substantial retroactive edits to older GEPs, instead allowing newer GEPs to supercede and prioritizing conformance tests and docs reflecting the current state while allowing older GEPs to stay as historical documents.

@rikatz
Copy link
Member

rikatz commented Sep 30, 2025

yeah but in this case we don't have a TLSRoute GEP at all, and my plan is to have some covering all of the features/conformance that are already in place for TLSRoute

@rikatz
Copy link
Member

rikatz commented Sep 30, 2025

Updated the GEP proposal to add TLSRoute termination: 23c275e

@candita
Copy link
Contributor

candita commented Oct 3, 2025

If it's not covered in that summary table, and we have no GEP mentioning it, then we can't just change the docs and call it done. We can add it to the TLSRoute GEP as a new area, but it then needs to be reviewed and debated. Right now I don't see the use case for TLSRoute termination.

@mikemorris
Copy link
Contributor

TLSRoute support for listeners with mode: Terminate already went through review previously and was added in #3458 as an update to GEP-2907, @rikatz latest updates are just ensuring for completeness this functionality is also covered within the complete TLSRoute GEP.

@candita
Copy link
Contributor

candita commented Oct 9, 2025

TLSRoute support for listeners with mode: Terminate already went through review previously and was added in #3458 as an update to GEP-2907, @rikatz latest updates are just ensuring for completeness this functionality is also covered within the complete TLSRoute GEP.

The GEP it was added to was a Memorandum GEP and not highly scrutinized. TLSRoute support for Terminate mode may eventually make it in as Extended, but we agreed in our last community meeting that we should not be using Memorandum GEPs to publish new features.

// TLSRouteModeTerminate contains metadata for the TLSRouteModeTerminate feature.
TLSRouteModeTerminateFeature = Feature{
Name: SupportTLSRouteModeTerminate,
Channel: FeatureChannelExperimental,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does TLSRouteModeTerminateFeature remain in the experimental channel after TLSRouteFeature moves to the standard channel?

Copy link
Author

Choose a reason for hiding this comment

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

Given GEP-2643: TLSRoute (although not finalized yet) stating Support both Termination and Passthrough TLS modes for TLSRoute, TLSRouteModeTerminateFeature will be in standard channel after TLSRouteFeature moves to standard.

Copy link
Contributor

@candita candita Oct 13, 2025

Choose a reason for hiding this comment

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

Please make sure it is marked as Extended in the CRD.

Copy link
Author

Choose a reason for hiding this comment

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

I'm not really understand your point @candita, should I make any change in CRD ?

ExtendedFeatures: features.SetsToNamesSet(features.GatewayExtendedFeatures),
ExtendedFeatures: features.SetsToNamesSet(
features.GatewayExtendedFeatures,
features.TLSRouteExtendedFeatures,
Copy link
Contributor

Choose a reason for hiding this comment

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

I could be convinced otherwise, but I don't think TLSRouteExtendedFeatures belongs grouped with GatewayTLSConformanceProfile. We should create a new conformance profile for TLSRoute. Unless we add TLSRouteCoreFeatures to the GatewayTLSConformanceProfile as well.

Copy link
Member

Choose a reason for hiding this comment

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

isn't it the case of features.SupportTLSRoute ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, please disregard.

- name: gateway-tlsroute-terminate
namespace: gateway-conformance-infra
hostnames:
- abc.example.com
Copy link
Contributor

Choose a reason for hiding this comment

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

Would you mind using a new hostname here (and creating a new certificate for that hostname). While "abc.example.com" is not necessarily reserved for HTTPRoute, it would be good to make sure TLSRoute certificate handling is working properly with a new hostname and certificate.

Copy link
Author

Choose a reason for hiding this comment

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

Sure I've updated to use tls.terminate.com

t.Fatalf("unexpected error finding TLS secret: %v", err)
}
t.Run("Simple TLS request matching TLSRoute should reach infra-backend", func(t *testing.T) {
tls.MakeTLSRequestAndExpectEventuallyConsistentResponse(t, suite.RoundTripper, suite.TimeoutConfig, gwAddr, cPem, keyPem, serverStr,
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if it would be a better test if we did not use an HTTP request. Maybe use FTP or MQTT to test this.

Copy link
Member

Choose a reason for hiding this comment

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

+1. As we are saying about TLS with termination, I would like to see a non HTTP traffic. Maybe MQTT, Postgres, can even be some simpler TCP listener that echos the requests.

It should start as a TLS client, backend non TLS, routing via SNI, check if connection is working.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you both for your feedback. I've updated to use MQTT but also installed additional library to make connection. Is it ok to do so ? As it has nothing to do with the project and only used for testing.

@phuhung273 phuhung273 force-pushed the tls-terminate-conformance branch 2 times, most recently from a996737 to aa021b6 Compare October 12, 2025 09:43
@phuhung273 phuhung273 force-pushed the tls-terminate-conformance branch from aa021b6 to c2daad7 Compare October 12, 2025 10:55
Copy link
Contributor

@mikemorris mikemorris left a comment

Choose a reason for hiding this comment

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

I think a different subdomain is good per @candita suggestion, but trying to stick to the canonical example.com testing domain rather than any real domains.

token := client.Connect()
if token.Wait() && token.Error() != nil {
t.Fatalf("Connection failed: %v", token.Error())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not an MQTT expert, but don't you have to subscribe and publish a message to test the transport? Doing a Connect doesn't seem enough.

Copy link
Author

Choose a reason for hiding this comment

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

Ah no worries, I thought connect is enough. Please check latest update for the full round-trip test. Thanks for the feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/test ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants