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

[beta.2] Streaming logs from pods (backend) #83

Closed
sunguroku opened this issue Oct 23, 2020 · 3 comments
Closed

[beta.2] Streaming logs from pods (backend) #83

sunguroku opened this issue Oct 23, 2020 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@sunguroku
Copy link
Collaborator

Stream live logs from pods within a chart using k8s go client informer

@sunguroku sunguroku added the enhancement New feature or request label Oct 23, 2020
@sunguroku sunguroku added this to To do in Porter Roadmap via automation Oct 23, 2020
@sunguroku sunguroku self-assigned this Oct 23, 2020
@sunguroku sunguroku moved this from To do to In progress in Porter Roadmap Oct 23, 2020
@sunguroku sunguroku added this to the Beta 2 Release milestone Oct 23, 2020
@sunguroku
Copy link
Collaborator Author

sunguroku commented Oct 23, 2020

There are two different views for the logs: abstracted and "advanced devops" views. The abstracted view is 1) for the PaaS users to view logs from Porter's pre-defined template charts 2) "non-devops" application developers to see logs from custom charts that a mature organization would use.

The "advanced devops" view must show logs without any abstraction, in the style of typical k8s IDE's like Lens/Octant. This means logs from every pod is streamed regardless of its election status (i.e. primary or not). In the abstracted view, Porter must intelligently determine which pod in the chart output logs that are relevant - in the case of templates we provide, this is trivial. For custom charts, it requires a few opinionated rules to display logs in a generalizable way.

  1. The logs from all pods, regardless of the type of their controller-parents, are displayed. (i.e. Deployment, StatefulSet, Job, DaemonSet)
  2. Per each controller-parent, only the logs from the primary pod is displayed.
  3. For pods with multiple containers, logs from all containers are collated with container's name as prefix (ex: [mongo-sidecar]

For most of the templates we provide, log display will simply have one panel for the primary pod from a Deployment or StatefulSet. Applying the above rules for a custom chart, however, means there can be multiple log panels per chart in the abstracted view.

@sunguroku
Copy link
Collaborator Author

sunguroku commented Oct 25, 2020

note: get logs by finding pods with label chart={chart name} instead of using namespace and pod name. Stream logs from all pod replicas for abstracted view instead of just primary (showing logs from each "pod" is common with horizontally-scaling of most PaaS's like Heroku: https://www.heroku.com/dynos/scaling)

@sunguroku
Copy link
Collaborator Author

This feature is finished in beta.2.log-streaming other than additional styling.

Porter Roadmap automation moved this from In progress to Done Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
No open projects
Development

No branches or pull requests

2 participants