From c63e6283311347cf85587dba38babaa2c60c7d93 Mon Sep 17 00:00:00 2001 From: dhardy Date: Thu, 28 Mar 2024 15:35:29 +0100 Subject: [PATCH] Add Service appProtocol for GKE Gateway support as backend (#751) ### Description Adding `spec.port.0.appProtocol: "HTTPS"` for compliance with GKE gateways cf : https://cloud.google.com/kubernetes-engine/docs/how-to/secure-gateway#load-balancer-tls ### Issues Resolved Fixes #751 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. For more information on following Developer Certificate of Origin and signing off your commits, please check [here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin). --------- Signed-off-by: Damien HARDY Signed-off-by: dhardy --- opensearch-operator/pkg/builders/cluster.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opensearch-operator/pkg/builders/cluster.go b/opensearch-operator/pkg/builders/cluster.go index 581220a8..c4e18118 100644 --- a/opensearch-operator/pkg/builders/cluster.go +++ b/opensearch-operator/pkg/builders/cluster.go @@ -634,6 +634,7 @@ func NewServiceForCR(cr *opsterv1.OpenSearchCluster) *corev1.Service { labels := map[string]string{ helpers.ClusterLabel: cr.Name, } + httpsProtocol := "HTTPS" return &corev1.Service{ TypeMeta: metav1.TypeMeta{ Kind: "Service", @@ -650,6 +651,7 @@ func NewServiceForCR(cr *opsterv1.OpenSearchCluster) *corev1.Service { { Name: "http", Protocol: "TCP", + AppProtocol: &httpsProtocol, Port: cr.Spec.General.HttpPort, TargetPort: intstr.IntOrString{ IntVal: cr.Spec.General.HttpPort,