Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add minReplicaCount, remove replicas if autoscaling is enabled #1932

Merged
merged 5 commits into from
Sep 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions charts/selenium-grid/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ This table contains the configuration parameters of the chart and their default
| `autoscaling.deregisterLifecycle` | See `values.yaml` | Lifecycle applied to pods of deployments controlled by KEDA. Makes the node deregister from selenium hub |
| `chromeNode.enabled` | `true` | Enable chrome nodes |
| `chromeNode.deploymentEnabled` | `true` | Enable creation of Deployment for chrome nodes |
| `chromeNode.replicas` | `1` | Number of chrome nodes |
| `chromeNode.replicas` | `1` | Number of chrome nodes. Disabled if autoscaling is enabled. |
| `chromeNode.imageName` | `selenium/node-chrome` | Image of chrome nodes |
| `chromeNode.imageTag` | `4.12.1-20230904` | Image of chrome nodes |
| `chromeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -139,9 +139,10 @@ This table contains the configuration parameters of the chart and their default
| `chromeNode.hpa.browserName` | `chrome` | BrowserName from the capability |
| `chromeNode.hpa.browserVersion` | `` | BrowserVersion from the capability |
| `chromeNode.maxReplicaCount` | `8` | Max number of replicas that this browsernode can auto scale up to |
| `chromeNode.minReplicaCount` | `1` | Min number of replicas that this browsernode has when jobs are running |
| `firefoxNode.enabled` | `true` | Enable firefox nodes |
| `firefoxNode.deploymentEnabled` | `true` | Enable creation of Deployment for firefox nodes |
| `firefoxNode.replicas` | `1` | Number of firefox nodes |
| `firefoxNode.replicas` | `1` | Number of firefox nodes. Disabled if autoscaling is enabled. |
| `firefoxNode.imageName` | `selenium/node-firefox` | Image of firefox nodes |
| `firefoxNode.imageTag` | `4.12.1-20230904` | Image of firefox nodes |
| `firefoxNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -174,9 +175,10 @@ This table contains the configuration parameters of the chart and their default
| `firefoxNode.hpa.browserName` | `firefox` | BrowserName from the capability |
| `firefoxNode.hpa.browserVersion` | `` | BrowserVersion from the capability |
| `firefoxNode.maxReplicaCount` | `8` | Max number of replicas that this browsernode can auto scale up to |
| `firefoxNode.minReplicaCount` | `1` | Min number of replicas that this browsernode has when jobs are running |
| `edgeNode.enabled` | `true` | Enable edge nodes |
| `edgeNode.deploymentEnabled` | `true` | Enable creation of Deployment for edge nodes |
| `edgeNode.replicas` | `1` | Number of edge nodes |
| `edgeNode.replicas` | `1` | Number of edge nodes. Disabled if autoscaling is enabled. |
| `edgeNode.imageName` | `selenium/node-edge` | Image of edge nodes |
| `edgeNode.imageTag` | `4.12.1-20230904` | Image of edge nodes |
| `edgeNode.imagePullPolicy` | `IfNotPresent` | Image pull policy (see https://kubernetes.io/docs/concepts/containers/images/#updating-images) |
Expand Down Expand Up @@ -209,6 +211,7 @@ This table contains the configuration parameters of the chart and their default
| `edgeNode.hpa.browserName` | `edge` | BrowserName from the capability |
| `edgeNode.hpa.browserVersion` | `` | BrowserVersion from the capability |
| `edgeNode.maxReplicaCount` | `8` | Max number of replicas that this browsernode can auto scale up to |
| `edgeNode.minReplicaCount` | `1` | Min number of replicas that this browsernode has when jobs are running |
| `customLabels` | `{}` | Custom labels for k8s resources |
| `customLabels` | `{}` | Custom labels for k8s resources |

Expand Down
2 changes: 2 additions & 0 deletions charts/selenium-grid/templates/chrome-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }}
replicas: {{ .Values.chromeNode.replicas }}
{{end}}
selector:
matchLabels:
app: selenium-chrome-node
Expand Down
1 change: 1 addition & 0 deletions charts/selenium-grid/templates/chrome-node-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ metadata:
deploymentName: {{ template "seleniumGrid.chromeNode.fullname" . }}
spec:
maxReplicaCount: {{ .Values.chromeNode.maxReplicaCount }}
minReplicaCount: {{ .Values.chromeNode.minReplicaCount }}
scaleTargetRef:
name: {{ template "seleniumGrid.chromeNode.fullname" . }}
triggers:
Expand Down
2 changes: 2 additions & 0 deletions charts/selenium-grid/templates/edge-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }}
replicas: {{ .Values.edgeNode.replicas }}
{{end}}
selector:
matchLabels:
app: selenium-edge-node
Expand Down
1 change: 1 addition & 0 deletions charts/selenium-grid/templates/edge-node-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ metadata:
deploymentName: {{ template "seleniumGrid.edgeNode.fullname" . }}
spec:
maxReplicaCount: {{ .Values.edgeNode.maxReplicaCount }}
minReplicaCount: {{ .Values.edgeNode.minReplicaCount }}
scaleTargetRef:
name: {{ template "seleniumGrid.edgeNode.fullname" . }}
triggers:
Expand Down
2 changes: 2 additions & 0 deletions charts/selenium-grid/templates/firefox-node-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if and (not .Values.autoscaling.enabled) (not .Values.autoscaling.enableWithExistingKEDA) }}
replicas: {{ .Values.firefoxNode.replicas }}
{{end}}
selector:
matchLabels:
app: selenium-firefox-node
Expand Down
1 change: 1 addition & 0 deletions charts/selenium-grid/templates/firefox-node-hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ metadata:
deploymentName: {{ template "seleniumGrid.firefoxNode.fullname" . }}
spec:
maxReplicaCount: {{ .Values.firefoxNode.maxReplicaCount }}
minReplicaCount: {{ .Values.firefoxNode.minReplicaCount }}
scaleTargetRef:
name: {{ template "seleniumGrid.firefoxNode.fullname" . }}
triggers:
Expand Down
3 changes: 3 additions & 0 deletions charts/selenium-grid/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ chromeNode:
# claimName: my-pv-claim

maxReplicaCount: 8
minReplicaCount: 1
hpa:
url: '{{ include "seleniumGrid.graphqlURL" . }}'
browserName: chrome
Expand Down Expand Up @@ -587,6 +588,7 @@ firefoxNode:
# persistentVolumeClaim:
# claimName: my-pv-claim
maxReplicaCount: 8
minReplicaCount: 1
hpa:
url: '{{ include "seleniumGrid.graphqlURL" . }}'
browserName: firefox
Expand Down Expand Up @@ -700,6 +702,7 @@ edgeNode:
# persistentVolumeClaim:
# claimName: my-pv-claim
maxReplicaCount: 8
minReplicaCount: 1
hpa:
url: '{{ include "seleniumGrid.graphqlURL" . }}'
browserName: MicrosoftEdge
Expand Down