diff --git a/stack_orchestrator/deploy/k8s/deploy_k8s.py b/stack_orchestrator/deploy/k8s/deploy_k8s.py index ac4acf7e..4a21d385 100644 --- a/stack_orchestrator/deploy/k8s/deploy_k8s.py +++ b/stack_orchestrator/deploy/k8s/deploy_k8s.py @@ -833,16 +833,11 @@ class K8sDeployer(Deployer): actual_cluster = create_cluster(self.kind_cluster_name, kind_config) if actual_cluster != self.kind_cluster_name: self.kind_cluster_name = actual_cluster - # Only load locally-built images into kind - local_containers = self.deployment_context.stack.obj.get("containers", []) - if local_containers: - local_images = { - img - for img in self.cluster_info.image_set - if any(c in img for c in local_containers) - } - if local_images: - load_images_into_kind(self.kind_cluster_name, local_images) + # Pre-load images into kind so pods can use them with + # imagePullPolicy: IfNotPresent before the registry is consulted. + images_to_preload = set((self.image_overrides or {}).values()) + if images_to_preload: + load_images_into_kind(self.kind_cluster_name, images_to_preload) elif self.is_kind(): # --skip-cluster-management (default): cluster must already exist. # Without this check, connect_api() below raises a cryptic