Skip to content

Add an init container that's wait to seaweedfs api pod#276

Merged
GiladShapira94 merged 9 commits intomlrun:developmentfrom
GiladShapira94:fix-init-seaweed
Mar 17, 2026
Merged

Add an init container that's wait to seaweedfs api pod#276
GiladShapira94 merged 9 commits intomlrun:developmentfrom
GiladShapira94:fix-init-seaweed

Conversation

@GiladShapira94
Copy link
Collaborator

This PR fixes an issue where the KFP API pod fails with CrashLoopBackOff while trying to connect to the SeaweedFS API, but this pod is not in running state.
This PR adds an init container to the KFP API that waits to the SeaweedFS API and then init the KFP API

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent the Kubeflow Pipelines (KFP) API server (ml-pipeline) from entering CrashLoopBackOff when SeaweedFS (object store / S3 gateway) isn’t ready yet, by adding a blocking init container to wait for the endpoint before starting the main container.

Changes:

  • Add a conditional initContainers section to the ml-pipeline Deployment when seaweedfs.enabled is true.
  • Implement a wait loop that polls the configured object-store host/port before allowing the pod to proceed.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +168 to +170
{{- if .Values.seaweedfs.enabled }}
initContainers:
- name: wait-for-seaweedfs
configMapKeyRef:
name: pipeline-install-config
key: objectStoreServicePort
{{- end }}
Comment on lines +170 to +187
- name: wait-for-seaweedfs
image: busybox:1.36
command:
- sh
- -c
- |
until wget -q -S -O /dev/null http://${SEAWEEDFS_HOST}:${SEAWEEDFS_PORT}/ 2>&1 | grep -q "HTTP/"; do
echo "Waiting for SeaweedFS S3 to be ready..."
sleep 5
done
echo "SeaweedFS S3 is ready."
env:
- name: SEAWEEDFS_HOST
valueFrom:
configMapKeyRef:
name: pipeline-install-config
key: objectStoreServiceHost
- name: SEAWEEDFS_PORT
- sh
- -c
- |
until wget -q -S -O /dev/null http://${SEAWEEDFS_HOST}:${SEAWEEDFS_PORT}/ 2>&1 | grep -q "HTTP/"; do
{{- if .Values.seaweedfs.enabled }}
initContainers:
- name: wait-for-seaweedfs
image: busybox:1.36
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

read from values to allow changing the registry/repository/tag

Comment on lines +176 to +179
until wget -q -S -O /dev/null http://${SEAWEEDFS_HOST}:${SEAWEEDFS_PORT}/ 2>&1 | grep -q "HTTP/"; do
echo "Waiting for SeaweedFS S3 to be ready..."
sleep 5
done
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep in mind that swfs http endpoint might answer something - but does it meanit is ready for clients to use its backend?

@GiladShapira94 GiladShapira94 merged commit 335cbcd into mlrun:development Mar 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants