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

Streaming events for pod with container not initialized #826

Open
nitreb opened this issue Jun 27, 2024 · 1 comment
Open

Streaming events for pod with container not initialized #826

nitreb opened this issue Jun 27, 2024 · 1 comment

Comments

@nitreb
Copy link

nitreb commented Jun 27, 2024

Hi,

We have trouble getting logs from the api/my-lab/app/logs endpoint, where the targeted pod has multiple containers, and one of them is not yet initialized. We get a error 500 and the onyxia API pod logs:

io.fabric8.kubernetes.client.KubernetesClientException: Failure executing: GET at: https://10.254.0.1:443/api/v1/namespaces/user-XXX/pods/marine-plastic-exposure-257003-wh2zv/log?pretty=false. Message: container "copy-output" in pod "marine-plastic-exposure-257003-wh2zv" is waiting to start: PodInitializing. Received status: Status(apiVersion=v1, code=400, details=null, kind=Status, message=container "copy-output" in pod "marine-plastic-exposure-257003-wh2zv" is waiting to start: PodInitializing, metadata=ListMeta(_continue=null, remainingItemCount=null, resourceVersion=null, selfLink=null, additionalProperties={}), reason=BadRequest, status=Failure, additionalProperties={}).

It is understandable as the kubectl logs my_pod command requires to specify a container if my_pod has more than one, or you can also use the --all-containers flag. I tried to look into the fabric8's getLog() method but Java is not my specialty so I have no fix to propose.

Also, please note that it would be very useful for us to have access to every log available even if some containers are not yet initialized.

Thanks in advance!

@fcomte
Copy link
Contributor

fcomte commented Jun 27, 2024

Hello we are already working on the api to better handle :

  • détection of the pod belonging to a helm chart by recursively look into ownerReference to find a controller in thé helm manifest of a release
  • list all thé container to select the good logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants