From 20e57df13892996163d185be60929296b0843ffb Mon Sep 17 00:00:00 2001 From: James Roper Date: Sat, 24 Aug 2024 01:42:55 +1000 Subject: [PATCH 1/2] docs: Update README.md to be more helpful (#6585) The docs/README.md made no sense. Anyone reading it in GitHub clearly wants to contribute to the documentation, that's why they're in the source code of Contour, why else would they have found their way to the source repository? So, it should point to where the documentation lives in the git repository, not to the website where it's served. Signed-off-by: James Roper Co-authored-by: Steve Kriss --- docs/README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/README.md b/docs/README.md index 7ee7f907e6d..1c0c91bdcd8 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,10 +1,5 @@ # Contour Documentation -The contents of this directory have moved to [projectcontour.io](https://projectcontour.io/). -Specifically; +The contents of this directory have moved to corresponding directories in [../site/content](../site/content). -* Guides and How-to's have moved to [projectcontour.io/guides](https://projectcontour.io/guides) -* Versioned release documentation has moved to [projectcontour.io/docs](https://projectcontour.io/docs) -* Project related and non-versioned documentation has moved to [projectcontour.io/resources](https://projectcontour.io/resources/) - -For more about how we're thinking of Contour's future, check out [the design docs](../design/). +For more information on how to contribute to the Contour documentation, see the [Contour Technical Documentation Contributing Guide](https://projectcontour.io/resources/contributing-docs/). From 63f5e195c10451d40fe8d889b764e3452163cfb7 Mon Sep 17 00:00:00 2001 From: Ludovic Logiou Date: Sat, 24 Aug 2024 10:48:21 +0200 Subject: [PATCH 2/2] [api-gateway]: Support http(s) as AppProtocol in Kubernetes svc (#6616) * [api-gateway]: Support http, https and www-http as AppProtocol in kubernetes' service Fix #6560 Signed-off-by: Ludovic Logiou * Remove legacy www-http Signed-off-by: Ludovic Logiou * Fix undefined vars Signed-off-by: Ludovic Logiou * Add changelog Signed-off-by: Ludovic Logiou * Fix issues found by the linter Signed-off-by: Ludovic Logiou * Fix format and add unit tests Signed-off-by: Ludovic Logiou --------- Signed-off-by: Ludovic Logiou --- changelogs/unreleased/6616-Krast76-small.md | 1 + internal/dag/accessors.go | 4 ++++ internal/dag/accessors_test.go | 22 +++++++++++++++++++++ 3 files changed, 27 insertions(+) create mode 100644 changelogs/unreleased/6616-Krast76-small.md diff --git a/changelogs/unreleased/6616-Krast76-small.md b/changelogs/unreleased/6616-Krast76-small.md new file mode 100644 index 00000000000..b44b28c7263 --- /dev/null +++ b/changelogs/unreleased/6616-Krast76-small.md @@ -0,0 +1 @@ +Contour, support http and https as AppProtocol in k8s' services diff --git a/internal/dag/accessors.go b/internal/dag/accessors.go index c039d28ccba..c3b78f71bc2 100644 --- a/internal/dag/accessors.go +++ b/internal/dag/accessors.go @@ -110,6 +110,8 @@ func validateExternalName(svc *core_v1.Service, enableExternalNameSvc bool) erro const ( protoK8sH2C = "kubernetes.io/h2c" protoK8sWS = "kubernetes.io/ws" + protoHTTPS = "https" + protoHTTP = "http" ) func toContourProtocol(appProtocol string) (string, bool) { @@ -117,6 +119,8 @@ func toContourProtocol(appProtocol string) (string, bool) { // *NOTE: for gateway-api: the websocket is enabled by default protoK8sWS: "", protoK8sH2C: "h2c", + protoHTTP: "", + protoHTTPS: "tls", }[appProtocol] return proto, ok } diff --git a/internal/dag/accessors_test.go b/internal/dag/accessors_test.go index bc3e2b8692e..99c9470bd3b 100644 --- a/internal/dag/accessors_test.go +++ b/internal/dag/accessors_test.go @@ -127,6 +127,18 @@ func TestBuilderLookupService(t *testing.T) { AppProtocol: ptr.To("kubernetes.io/wss"), Port: 8444, }, + { + Name: "iana-https", + Protocol: "TCP", + AppProtocol: ptr.To("https"), + Port: 8445, + }, + { + Name: "iana-http", + Protocol: "TCP", + AppProtocol: ptr.To("http"), + Port: 8446, + }, }, }, } @@ -218,6 +230,16 @@ func TestBuilderLookupService(t *testing.T) { port: 8444, want: appProtcolService(appProtoService, "", 1), }, + "lookup service by port number with supported IANA app protocol: https": { + NamespacedName: types.NamespacedName{Name: appProtoService.Name, Namespace: appProtoService.Namespace}, + port: 8445, + want: appProtcolService(appProtoService, "tls", 2), + }, + "lookup service by port number with supported IANA app protocol: http": { + NamespacedName: types.NamespacedName{Name: appProtoService.Name, Namespace: appProtoService.Namespace}, + port: 8446, + want: appProtcolService(appProtoService, "", 3), + }, } for name, tc := range tests {