-
Notifications
You must be signed in to change notification settings - Fork 354
Allow AnalysisTemplate Jobs to run on the destination cluster that the Stage promotes to. #6017
Description
When Kargo promotes Freight through Stages, each Stage knows which cluster it targets. However, this destination cluster context is not available to the verification (AnalysisRun) phase. AnalysisRun Jobs always run on the control plane cluster (or a single globally-configured cluster via ARGO_ROLLOUTS_ANALYSIS_JOB_KUBECONFIG).
Kargo should provide a way to propagate the Stage's destination cluster information to the verification phase, so that Jobs (and the resources they create) land on the correct cluster.
Related issues:
- Verification in sharded environments should use Argo Rollouts in shard cluster #4189
- Support multiple invocations of same AnalysisTemplate with different args #5062
- Targeted namespaces for AnalysisRun Jobs #4559
- Provide a way from within an AnalysisTemplate Job pod to know which promotion / freight is being tested. #5520
Motivation
E2e verification often requires creating and interacting with Kubernetes resources on the actual destination cluster.
For example, verifying that an AWS Load Balancer Controller promotion was successful requires:
- Creating an Ingress resource on the destination cluster
- Verifying that an ALB is actually provisioned
- Running health checks against the provisioned endpoint
- Cleaning up test resources
Today, there is no straightforward way to do this because the Job has no access to the destination cluster context. Users would need to manually inject kubeconfig credentials, which defeats the purpose of Kargo already knowing the promotion target.