diff --git a/helm/templates/ingestor-statefulset.yaml b/helm/templates/ingestor-statefulset.yaml index 684509e1a..06b2b50d2 100644 --- a/helm/templates/ingestor-statefulset.yaml +++ b/helm/templates/ingestor-statefulset.yaml @@ -32,6 +32,24 @@ spec: {{- .Values.parseable.highAvailability.ingestor.labels | toYaml | nindent 8 }} {{- include "parseable.ingestorLabelsSelector" . | nindent 8 }} spec: + initContainers: + - name: wait-for-query-service + image: curlimages/curl:latest # Lightweight image with curl + command: + - /bin/sh + - -c + - | + echo "Waiting for query service readiness at /api/v1/readiness..." + for i in $(seq 1 60); do + if curl -sf http://{{ include "parseable.fullname" . }}-querier-service.{{ .Release.Namespace }}/api/v1/readiness; then + echo "Query service is ready!" + exit 0 + fi + echo "Query service is not ready yet. Retrying in 2 seconds..." + sleep 2 + done + echo "Query service did not become ready in time. Exiting." + exit 1 terminationGracePeriodSeconds: 10 serviceAccountName: {{ include "parseable.serviceAccountName" . }} containers: