Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Ephemeral Containers in Running Pods via Python Kubernetes Client 通过Python Kubernetes客户端在运行中的Pods里支持临时容器 #2207

Open
cdxiaodong opened this issue Mar 6, 2024 · 4 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.

Comments

@cdxiaodong
Copy link

Title(标题):
Support for Ephemeral Containers in Running Pods via Python Kubernetes Client

通过Python Kubernetes客户端在运行中的Pods里支持临时容器

Background(背景):
In the current Kubernetes Python client library, there seems to be no straightforward method to add ephemeral containers to running Pods. The existing method patch_namespaced_pod does not dynamically create an ephemeral container in the running Pods as expected. This feature is crucial for debugging purposes and aligns with Kubernetes' evolving capabilities.

在当前的Kubernetes Python客户端库中,似乎没有直接的方法可以在运行中的Pods中添加临时容器。现有的方法patch_namespaced_pod并不像预期那样在运行中的Pods中动态创建一个临时容器。这个功能对于调试目的非常关键,并且符合Kubernetes不断发展的能力。

Issue(问题):
Currently, attempting to use patch_namespaced_pod to add ephemeral containers does not result in the containers being created in the running Pods. This limits the debugging capabilities and deviates from the expected functionality provided by Kubernetes natively.

当前,尝试使用patch_namespaced_pod来添加临时容器并不会导致在运行中的Pods创建这些容器。这限制了调试能力,并且偏离了Kubernetes原生提供的预期功能。

Conclusion(结论):
It would be beneficial for the Python Kubernetes client to support a dedicated method for adding ephemeral containers to running Pods, similar to the kubectl debug command, enhancing the debugging process and maintaining alignment with Kubernetes' native features.

如果Python Kubernetes客户端能支持一个专门的方法来向运行中的Pods添加临时容器,类似于kubectl debug命令,将有助于增强调试过程,并保持与Kubernetes原生功能的一致性,这将是非常有益的。

image

@cdxiaodong cdxiaodong added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 6, 2024
@roycaihw
Copy link
Member

Is this feature supported on the server side? This doesn't seem to be a client issue.

@abhitrip07
Copy link

+1, I think the author is referring to the kubectl debug API https://kubernetes.io/docs/reference/kubectl/generated/kubectl_debug/

@roycaihw
Copy link
Member

roycaihw commented Apr 1, 2024

/help

Thanks for the explanation. This project is mainly a client library. We didn't aim for feature parity comparing to kubectl which is a CLI tool. We do have some utility methods which support enhanced experience: https://github.com/kubernetes-client/python/tree/master/kubernetes/utils

@k8s-ci-robot
Copy link
Contributor

@roycaihw:
This request has been marked as needing help from a contributor.

Guidelines

Please ensure that the issue body includes answers to the following questions:

  • Why are we solving this issue?
  • To address this issue, are there any code changes? If there are code changes, what needs to be done in the code and what places can the assignee treat as reference points?
  • Does this issue have zero to low barrier of entry?
  • How can the assignee reach out to you for help?

For more details on the requirements of such an issue, please see here and ensure that they are met.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

Thanks for the explanation. This project is mainly a client library. We didn't aim for feature parity comparing to kubectl which is a CLI tool. We do have some utility methods which support enhanced experience: https://github.com/kubernetes-client/python/tree/master/kubernetes/utils

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Apr 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants