Skip to content

Commit

Permalink
fixes and improvements in helmchart NOTES.txt (#1554)
Browse files Browse the repository at this point in the history
Helm chart NOTES.txt  was  rendering `seleniumGrid.router` related output when  `.Values.isolateComponents` is set to `false`.  This PR fixes it and also added notes about accessing selenium withing Kubernetes cluster.

[skip ci]
  • Loading branch information
nom3ad authored Apr 29, 2022
1 parent 379c1ff commit 0a5c397
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions chart/selenium-grid/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
Selenium Grid Server deployed succesfully.

1. Get the URL FOR WebDriver tests by running these commands:
{{- $svcName := ternary (include "seleniumGrid.router.fullname" . ) (include "seleniumGrid.hub.fullname" . ) .Values.isolateComponents }}

1. To access Selenium from outside of Kubernetes, run these commands:

{{- $appName := ternary "selenium-router" "selenium-hub" .Values.isolateComponents }}
{{- $serviceType := ternary .Values.components.router.serviceType .Values.hub.serviceType .Values.isolateComponents }}
{{- $port := ternary .Values.components.router.port .Values.hub.port .Values.isolateComponents }}
{{- $localUrl := ternary "http://localhost:PORT" "http://localhost:PORT/wd/hub" .Values.isolateComponents }}
{{- if contains "NodePort" $serviceType }}
export NODE_PORT=$(kubectl get -n {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" svc {{ include "seleniumGrid.router.fullname" . }})
export NODE_PORT=$(kubectl get -n {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" svc {{ $svcName }})
export NODE_IP=$(kubectl get nodes -n {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" $serviceType }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get -n {{ .Release.Namespace }} svc -w {{ include "seleniumGrid.router.fullname" . }}'
export SERVICE_IP=$(kubectl get svc -n {{ .Release.Namespace }} {{ include "seleniumGrid.router.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
You can watch the status of by running 'kubectl get -n {{ .Release.Namespace }} svc -w {{ $svcName }}'
export SERVICE_IP=$(kubectl get svc -n {{ .Release.Namespace }} {{ $svcName }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ $port }}
{{- else if contains "ClusterIP" $serviceType }}
export POD_NAME=$(kubectl get pods -n {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ $appName }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Point your WebDriver tests to {{ $localUrl | replace "PORT" (toString $port) }}"
kubectl -n {{ .Release.Namespace }} port-forward $POD_NAME {{ $port }}:{{ $port }}
{{- end }}

2. Within Kubernetes cluster, you can use following Service endpoint:
http://{{ $svcName }}.{{ .Release.Namespace }}.svc:{{ $port }}

0 comments on commit 0a5c397

Please sign in to comment.