ceph-mgr: change liveness/readiness probes
Instead of relying on the dashboard availability we check the ceph-mgr map Signed-off-by: Alexandre Marangone <amarango@redhat.com> Change-Id: I78d33a4b522ed085ed85a638b3784c2d07026e39
This commit is contained in:
parent
ef6e711f3e
commit
5cd3a087bf
ceph/templates
14
ceph/templates/bin/_check_mgr.sh.tpl
Normal file
14
ceph/templates/bin/_check_mgr.sh.tpl
Normal file
@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -ex
|
||||
export LC_ALL=C
|
||||
|
||||
source variables_entrypoint.sh
|
||||
|
||||
IS_MGR_AVAIL=`ceph ${CLI_OPTS} mgr dump | python -c "import json, sys; print json.load(sys.stdin)['available']"`
|
||||
|
||||
if [ "${IS_MGR_AVAIL}" = True ]; then
|
||||
exit 0
|
||||
else
|
||||
exit 1
|
||||
fi
|
@ -63,6 +63,8 @@ data:
|
||||
{{ tuple "bin/_start_rgw.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||
start_mgr.sh: |+
|
||||
{{ tuple "bin/_start_mgr.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||
check_mgr.sh: |+
|
||||
{{ tuple "bin/_check_mgr.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||
init_rgw_ks.sh: |+
|
||||
{{ tuple "bin/_init_rgw_ks.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||
watch_mon_health.sh: |+
|
||||
|
@ -73,23 +73,35 @@ spec:
|
||||
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||
{{ tuple $envAll $envAll.Values.pod.resources.mgr | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||
env:
|
||||
- name: MGR_PORT
|
||||
value: "{{ .Values.network.port.mgr }}"
|
||||
{{- if .Values.ceph_mgr_enabled_modules }}
|
||||
- name: ENABLED_MODULES
|
||||
value: |-
|
||||
{{- range $value := .Values.ceph_mgr_enabled_modules }}
|
||||
{{ $value }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.ceph_mgr_modules_config }}
|
||||
{{- range $module,$params := .Values.ceph_mgr_modules_config }}
|
||||
{{- range $key, $value := $params }}
|
||||
- name: {{ $module }}_{{ $key }}
|
||||
value: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
command:
|
||||
- /start_mgr.sh
|
||||
ports:
|
||||
- containerPort: {{ .Values.network.port.mgr }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: {{ .Values.network.port.mgr }}
|
||||
initialDelaySeconds: 120
|
||||
exec:
|
||||
command:
|
||||
- bash
|
||||
- /check_mgr.sh
|
||||
initialDelaySeconds: 30
|
||||
timeoutSeconds: 5
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /
|
||||
port: {{ .Values.network.port.mgr }}
|
||||
timeoutSeconds: 5
|
||||
exec:
|
||||
command:
|
||||
- bash
|
||||
- /check_mgr.sh
|
||||
volumeMounts:
|
||||
- name: pod-etc-ceph
|
||||
mountPath: /etc/ceph
|
||||
@ -101,6 +113,10 @@ spec:
|
||||
mountPath: /start_mgr.sh
|
||||
subPath: start_mgr.sh
|
||||
readOnly: true
|
||||
- name: ceph-bin
|
||||
mountPath: /check_mgr.sh
|
||||
subPath: check_mgr.sh
|
||||
readOnly: true
|
||||
- name: ceph-bin
|
||||
mountPath: /variables_entrypoint.sh
|
||||
subPath: variables_entrypoint.sh
|
||||
|
Loading…
x
Reference in New Issue
Block a user