diff --git a/prometheus/Chart.yaml b/prometheus/Chart.yaml index 3413aeee7..cd99b1968 100644 --- a/prometheus/Chart.yaml +++ b/prometheus/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v2.25.0 description: OpenStack-Helm Prometheus name: prometheus -version: 0.1.13 +version: 0.1.14 home: https://prometheus.io/ sources: - https://github.com/prometheus/prometheus diff --git a/prometheus/templates/bin/_prometheus.sh.tpl b/prometheus/templates/bin/_prometheus.sh.tpl index 50d7d5830..25cb90528 100644 --- a/prometheus/templates/bin/_prometheus.sh.tpl +++ b/prometheus/templates/bin/_prometheus.sh.tpl @@ -15,15 +15,23 @@ limitations under the License. */}} set -ex -COMMAND="${@:-start}" -function start () { -{{ $flags := include "prometheus.utils.command_line_flags" .Values.conf.prometheus.command_line_flags }} - exec /bin/prometheus --config.file=/etc/config/prometheus.yml {{ $flags }} -} +# Two ways how to launch init process in container: by default and custom (defined in override values). +{{ $deflaunch := .Values.proc_launch.prometheus.default }} +if [ "{{ $deflaunch }}" = true ] +then + COMMAND="${@:-start}" -function stop () { - kill -TERM 1 -} + function start () { + {{ $flags := include "prometheus.utils.command_line_flags" .Values.conf.prometheus.command_line_flags }} + exec /bin/prometheus --config.file=/etc/config/prometheus.yml {{ $flags }} + } -$COMMAND + function stop () { + kill -TERM 1 + } + + $COMMAND +else + {{ tpl (.Values.proc_launch.prometheus.custom_launch) . }} +fi diff --git a/prometheus/values.yaml b/prometheus/values.yaml index 5872f1739..d6da537fd 100644 --- a/prometheus/values.yaml +++ b/prometheus/values.yaml @@ -271,6 +271,17 @@ network_policy: egress: - {} +proc_launch: + prometheus: + default: true + custom_launch: | + while true + do + echo "If 'proc_launch.prometheus.default: false'." + echo "Your custom shell script code you can put here." + sleep 10 + done + secrets: oci_image_registry: prometheus: prometheus-oci-image-registry-key diff --git a/releasenotes/notes/prometheus.yaml b/releasenotes/notes/prometheus.yaml index 0e38e442d..bcbb9dfc9 100644 --- a/releasenotes/notes/prometheus.yaml +++ b/releasenotes/notes/prometheus.yaml @@ -14,4 +14,5 @@ prometheus: - 0.1.11 Update htk requirements - 0.1.12 Update default image value to Wallaby - 0.1.13 Added OCI registry authentication + - 0.1.14 Added feature to launch Prometheus with custom script ...