[ceph] Use Helm toolkit functions for Ceph probes

This change converts the readiness and liveness probes in the Ceph
charts to use the functions from the Helm toolkit rather than
having hard-coded probe definitions. This allows probe configs to
be overridden in values.yaml without rebuilding charts.

Change-Id: I68a01b518f12d33fe4f87f86494a5f4e19be982e
This commit is contained in:
Stephen Taylor 2023-08-15 12:55:26 -06:00
parent b5cec0086a
commit 443ff3e3e3
13 changed files with 113 additions and 54 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph Client description: OpenStack-Helm Ceph Client
name: ceph-client name: ceph-client
version: 0.1.46 version: 0.1.47
home: https://github.com/ceph/ceph-client home: https://github.com/ceph/ceph-client
... ...

View File

@ -12,6 +12,16 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "livenessProbeTemplate" }}
tcpSocket:
port: 6800
{{- end }}
{{- define "readinessProbeTemplate" }}
tcpSocket:
port: 6800
{{- end }}
{{- if and .Values.manifests.deployment_mds ( and .Values.deployment.ceph .Values.conf.features.mds) }} {{- if and .Values.manifests.deployment_mds ( and .Values.deployment.ceph .Values.conf.features.mds) }}
{{- $envAll := . }} {{- $envAll := . }}
@ -100,15 +110,8 @@ spec:
value: {{ tuple "ceph_mon" "internal" "mon_msgr2" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }} value: {{ tuple "ceph_mon" "internal" "mon_msgr2" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
ports: ports:
- containerPort: 6800 - containerPort: 6800
livenessProbe: {{ dict "envAll" . "component" "ceph" "container" "ceph-mds" "type" "liveness" "probeTemplate" (include "livenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
tcpSocket: {{ dict "envAll" . "component" "ceph" "container" "ceph-mds" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
port: 6800
initialDelaySeconds: 60
timeoutSeconds: 5
readinessProbe:
tcpSocket:
port: 6800
timeoutSeconds: 5
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@ -179,6 +179,18 @@ pod:
key: node.kubernetes.io/unreachable key: node.kubernetes.io/unreachable
operator: Exists operator: Exists
tolerationSeconds: 60 tolerationSeconds: 60
probes:
ceph:
ceph-mds:
readiness:
enabled: true
params:
timeoutSeconds: 5
liveness:
enabled: true
params:
initialDelaySeconds: 60
timeoutSeconds: 5
secrets: secrets:
keyrings: keyrings:

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph Mon description: OpenStack-Helm Ceph Mon
name: ceph-mon name: ceph-mon
version: 0.1.29 version: 0.1.30
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -12,6 +12,18 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "monLivenessProbeTemplate" -}}
exec:
command:
- /tmp/mon-check.sh
{{- end -}}
{{- define "monReadinessProbeTemplate" -}}
exec:
command:
- /tmp/mon-check.sh
{{- end -}}
{{- if and .Values.manifests.daemonset_mon .Values.deployment.ceph }} {{- if and .Values.manifests.daemonset_mon .Values.deployment.ceph }}
{{- $envAll := . }} {{- $envAll := . }}
@ -175,20 +187,8 @@ spec:
ports: ports:
- containerPort: {{ tuple "ceph_mon" "internal" "mon" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - containerPort: {{ tuple "ceph_mon" "internal" "mon" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
- containerPort: {{ tuple "ceph_mon" "internal" "mon_msgr2" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - containerPort: {{ tuple "ceph_mon" "internal" "mon_msgr2" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe: {{ dict "envAll" . "component" "ceph" "container" "ceph-mon" "type" "liveness" "probeTemplate" (include "monLivenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
exec: {{ dict "envAll" . "component" "ceph" "container" "ceph-mon" "type" "readiness" "probeTemplate" (include "monReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
command:
- /tmp/mon-check.sh
- liveness
initialDelaySeconds: 360
periodSeconds: 180
readinessProbe:
exec:
command:
- /tmp/mon-check.sh
- readiness
initialDelaySeconds: 60
periodSeconds: 60
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@ -12,6 +12,18 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "mgrLivenessProbeTemplate" -}}
exec:
command:
- /tmp/mgr-check.sh
{{- end }}
{{- define "mgrReadinessProbeTemplate" -}}
exec:
command:
- /tmp/mgr-check.sh
{{- end }}
{{- if and .Values.manifests.deployment_mgr (and .Values.deployment.ceph .Values.conf.features.mgr ) }} {{- if and .Values.manifests.deployment_mgr (and .Values.deployment.ceph .Values.conf.features.mgr ) }}
{{- $envAll := . }} {{- $envAll := . }}
@ -126,20 +138,6 @@ spec:
- name: metrics - name: metrics
containerPort: {{ tuple "ceph_mgr" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} containerPort: {{ tuple "ceph_mgr" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
{{ end -}} {{ end -}}
livenessProbe:
exec:
command:
- /tmp/mgr-check.sh
- liveness
initialDelaySeconds: 30
timeoutSeconds: 5
readinessProbe:
exec:
command:
- /tmp/mgr-check.sh
- readiness
initialDelaySeconds: 30
timeoutSeconds: 5
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp
@ -177,6 +175,8 @@ spec:
mountPath: /tmp/utils-checkPGs.py mountPath: /tmp/utils-checkPGs.py
subPath: utils-checkPGs.py subPath: utils-checkPGs.py
readOnly: true readOnly: true
{{ dict "envAll" . "component" "ceph" "container" "ceph-mgr" "type" "liveness" "probeTemplate" (include "mgrLivenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
{{ dict "envAll" . "component" "ceph" "container" "ceph-mgr" "type" "readiness" "probeTemplate" (include "mgrReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
volumes: volumes:
- name: pod-tmp - name: pod-tmp
emptyDir: {} emptyDir: {}

View File

@ -207,6 +207,32 @@ pod:
key: node.kubernetes.io/unreachable key: node.kubernetes.io/unreachable
operator: Exists operator: Exists
tolerationSeconds: 60 tolerationSeconds: 60
probes:
ceph:
ceph-mon:
readiness:
enabled: true
params:
initialDelaySeconds: 60
periodSeconds: 60
timeoutSeconds: 5
liveness:
enabled: true
params:
initialDelaySeconds: 360
periodSeconds: 180
timeoutSeconds: 5
ceph-mgr:
readiness:
enabled: true
params:
initialDelaySeconds: 30
timeoutSeconds: 5
liveness:
enabled: true
params:
initialDelaySeconds: 30
timeoutSeconds: 5
secrets: secrets:
keyrings: keyrings:

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph OSD description: OpenStack-Helm Ceph OSD
name: ceph-osd name: ceph-osd
version: 0.1.45 version: 0.1.46
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -12,6 +12,18 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "osdLivenessProbeTemplate" -}}
exec:
command:
- /tmp/osd-check.sh
{{- end -}}
{{- define "osdReadinessProbeTemplate" -}}
exec:
command:
- /tmp/osd-check.sh
{{- end -}}
{{- if .Values.manifests.daemonset_osd }} {{- if .Values.manifests.daemonset_osd }}
{{- $envAll := . }} {{- $envAll := . }}
@ -352,20 +364,8 @@ spec:
exec: exec:
command: command:
- /tmp/osd-stop.sh - /tmp/osd-stop.sh
livenessProbe: {{ dict "envAll" . "component" "ceph-osd" "container" "ceph-osd" "type" "liveness" "probeTemplate" (include "osdLivenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
exec: {{ dict "envAll" . "component" "ceph-osd" "container" "ceph-osd" "type" "readiness" "probeTemplate" (include "osdReadinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
command:
- /tmp/osd-check.sh
- liveness
initialDelaySeconds: 120
periodSeconds: 60
readinessProbe:
exec:
command:
- /tmp/osd-check.sh
- readiness
initialDelaySeconds: 60
periodSeconds: 60
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@ -137,6 +137,21 @@ pod:
limits: limits:
memory: "1024Mi" memory: "1024Mi"
cpu: "2000m" cpu: "2000m"
probes:
ceph-osd:
ceph-osd:
readiness:
enabled: true
params:
initialDelaySeconds: 60
periodSeconds: 60
timeoutSeconds: 5
liveness:
enabled: true
params:
initialDelaySeconds: 120
periodSeconds: 60
timeoutSeconds: 5
secrets: secrets:
keyrings: keyrings:

View File

@ -47,4 +47,5 @@ ceph-client:
- 0.1.44 Allow pg_num_min to be overridden per pool - 0.1.44 Allow pg_num_min to be overridden per pool
- 0.1.45 Update Ceph to 17.2.6 - 0.1.45 Update Ceph to 17.2.6
- 0.1.46 Strip any errors preceding pool properties JSON - 0.1.46 Strip any errors preceding pool properties JSON
- 0.1.47 Use Helm toolkit functions for Ceph probes
... ...

View File

@ -30,4 +30,5 @@ ceph-mon:
- 0.1.27 Update all Ceph images to Focal - 0.1.27 Update all Ceph images to Focal
- 0.1.28 Document the use of mon_allow_pool_size_one - 0.1.28 Document the use of mon_allow_pool_size_one
- 0.1.29 Update Ceph to 17.2.6 - 0.1.29 Update Ceph to 17.2.6
- 0.1.30 Use Helm tookkit functions for Ceph probes
... ...

View File

@ -46,4 +46,5 @@ ceph-osd:
- 0.1.43 Update all Ceph images to Focal - 0.1.43 Update all Ceph images to Focal
- 0.1.44 Update Ceph to 17.2.6 - 0.1.44 Update Ceph to 17.2.6
- 0.1.45 Extend the ceph-osd post-apply job PG wait - 0.1.45 Extend the ceph-osd post-apply job PG wait
- 0.1.46 Use Helm toolkit functions for Ceph probes
... ...