Skip to content

Commit

Permalink
Autoscaling capability to opensearch-dashboards helm chart (#232)
Browse files Browse the repository at this point in the history
* Added conifigurable ASG stratergy for opensource dahboard helm chart

Signed-off-by: pgodithi <[email protected]>

* Added configurable ASG strategy for opensearch dahboard helm chart

Signed-off-by: pgodithi <[email protected]>

* Resolving the conflict with 1.3 release

Signed-off-by: pgodithi <[email protected]>

* Resolving the conflict with 1.3 release

Signed-off-by: pgodithi <[email protected]>

* Fixed PR comments

Signed-off-by: pgodithi <[email protected]>

* Fixed PR comments

Signed-off-by: pgodithi <[email protected]>

* Fixed PR comments

Signed-off-by: pgodithi <[email protected]>

* Reverting autoscaling to v1 api

Signed-off-by: pgodithi <[email protected]>

* changes in chart.yaml and changelog files

Signed-off-by: pgodithi <[email protected]>

* adding default autoscaling value to false in values.yaml

Signed-off-by: pgodithi <[email protected]>

* Fix conflict issues

Signed-off-by: pgodithi <[email protected]>

* Fix conflict issues remove extra spaces

Signed-off-by: pgodithi <[email protected]>

* fixed wrong git URL

Signed-off-by: pgodithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Mar 28, 2022
1 parent 44185b0 commit 5499b02
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 5 deletions.
18 changes: 16 additions & 2 deletions charts/opensearch-dashboards/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.3.2]
### Added
- Added pod autoscaling capability.
- Added autoscaling configuration parameters in readme.
- Added autoscaling.yaml under templates.
### Changed
- Updated the chart version to 1.3.2
- Changed values.yaml to reflect autoscaling changes.
### Deprecated
### Removed
### Fixed
### Security
---
## [1.3.1]
### Added
### Changed
Expand Down Expand Up @@ -154,7 +167,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.3.1...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.3.2...HEAD
[1.3.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.3.1...opensearch-1.3.2
[1.3.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.3.0...opensearch-1.3.1
[1.3.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.2.2...opensearch-1.3.0
[1.2.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.2.1...opensearch-1.2.2
Expand All @@ -168,4 +182,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
[1.0.6]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.5...opensearch-1.0.6
[1.0.5]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.4...opensearch-1.0.5
[1.0.4]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.0.2...opensearch-1.0.4
[1.0.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.0.1...opensearch-dashboards-1.0.2
[1.0.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.0.1...opensearch-dashboards-1.0.2
2 changes: 1 addition & 1 deletion charts/opensearch-dashboards/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.3.1
version: 1.3.2

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
1 change: 1 addition & 0 deletions charts/opensearch-dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,4 @@
| `tolerations` | Configurable [tolerations][] | `[]` |
| `updateStrategy` | The [updateStrategy][] for the StatefulSet. By default Kubernetes will wait for the cluster to be green after upgrading each pod. Setting this to `OnDelete` will allow you to manually delete each pod during upgrades | `RollingUpdate` |
| `extraObjects` | Array of extra K8s manifests to deploy | list `[]` |
| `autoscaling` | Prerequisite: Install/Configure metrics server, to install use `kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml`, See https://github.com/kubernetes-sigs/metrics-server. Configurable pod autoscaling stratergy to scale based on `targetCPUUtilizationPercentage`, configure `minReplicas` and `maxReplicas` for desired scaling | false |
15 changes: 15 additions & 0 deletions charts/opensearch-dashboards/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if .Values.autoscaling.enabled -}}
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "opensearch-dashboards.fullname" . }}-hpa
labels: {{- include "opensearch-dashboards.labels" . | nindent 4 }}
spec:
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
minReplicas: {{ .Values.autoscaling.minReplicas }}
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: {{ template "opensearch-dashboards.fullname" . }}
targetCPUUtilizationPercentage: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
5 changes: 3 additions & 2 deletions charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,12 @@ resources:
memory: "512M"

autoscaling:
# This requires metrics server to be installed, to install use kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
# See https://github.com/kubernetes-sigs/metrics-server
enabled: false
minReplicas: 1
maxReplicas: 100
maxReplicas: 10
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

updateStrategy:
type: "Recreate"
Expand Down

0 comments on commit 5499b02

Please sign in to comment.