Skip to content

Commit

Permalink
chart(update): use podIP in all components server host (#2429)
Browse files Browse the repository at this point in the history
* chart(update): use podIP in all components server host
* chart(update): disable Node service resource creation by default

---------

Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 authored Oct 12, 2024
1 parent 839e5f6 commit 94da26e
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,49 +40,57 @@ jobs:
helm-version: 'v3.10.3'
docker-version: '24.0.9'
test-upgrade: true
service-mesh: true
- k8s-version: 'v1.26.15'
test-strategy: disabled
cluster: 'minikube'
helm-version: 'v3.11.3'
docker-version: '24.0.9'
test-upgrade: true
service-mesh: false
- k8s-version: 'v1.27.16'
test-strategy: job
cluster: 'minikube'
helm-version: 'v3.12.3'
docker-version: '24.0.9'
test-upgrade: true
service-mesh: true
- k8s-version: 'v1.28.14'
test-strategy: deployment
cluster: 'minikube'
helm-version: 'v3.13.3'
docker-version: '24.0.9'
test-upgrade: true
service-mesh: true
- k8s-version: 'v1.29.9'
test-strategy: job_https
cluster: 'minikube'
helm-version: 'v3.14.3'
docker-version: '25.0.5'
test-upgrade: true
service-mesh: false
- k8s-version: 'v1.30.5'
test-strategy: job_hostname
cluster: 'minikube'
helm-version: 'v3.15.4'
docker-version: '26.1.4'
test-upgrade: true
service-mesh: false
- k8s-version: 'v1.31.1'
test-strategy: deployment_https
cluster: 'minikube'
helm-version: 'v3.16.1'
docker-version: '27.2.0'
test-upgrade: true
service-mesh: false
env:
CLUSTER: ${{ matrix.cluster }}
KUBERNETES_VERSION: ${{ matrix.k8s-version }}
ARTIFACT_NAME: "${{ matrix.k8s-version }}-${{ matrix.test-strategy }}"
HELM_VERSION: ${{ matrix.helm-version }}
DOCKER_VERSION: ${{ matrix.docker-version }}
TEST_UPGRADE_CHART: ${{ matrix.test-upgrade }}
SERVICE_MESH: ${{ matrix.service-mesh }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
Expand Down Expand Up @@ -148,7 +156,7 @@ jobs:
with:
timeout_minutes: 10
max_attempts: 3
command: CLUSTER=${CLUSTER} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
command: CLUSTER=${CLUSTER} SERVICE_MESH=${SERVICE_MESH} KUBERNETES_VERSION=${KUBERNETES_VERSION} NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_cluster_setup
- name: Test chart template
run: NAME=${IMAGE_REGISTRY} VERSION=${BRANCH} BUILD_DATE=${BUILD_DATE} make chart_test_template
- name: Test set custom CA certificate
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/CONFIGURATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| chromeNode.hostAliases | string | `nil` | Custom host aliases for chrome nodes |
| chromeNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for chrome nodes |
| chromeNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for chrome nodes |
| chromeNode.service.enabled | bool | `true` | Create a service for node |
| chromeNode.service.enabled | bool | `false` | Create a service for node |
| chromeNode.service.type | string | `"ClusterIP"` | Service type |
| chromeNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
| chromeNode.service.ports | string | `nil` | Extra ports exposed in node service |
Expand Down Expand Up @@ -421,7 +421,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| firefoxNode.hostAliases | string | `nil` | Custom host aliases for firefox nodes |
| firefoxNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for firefox nodes |
| firefoxNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for firefox nodes |
| firefoxNode.service.enabled | bool | `true` | Create a service for node |
| firefoxNode.service.enabled | bool | `false` | Create a service for node |
| firefoxNode.service.type | string | `"ClusterIP"` | Service type |
| firefoxNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
| firefoxNode.service.ports | string | `nil` | Extra ports exposed in node service |
Expand Down Expand Up @@ -471,7 +471,7 @@ A Helm chart for creating a Selenium Grid Server in Kubernetes
| edgeNode.hostAliases | string | `nil` | Custom host aliases for edge nodes |
| edgeNode.extraEnvironmentVariables | string | `nil` | Custom environment variables for edge nodes |
| edgeNode.extraEnvFrom | string | `nil` | Custom environment variables by sourcing entire configMap, Secret, etc. for edge nodes |
| edgeNode.service.enabled | bool | `true` | Create a service for node |
| edgeNode.service.enabled | bool | `false` | Create a service for node |
| edgeNode.service.type | string | `"ClusterIP"` | Service type |
| edgeNode.service.loadBalancerIP | string | `""` | Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer) |
| edgeNode.service.ports | string | `nil` | Extra ports exposed in node service |
Expand Down
4 changes: 4 additions & 0 deletions charts/selenium-grid/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,10 @@ template:
{{- end }}
- name: SE_OTEL_SERVICE_NAME
value: {{ .name | quote }}
- name: SE_NODE_HOST
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_NODE_PORT
value: {{ .node.port | quote }}
{{- with .node.startupProbe.timeoutSeconds }}
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/distributor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.distributor.fullname" . }}'
- name: SE_DISTRIBUTOR_HOST
value: '{{ template "seleniumGrid.distributor.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_DISTRIBUTOR_PORT
value: {{ .Values.components.distributor.port | quote }}
- name: SE_ROUTER_HOST
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/event-bus-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.eventBus.fullname" . }}'
- name: SE_EVENT_BUS_HOST
value: '{{ template "seleniumGrid.eventBus.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_EVENT_BUS_PORT
value: {{ .Values.components.eventBus.port | quote }}
{{- with .Values.components.extraEnvironmentVariables }}
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/hub-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.hub.fullname" . }}'
- name: SE_HUB_HOST
value: '{{ template "seleniumGrid.hub.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_HUB_PORT
value: {{ .Values.hub.port | quote }}
{{- with .Values.hub.subPath }}
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/router-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.router.fullname" . }}'
- name: SE_ROUTER_HOST
value: '{{ template "seleniumGrid.router.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_ROUTER_PORT
value: {{ .Values.components.router.port | quote }}
- name: SE_DISTRIBUTOR_HOST
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/session-map-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.sessionMap.fullname" . }}'
- name: SE_SESSIONS_HOST
value: '{{ template "seleniumGrid.sessionMap.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_SESSIONS_PORT
value: {{ .Values.components.sessionMap.port | quote }}
{{- with .Values.components.extraEnvironmentVariables }}
Expand Down
4 changes: 3 additions & 1 deletion charts/selenium-grid/templates/session-queue-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ spec:
- name: SE_OTEL_SERVICE_NAME
value: '{{ template "seleniumGrid.sessionQueue.fullname" . }}'
- name: SE_SESSION_QUEUE_HOST
value: '{{ template "seleniumGrid.sessionQueue.fullname" . }}.{{ .Release.Namespace }}'
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: SE_SESSION_QUEUE_PORT
value: {{ .Values.components.sessionQueue.port | quote }}
{{- with .Values.components.extraEnvironmentVariables }}
Expand Down
6 changes: 3 additions & 3 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ chromeNode:
# Service configuration
service:
# -- Create a service for node
enabled: true
enabled: false
# -- Service type
type: ClusterIP
# -- Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer)
Expand Down Expand Up @@ -1170,7 +1170,7 @@ firefoxNode:
# Service configuration
service:
# -- Create a service for node
enabled: true
enabled: false
# -- Service type
type: ClusterIP
# -- Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer)
Expand Down Expand Up @@ -1350,7 +1350,7 @@ edgeNode:
# Service configuration
service:
# -- Create a service for node
enabled: true
enabled: false
# -- Service type
type: ClusterIP
# -- Set specific loadBalancerIP when serviceType is LoadBalancer (see https://kubernetes.io/docs/concepts/services-networking/service/#loadbalancer)
Expand Down
5 changes: 5 additions & 0 deletions tests/charts/make/chart_cluster_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ SKIP_CLEANUP=${SKIP_CLEANUP:-"false"} # For debugging purposes, retain the clust
KUBERNETES_VERSION=${KUBERNETES_VERSION:-$(curl -L -s https://dl.k8s.io/release/stable.txt)}
CNI=${CNI:-"calico"} # auto, calico, cilium
CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-"docker"} # docker, containerd, cri-o
SERVICE_MESH=${SERVICE_MESH:-"false"}

# Function to clean up for retry step on workflow
cleanup() {
Expand Down Expand Up @@ -47,6 +48,10 @@ elif [ "${CLUSTER}" = "minikube" ]; then
sudo -SE minikube start --vm-driver=none \
--kubernetes-version=${KUBERNETES_VERSION} --network-plugin=cni --cni=${CNI} --container-runtime=${CONTAINER_RUNTIME} --wait=all
sudo chown -R $USER $HOME/.kube $HOME/.minikube
if [ "${SERVICE_MESH}" = "true" ]; then
minikube addons enable istio-provisioner
minikube addons enable istio
fi
fi

if [ "${CLUSTER}" = "kind" ]; then
Expand Down

0 comments on commit 94da26e

Please sign in to comment.