-
Notifications
You must be signed in to change notification settings - Fork 774
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
feat/cyclops-ui: Add support to fetch Deployment/StatefulSet logs #660
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Sheikh-Abubaker <[email protected]>
Hi @petar-cvit please check this out! |
β¦gsTabsChange Signed-off-by: Sheikh-Abubaker <[email protected]>
@quest-bot loot #257 |
Quest PR submitted!@Sheikh-Abubaker, you are attempting to solve the issue and loot this Quest. Will you be successful? Questions? Check out the docs. |
β¦correct sts api Signed-off-by: Sheikh-Abubaker <[email protected]>
Hey @petar-cvit, just updated the branch and it is now in sync with the main. |
@petar-cvit if you'd like to test the statefulset logs feature, you could utilise Grafana tempo chart: https://github.com/grafana/helm-charts/tree/main/charts/tempo/templates, and any template from the official Cyclops template repository: https://github.com/cyclops-ui/templates could be utilised to test deployment logs. |
Signed-off-by: Sheikh-Abubaker <[email protected]>
Signed-off-by: Sheikh-Abubaker <[email protected]>
Hey @petar-cvit tuned in the feature with the refactored code! |
Hey @petar-cvit looking forward to your review! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Sheikh-Abubaker sorry for the delay. I left two comments
@@ -107,4 +120,259 @@ const StatefulSet = ({ name, namespace, workload }: Props) => { | |||
); | |||
}; | |||
|
|||
export default StatefulSet; | |||
export const StatefulSetLogsButton = ({ name, namespace, workload }: Props) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this component is similar to the DeploymentLogsButton
component. Can we have a single component for the Pod logs button and for the Statefulset/Deployment logs button? You can pass apiVersion and kind to the component if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I created a separate component so that I could export the the button and place it in the column with View Manifest and Restart button, as I saw in some previous PRs which was closed you wanted the logs button in the same column as View Manifest and Restart button
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok for creating a separate component, but we could make just one that can be reused for each resource type
h.router.GET("/resources/deployments/:namespace/:deployment/:container/logs", modulesController.GetDeploymentLogs) | ||
h.router.GET("/resources/statefulsets/:namespace/:name/:container/logs", modulesController.GetStatefulSetsLogs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not sure these two methods work. In the case of multiple pods for a deployment, it will just append logs from one pod to another regardless of the time those were produced at. The logs should be sorted by when they have been produced. Could you also check that out?
Also, we could just have a single endpoint that would be provided with a group
, version
, kind
, name
and namespace
and it could just return all the logs for the requested resource. That way we don't have to duplicate endpoints for Deployments, Statefulsets, Pods...
closes #257
π Description
Test video of Deployment/StatefulSet logs feature:
2024-10-28.17-35-21.mp4
β Checks
βΉ Additional context
Reinstated the Handler functions for Deployment/StatefulSet logs i.e:
Tested the feature with both traditional API call using axios and the existing logstream function successfully.