From 2f4dd4ce121a1d63d4b7b608d615af8129f0890c Mon Sep 17 00:00:00 2001 From: "A. F. Dudley" Date: Tue, 20 Jan 2026 05:57:38 -0500 Subject: [PATCH] Add command/entrypoint support for K8s deployments Docker-compose command and entrypoint are now passed to K8s: - entrypoint -> K8s command (overrides ENTRYPOINT) - command -> K8s args (overrides CMD) Co-Authored-By: Claude Opus 4.5 --- stack_orchestrator/deploy/k8s/cluster_info.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/stack_orchestrator/deploy/k8s/cluster_info.py b/stack_orchestrator/deploy/k8s/cluster_info.py index 088ac748..9489e291 100644 --- a/stack_orchestrator/deploy/k8s/cluster_info.py +++ b/stack_orchestrator/deploy/k8s/cluster_info.py @@ -366,10 +366,22 @@ class ClusterInfo: self.spec.get_image_registry(), self.app_name) if self.spec.get_image_registry() is not None else image volume_mounts = volume_mounts_for_service(self.parsed_pod_yaml_map, service_name) + # Handle command/entrypoint from compose file + # In docker-compose: entrypoint -> k8s command, command -> k8s args + container_command = None + container_args = None + if "entrypoint" in service_info: + entrypoint = service_info["entrypoint"] + container_command = entrypoint if isinstance(entrypoint, list) else [entrypoint] + if "command" in service_info: + cmd = service_info["command"] + container_args = cmd if isinstance(cmd, list) else cmd.split() container = client.V1Container( name=container_name, image=image_to_use, image_pull_policy=image_pull_policy, + command=container_command, + args=container_args, env=envs, ports=container_ports if container_ports else None, volume_mounts=volume_mounts,