Skip to content

Commit

Permalink
[backport 1.x] Backport for healthchecks PR #329 (#333)
Browse files Browse the repository at this point in the history
* Add healthcheck probes to charts (#329)

* Adding missing healthcheck probe configurations

Signed-off-by: Luis Schweigard <luis.schweigard@gmail.com>
Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Bumping chart versions and adding changes to CHANGELOG.md

Signed-off-by: Luis Schweigard <luis.schweigard@gmail.com>
Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Making opensearch liveness probe optional

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Configuring livenessProbe to be optional for opensearch-dashboards chart

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Adapting readme files

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Changing opensearch dashboard lifecycle checks to tcpSocket

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Adding changelog

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

Signed-off-by: Luis Schweigard <luis.schweigard@gmail.com>
Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

* Chart version bump

Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>

Signed-off-by: Luis Schweigard <luis.schweigard@gmail.com>
Signed-off-by: Luis Schweigard <luis.schweigard@maibornwolff.de>
  • Loading branch information
lieberlois authored Oct 5, 2022
1 parent fda407a commit f759374
Show file tree
Hide file tree
Showing 10 changed files with 96 additions and 8 deletions.
12 changes: 11 additions & 1 deletion charts/opensearch-dashboards/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security
---
## [1.8.4]
### Added
- Healthchecks
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.8.3]
### Added
- Template configmap content by tpl function
Expand Down Expand Up @@ -306,7 +315,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.8.3...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-dashboards-1.8.4...HEAD
[1.8.4]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.8.3...opensearch-1.8.4
[1.8.3]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.8.2...opensearch-1.8.3
[1.8.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.8.1...opensearch-1.8.2
[1.8.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.8.0...opensearch-1.8.1
Expand Down
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.8.3
version: 1.8.4

# 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
11 changes: 11 additions & 0 deletions charts/opensearch-dashboards/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,14 @@
| `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 |
| `livenessProbe` | Configuration fields for the liveness [probe][] | see [exampleLiveness][] in `values.yaml`
| `readinessProbe` | Configuration fields for the readiness [probe][] | see [exampleReadiness][] in `values.yaml`
| `startupProbe` | Configuration fields for the startup [probe][] | see [exampleStartup][] in `values.yaml` |


[probe]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes


[exampleStartup]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/values.yaml#17
[exampleLiveness]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/values.yaml#27
[exampleReadiness]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/values.yaml#37
14 changes: 14 additions & 0 deletions charts/opensearch-dashboards/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,20 @@ spec:
{{ toYaml .Values.securityContext | indent 10 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
{{- if .Values.readinessProbe }}
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
{{- end }}
{{- if .Values.livenessProbe }}
livenessProbe:
{{ toYaml .Values.livenessProbe | indent 10 }}
{{- end }}
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.Version }}
{{- if .Values.readinessProbe }}
startupProbe:
{{ toYaml .Values.startupProbe | indent 10 }}
{{- end }}
{{- end }}
env:
{{- if .Values.opensearchURL }}
- name: OPENSEARCH_URL
Expand Down
27 changes: 27 additions & 0 deletions charts/opensearch-dashboards/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,33 @@ image:
tag: ""
pullPolicy: "IfNotPresent"

startupProbe:
tcpSocket:
port: 5601
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 20
successThreshold: 1
initialDelaySeconds: 10

livenessProbe:
tcpSocket:
port: 5601
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 10
successThreshold: 1
initialDelaySeconds: 10

readinessProbe:
tcpSocket:
port: 5601
periodSeconds: 20
timeoutSeconds: 5
failureThreshold: 10
successThreshold: 1
initialDelaySeconds: 10

imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
Expand Down
12 changes: 11 additions & 1 deletion charts/opensearch/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
### Security

---
## [1.14.2]
### Added
- Healthchecks
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [1.14.1]
### Added
Expand Down Expand Up @@ -485,7 +494,8 @@ config:
### Fixed
### Security

[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.14.1...HEAD
[Unreleased]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.14.2...HEAD
[1.14.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.14.1...opensearch-1.14.2
[1.14.1]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.14.0...opensearch-1.14.1
[1.14.0]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.2...opensearch-1.14.0
[1.13.2]: https://github.com/opensearch-project/helm-charts/compare/opensearch-1.13.1...opensearch-1.13.2
Expand Down
2 changes: 1 addition & 1 deletion charts/opensearch/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.14.1
version: 1.14.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
10 changes: 6 additions & 4 deletions charts/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@ helm uninstall my-release
| `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` |
| `volumeClaimTemplate` | Configuration for the [volumeClaimTemplate for StatefulSets][]. You will want to adjust the storage (default `30Gi` ) and the `storageClassName` if you are using a different storage class | see [values.yaml][] |
| `extraObjects` | Array of extra K8s manifests to deploy | list `[]` | |
| `readinessProbe` | Configuration fields for the readiness [probe][] | see [example][] in `values.yaml`
| `startupProbe` | Configuration fields for the [probe][] | see [sample][] in `values.yaml` |
| `livenessProbe` | Configuration fields for the liveness [probe][] | see [exampleLiveness][] in `values.yaml`
| `readinessProbe` | Configuration fields for the readiness [probe][] | see [exampleReadiness][] in `values.yaml`
| `startupProbe` | Configuration fields for the startup [probe][] | see [exampleStartup][] in `values.yaml` |



Expand Down Expand Up @@ -168,6 +169,7 @@ helm uninstall my-release

[probe]: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/#define-readiness-probes

[example]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#L336
[exampleStartup]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#332
[exampleLiveness]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#340
[exampleReadiness]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#349

[sample]: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/values.yaml#L328
4 changes: 4 additions & 0 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ spec:
imagePullPolicy: "{{ .Values.image.pullPolicy }}"
readinessProbe:
{{ toYaml .Values.readinessProbe | indent 10 }}
{{- if .Values.livenessProbe }}
livenessProbe:
{{ toYaml .Values.livenessProbe | indent 10 }}
{{- end }}
{{- if semverCompare ">=1.16-0" .Capabilities.KubeVersion.Version }}
startupProbe:
{{ toYaml .Values.startupProbe | indent 10 }}
Expand Down
10 changes: 10 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,16 @@ startupProbe:
periodSeconds: 10
timeoutSeconds: 3
failureThreshold: 30

livenessProbe: {}
# periodSeconds: 20
# timeoutSeconds: 5
# failureThreshold: 10
# successThreshold: 1
# initialDelaySeconds: 10
# tcpSocket:
# port: 9200

readinessProbe:
tcpSocket:
port: 9200
Expand Down

0 comments on commit f759374

Please sign in to comment.