[ceph-rgw] Use Helm toolkit functions for Ceph RGW probes

This change converts the readiness and liveness probes in the Ceph
RGW chart 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: Ia09d06746ee06f96f61a479b57a110c94e77c615
This commit is contained in:
Stephen Taylor 2023-08-22 10:30:17 -06:00 committed by Taylor, Stephen (st053q)
parent dc200450ea
commit c984e2f169
4 changed files with 38 additions and 14 deletions

View File

@ -15,6 +15,6 @@ apiVersion: v1
appVersion: v1.0.0 appVersion: v1.0.0
description: OpenStack-Helm Ceph RadosGW description: OpenStack-Helm Ceph RadosGW
name: ceph-rgw name: ceph-rgw
version: 0.1.27 version: 0.1.28
home: https://github.com/ceph/ceph home: https://github.com/ceph/ceph
... ...

View File

@ -12,6 +12,28 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- define "readinessProbeTemplate" }}
{{- $object_store_name := "object_store" }}
{{- if .Values.conf.rgw_s3.enabled }}
{{ $object_store_name = "ceph_object_store" }}
{{- end }}
httpGet:
path: /
port: {{ tuple $object_store_name "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
scheme: {{ tuple $object_store_name "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
{{- end }}
{{- define "livenessProbeTemplate" }}
{{- $object_store_name := "object_store" }}
{{- if .Values.conf.rgw_s3.enabled }}
{{ $object_store_name = "ceph_object_store" }}
{{- end }}
httpGet:
path: /
port: {{ tuple $object_store_name "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
scheme: {{ tuple $object_store_name "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
{{- end }}
{{- if and .Values.manifests.deployment_rgw ( and .Values.deployment.ceph .Values.conf.features.rgw ) }} {{- if and .Values.manifests.deployment_rgw ( and .Values.deployment.ceph .Values.conf.features.rgw ) }}
{{- $envAll := . }} {{- $envAll := . }}
@ -195,19 +217,8 @@ spec:
- /tmp/rgw-start.sh - /tmp/rgw-start.sh
ports: ports:
- containerPort: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - containerPort: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
livenessProbe: {{ dict "envAll" . "component" "api" "container" "ceph-rgw" "type" "liveness" "probeTemplate" (include "livenessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
httpGet: {{ dict "envAll" . "component" "api" "container" "ceph-rgw" "type" "readiness" "probeTemplate" (include "readinessProbeTemplate" . | fromYaml) | include "helm-toolkit.snippets.kubernetes_probe" | trim | indent 10 }}
path: /
port: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
scheme: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
initialDelaySeconds: 120
timeoutSeconds: 5
readinessProbe:
httpGet:
path: /
port: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
scheme: {{ tuple $object_store_name "internal" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_scheme_lookup" | upper }}
timeoutSeconds: 5
volumeMounts: volumeMounts:
- name: pod-tmp - name: pod-tmp
mountPath: /tmp mountPath: /tmp

View File

@ -239,6 +239,18 @@ pod:
- key: node-role.kubernetes.io/control-plane - key: node-role.kubernetes.io/control-plane
operator: Exists operator: Exists
effect: NoSchedule effect: NoSchedule
probes:
api:
ceph-rgw:
readiness:
enabled: true
params:
timeoutSeconds: 5
liveness:
enabled: true
params:
initialDelaySeconds: 120
timeoutSeconds: 5
network_policy: network_policy:
rgw: rgw:

View File

@ -28,4 +28,5 @@ ceph-rgw:
- 0.1.25 Update all Ceph images to Focal - 0.1.25 Update all Ceph images to Focal
- 0.1.26 Replace node-role.kubernetes.io/master with control-plane - 0.1.26 Replace node-role.kubernetes.io/master with control-plane
- 0.1.27 Update Ceph to 17.2.6 - 0.1.27 Update Ceph to 17.2.6
- 0.1.28 Use Helm toolkit functions for Ceph probes
... ...