Skip to content

Commit

Permalink
Add lifecycle support in opensearch container (opensearch-project#376)
Browse files Browse the repository at this point in the history
* Add lifecycle support in opensearch container

Signed-off-by: josephteddick <josephteddick@gmail.com>

* lifecycle support PR cleanup

Signed-off-by: josephteddick <josephteddick@gmail.com>

---------

Signed-off-by: josephteddick <josephteddick@gmail.com>
Signed-off-by: prathaptce <86703966+prathaptce@users.noreply.github.com>
  • Loading branch information
josephteddick authored and prathaptce committed Mar 24, 2023
1 parent 6d457f7 commit feb9805
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
9 changes: 9 additions & 0 deletions charts/opensearch/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
---
## [2.11.1]
### Added
- Support for lifecycle in the opensearch container in the StatefulSet
### Changed
### Deprecated
### Removed
### Fixed
### Security
---
## [2.11.0]
### Added
### Changed
Expand Down
3 changes: 2 additions & 1 deletion charts/opensearch/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ 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: 2.11.0
version: 2.11.1


# 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: 6 additions & 5 deletions charts/opensearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

This Helm chart installs [OpenSearch](https://github.com/opensearch-project/OpenSearch) with configurable TLS, RBAC and much more configurations. This chart caters a number of different use cases and setups.

- [Requirements](#requirements)
- [Installing](#installing)
- [Uninstalling](#uninstalling)
- [Configuration](#configuration)
- [OpenSearch Helm Chart](#opensearch-helm-chart)
- [Requirements](#requirements)
- [Installing](#installing)
- [Uninstalling](#uninstalling)
- [Configuration](#configuration)

## Requirements

Expand Down Expand Up @@ -113,7 +114,7 @@ helm uninstall my-release
| `startupProbe` | Configuration fields for the startup [probe][] | see [exampleStartup][] in `values.yaml` |
| `plugins.enabled` | Allow/disallow to add 3rd Party / Custom plugins not offered in the default OpenSearchDashboards image | false |
| `plugins.installList` | Array containing the Opensearch Dashboards plugins to be installed in container | [] |
| `opensearchLifecycle` | Allows you to configure lifecycle hooks for the OpenSearch container in the StatefulSet | {} |
[anti-affinity]: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
Expand Down
4 changes: 4 additions & 0 deletions charts/opensearch/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,10 @@ spec:
{{- if .Values.envFrom }}
envFrom:
{{ toYaml .Values.envFrom | indent 8 }}
{{- end }}
{{- if .Values.opensearchLifecycle }}
lifecycle:
{{ toYaml .Values.opensearchLifecycle | indent 10 }}
{{- end }}
volumeMounts:
{{- if .Values.persistence.enabled }}
Expand Down
8 changes: 8 additions & 0 deletions charts/opensearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,14 @@ fullnameOverride: ""

masterTerminationFix: false

opensearchLifecycle: {}
# preStop:
# exec:
# command: ["/bin/sh", "-c", "echo Hello from the preStart handler > /usr/share/message"]
# postStart:
# exec:
# command: ["/bin/sh", "-c", "echo Hello from the postStart handler > /usr/share/message"]

lifecycle: {}
# preStop:
# exec:
Expand Down

0 comments on commit feb9805

Please sign in to comment.