Commit 5b29bd6
feat(autox): Add auto-discovery support for managed MinIO DSPAs (opendatahub-io#7256)
* feat(automl/bff): Add auto-discovery support for managed MinIO DSPAs
Enable BFF to automatically discover and inject S3 credentials when DSPA
uses managed MinIO (minio.deploy: true), eliminating the need for frontend
to explicitly pass secretName parameter for MinIO-based deployments.
Changes:
- Add MinioStorage model to DSPipelineApplication ObjectStorage spec
- Enhance injectDSPAObjectStorageIfAvailable() to detect managed MinIO
- Update AttachPipelineServerClient middleware for MinIO auto-discovery
- Add mock MinIO DSPA to test data (minio-test namespace)
- Add unit tests for MinIO auto-discovery functionality
When DSPA uses managed MinIO, the BFF now:
1. Detects minio.deploy: true in DSPA spec
2. Constructs secret name: ds-pipeline-s3-{dspa-name}
3. Constructs endpoint: http://minio-{dspa-name}.{namespace}.svc.cluster.local:9000
4. Injects DSPAObjectStorage into request context
5. S3 handlers use auto-discovered config (no secretName needed)
External storage is still preferred when both external and MinIO exist.
Resolves the 400 Bad Request error when accessing S3 endpoints in
namespaces with managed MinIO DSPAs.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* feat(autorag/bff): Add auto-discovery support for managed MinIO DSPAs
Enable BFF to automatically discover and inject S3 credentials when DSPA
uses managed MinIO (minio.deploy: true), eliminating the need for frontend
to explicitly pass secretName parameter for MinIO-based deployments.
Changes:
- Add MinioStorage model to DSPipelineApplication ObjectStorage spec
- Enhance injectDSPAObjectStorageIfAvailable() to detect managed MinIO
- Update AttachPipelineServerClient middleware for MinIO auto-discovery
- Add mock MinIO DSPA to test data (minio-test namespace)
- Add unit tests for MinIO auto-discovery functionality
When DSPA uses managed MinIO, the BFF now:
1. Detects minio.deploy: true in DSPA spec
2. Constructs secret name: ds-pipeline-s3-{dspa-name}
3. Constructs endpoint: http://minio-{dspa-name}.{namespace}.svc.cluster.local:9000
4. Injects DSPAObjectStorage into request context
5. S3 handlers use auto-discovered config (no secretName needed)
External storage is still preferred when both external and MinIO exist.
Resolves the 400 Bad Request error when accessing S3 endpoints in
namespaces with managed MinIO DSPAs.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* docs(automl,autorag): document managed MinIO local dev setup
Add instructions for port-forwarding the MinIO service and
configuring /etc/hosts when working with DSPAs that use managed
MinIO in local development.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat(automl,autorag/bff): Allow HTTP for in-cluster MinIO endpoints
- Updated S3 client validation to permit HTTP scheme for in-cluster endpoints
(*.svc.cluster.local)
- In-cluster endpoints skip DNS resolution and IP validation as they are
trusted cluster-internal services
- External endpoints still require HTTPS to prevent credentials in cleartext
- Added tests for HTTP in-cluster endpoints (MinIO service scenarios)
- Updated test names to clarify HTTP is rejected only for external endpoints
- Fixed autorag test to check for invalid scheme instead of invalid URL
This fixes the issue where auto-discovered managed MinIO configurations
were being rejected because they use HTTP internally within the cluster.
Both automl and autorag packages updated with identical changes.
* security(automl,autorag/bff): Require 5-label FQDN for in-cluster endpoints
Enhanced isInCluster validation to match gen-ai pattern:
- Require fully-qualified Kubernetes service DNS name with 5+ labels
(format: <service>.<namespace>.svc.cluster.local)
- Prevents overly-broad matches like 'evil.svc.cluster.local' (4 labels)
or 'evil.cluster.local' (3 labels)
- Added comprehensive tests for invalid cluster-local hostnames
This aligns with the security pattern established in the gen-ai package
and prevents potential SSRF attacks via malicious hostnames with partial
.svc.cluster.local or .cluster.local suffixes.
* feat(automl,autorag/bff): Read endpoint and bucket from MinIO secret
Enhanced GetS3CredentialsFromDSPA to prefer secret values over constructed defaults:
- Try to read AWS_S3_ENDPOINT from the secret first
- Fall back to constructed endpoint (http://minio-{name}.{ns}.svc.cluster.local:9000) if not present
- Similarly, prefer AWS_S3_BUCKET from secret over DSPA spec bucket
- Allows custom endpoint configurations while maintaining backward compatibility
This enables:
1. Custom MinIO endpoint configurations via secret
2. Non-standard ports or hostnames
3. External MinIO instances referenced from DSPA
4. Full flexibility for different deployment scenarios
Addresses feedback to read endpoint details from the secret instead of
hardcoding, while maintaining backward compatibility with the default
DSPA operator behavior.
* fix: address coderabbit
* fix: address comments
---------
Co-authored-by: Daniel Duong <danielduong@ibm.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Co-authored-by: Chris Jones <chrjones@redhat.com>1 parent 3fea5cf commit 5b29bd6
14 files changed
Lines changed: 1535 additions & 226 deletions
File tree
- packages
- automl/bff
- internal
- api
- integrations/s3
- models
- repositories
- autorag/bff
- internal
- api
- integrations/s3
- models
- repositories
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
247 | 247 | | |
248 | 248 | | |
249 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
250 | 289 | | |
251 | 290 | | |
252 | 291 | | |
| |||
0 commit comments