Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Allow compose exec to accept a specific instance in kube backend#2076

Merged
aiordache merged 1 commit intodocker-archive:mainfrom
mikesir87:allow-exec-to-direct-instance
Sep 28, 2021
Merged

Allow compose exec to accept a specific instance in kube backend#2076
aiordache merged 1 commit intodocker-archive:mainfrom
mikesir87:allow-exec-to-direct-instance

Conversation

@mikesir87
Copy link
Copy Markdown
Contributor

What I did

This PR provides the ability to perform a docker compose exec <pod-name|service-name> in the kube context and serves as an implementation of #1920. It looks at the requested name to see if it matches a pod name and exec's to it if a match is found. Otherwise, it falls back to the current implementation where it finds a matching pod by service.

The big reason to do this is to allow teams to stay within the compose tooling and exec into specific instances. In a normal Docker context, a user can simply use docker exec. But, that doesn't work in a kube context. They can look at logs to potentially find a problem, but have to switch to another tool to exec to the specific instance they want. And having to switch to kubectl and making sure you're in the right context/namespace... would be nice to just make it easier. 😄

Outstanding questions

  • I noticed that the ACI and ECS integrations currently don't support exec. No need to update those. But, does it make sense to update the Docker context exec as well to let you specify a specific instance you get from docker compose ps?
  • What CLI/web docs can/should be updated, especially if the main context is to be updated.

Related issue

Issue #1920

This resolves docker-archive#1920

Signed-off-by: Michael Irwin <mikesir87@gmail.com>
@github-actions github-actions Bot added the kube Kubernetes backend label Sep 15, 2021
Copy link
Copy Markdown
Contributor

@aiordache aiordache left a comment

Choose a reason for hiding this comment

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

Thank you! Sorry for the delay 😅

@aiordache aiordache merged commit e54e9ec into docker-archive:main Sep 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

kube Kubernetes backend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants