Skip to content

Add support of container specific logs for logs view

What does this MR do and why?

This MR adds support for specifying a container for logs view. The container name should be provided in the URL (container="my-container"). It then gets added to the logs query.

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

No visual changes for logs view, screenshot for reference:

Screenshot_2024-06-06_at_19.25.04

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Integrate k8s cluster and assign the agent to the project (follow this guide)
  2. Navigate to https://gdk.test:3443/<group-name>/<project-name>/-/environments/<environment-id>/k8s/namespace/<namespace-name>/pods/<pod-name>/logs?container=<container-name> (for the counter pod it will be: https://gdk.test:3443/<group-name>/<project-name>/-/environments/<environment-id>/k8s/namespace/default/pods/counter/logs?container=count)
  3. To check running logs you may use the following command to create a pod that logs every second:
kubectl apply -f https://k8s.io/examples/debug/counter-pod.yaml

You can remove it later with kubectl delete pod counter command 4. You can check the counter pod with the following URL: https://gdk.test:3443/<group-name>/<project-name>/-/environments/<environment-id>/k8s/namespace/default/pods/counter/logs

Related to #464031 (closed)

Edited by Anna Vovchenko

Merge request reports