To support the Istio choose protocol, add the port name to the discovery service. (#27940)

Signed-off-by: Anh Pham <anhpn.uit@gmail.com>
Co-authored-by: Anh Pham <anh.pham4@hitachids.com>
This commit is contained in:
Anh Pham 2024-03-26 23:36:53 +07:00 committed by GitHub
parent 305dd5812e
commit 0286e7ad5d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -58,6 +58,7 @@ public final class Constants {
public static final String KEYCLOAK_SERVICE_PROTOCOL = "TCP"; public static final String KEYCLOAK_SERVICE_PROTOCOL = "TCP";
public static final String KEYCLOAK_SERVICE_SUFFIX = "-service"; public static final String KEYCLOAK_SERVICE_SUFFIX = "-service";
public static final Integer KEYCLOAK_DISCOVERY_SERVICE_PORT = 7800; public static final Integer KEYCLOAK_DISCOVERY_SERVICE_PORT = 7800;
public static final String KEYCLOAK_DISCOVERY_TCP_PORT_NAME = "tcp";
public static final String KEYCLOAK_DISCOVERY_SERVICE_SUFFIX = "-discovery"; public static final String KEYCLOAK_DISCOVERY_SERVICE_SUFFIX = "-discovery";
public static final String KEYCLOAK_INGRESS_SUFFIX = "-ingress"; public static final String KEYCLOAK_INGRESS_SUFFIX = "-ingress";

View file

@ -48,6 +48,7 @@ public class KeycloakDiscoveryServiceDependentResource extends CRUDKubernetesDep
private ServiceSpec getServiceSpec(Keycloak keycloak) { private ServiceSpec getServiceSpec(Keycloak keycloak) {
return new ServiceSpecBuilder() return new ServiceSpecBuilder()
.addNewPort() .addNewPort()
.withName(Constants.KEYCLOAK_DISCOVERY_TCP_PORT_NAME)
.withProtocol("TCP") .withProtocol("TCP")
.withPort(Constants.KEYCLOAK_DISCOVERY_SERVICE_PORT) .withPort(Constants.KEYCLOAK_DISCOVERY_SERVICE_PORT)
.endPort() .endPort()