From c0d3bbe6b468fe7e6fe1a8f39584af70b8bcd860 Mon Sep 17 00:00:00 2001 From: Daniil Muidinov Date: Wed, 1 Jun 2022 10:36:42 +0300 Subject: [PATCH] [helm] add support of loadBalancerIP for hub and router services --- charts/selenium-grid/README.md | 2 ++ charts/selenium-grid/templates/hub-service.yaml | 3 +++ charts/selenium-grid/templates/router-service.yaml | 3 +++ charts/selenium-grid/values.yaml | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/charts/selenium-grid/README.md b/charts/selenium-grid/README.md index e11742c03c..344fc7da7d 100644 --- a/charts/selenium-grid/README.md +++ b/charts/selenium-grid/README.md @@ -140,6 +140,7 @@ You can configure the Selenium Hub with this values: | `hub.extraEnvFrom` | `nil` | Custom environment variables for selenium taken from `configMap` or `secret`-hub | | `hub.resources` | `{}` | Resources for selenium-hub container | | `hub.serviceType` | `NodePort` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | +| `hub.loadBalancerIP` | `nil` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) | | `hub.serviceAnnotations` | `{}` | Custom annotations for Selenium Hub service | @@ -158,6 +159,7 @@ If you implement selenium-grid with separate components (`isolateComponents: tru | `components.router.readinessProbe` | `See values.yaml` | Readiness probe settings | | `components.router.resources` | `{}` | Resources for router container | | `components.router.serviceType` | `NodePort` | Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) | +| `components.router.loadBalancerIP` | `nil` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) | | `components.router.serviceAnnotations` | `{}` | Custom annotations for router service | | `components.distributor.imageName` | `selenium/distributor` | Distributor image name | | `components.distributor.imageTag` | `nil` | Distributor image tag (this overwrites `.global.seleniumGrid.imageTag` value) | diff --git a/charts/selenium-grid/templates/hub-service.yaml b/charts/selenium-grid/templates/hub-service.yaml index 316d8d540a..7a9474b3e3 100644 --- a/charts/selenium-grid/templates/hub-service.yaml +++ b/charts/selenium-grid/templates/hub-service.yaml @@ -17,6 +17,9 @@ spec: selector: app: selenium-hub type: {{ .Values.hub.serviceType }} + {{- if and (eq .Values.hub.serviceType "LoadBalancer") ( .Values.hub.loadBalancerIP ) }} + loadBalancerIP: {{ .Values.hub.loadBalancerIP }} + {{- end }} ports: - name: http-hub protocol: TCP diff --git a/charts/selenium-grid/templates/router-service.yaml b/charts/selenium-grid/templates/router-service.yaml index 45b910bd20..9b2c87d43e 100644 --- a/charts/selenium-grid/templates/router-service.yaml +++ b/charts/selenium-grid/templates/router-service.yaml @@ -17,6 +17,9 @@ spec: selector: app: selenium-router type: {{ .Values.components.router.serviceType }} + {{- if and (eq .Values.components.router.serviceType "LoadBalancer") (.Values.components.router.loadBalancerIP) }} + loadBalancerIP: {{ .Values.components.router.loadBalancerIP }} + {{- end }} ports: - name: tcp-router protocol: TCP diff --git a/charts/selenium-grid/values.yaml b/charts/selenium-grid/values.yaml index a6bf188388..9fd513be81 100644 --- a/charts/selenium-grid/values.yaml +++ b/charts/selenium-grid/values.yaml @@ -53,6 +53,8 @@ components: resources: {} # Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) serviceType: NodePort + # Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) + loadBalancerIP: "" # Custom annotations for router service serviceAnnotations: {} # Tolerations for router container @@ -230,6 +232,8 @@ hub: resources: {} # Kubernetes service type (see https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types) serviceType: NodePort + # Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) + loadBalancerIP: "" # Custom annotations for Selenium Hub service serviceAnnotations: {} # Tolerations for selenium-hub container