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

Adding Support For Namespace Level Recommendations #1221

Merged

Conversation

shekhar316
Copy link
Contributor

Description

This PR adds the necessary Java classes to support namespace-level metrics storage within the kubernetes object. Currently, k8sObj manages container-level metrics data through the containerData class. To extend this functionality to namespace-level queries, we need to generate nameSpaceData class. This PR implements these new classes, enabling k8sObj to store and manage namespace metrics data effectively.

Namespace JSON Obj:

{
    "type": "deployment",
    "name": "tfb-qrh-deployment",
    "namespace": "default",
    "namespace_metrics": [
        {
            "name": "cpuRequest",
            "results": {
                "value": 1.1,
                "format": "cores"
            }
        },
        {
            "name": "cpuLimit",
            "results": {
                "value": 0.5,
                "format": "cores"
            }
        },
        {
            "name": "cpuUsage",
            "results": {
                "aggregation_info": {
                    "min": 0.14,
                    "max": 0.84,
                    "avg": 0.12,
                    "format": "cores"
                }
            }
        },
        {
            "name": "cpuThrottle",
            "results": {
                "aggregation_info": {
                    "max": 0.09,
                    "avg": 0.045,
                    "format": "cores"
                }
            }
        },
        {
            "name": "memoryRequest",
            "results": {
                "value": 50.12,
                "format": "MiB"
            }
        },
        {
            "name": "memoryLimit",
            "results": {
                "value": 100,
                "format": "MiB"
            }
        },
        {
            "name": "memoryUsage",
            "results": {
                "aggregation_info": {
                    "min": 50.6,
                    "max": 198.5,
                    "avg": 40.1,
                    "format": "MiB"
                }
            }
        },
        {
            "name": "memoryRSS",
            "results": {
                "aggregation_info": {
                    "min": 50.6,
                    "max": 123.6,
                    "avg": 31.91,
                    "format": "MiB"
                }
            }
        }
    ]
}

Type of change

  • Bug fix
  • New feature
  • Docs update
  • Breaking change (What changes might users need to make in their application due to this PR?)
  • Requires DB changes

How has this been tested?

On minikube with kruize-demos

Test Configuration

  • Kubernetes clusters tested on: minikube

Checklist 🎯

  • Followed coding guidelines
  • Comments added
  • Dependent changes merged
  • Documentation updated
  • Tests added or updated

Additional information

NA

@shekhar316 shekhar316 changed the base branch from mvp_demo to 202407-hackathon July 22, 2024 08:31
@shekhar316 shekhar316 self-assigned this Jul 22, 2024
@shekhar316 shekhar316 added local_monitoring kruize-local Tag for mentioning all the PR's and issues raised which covers the kruize local monitoring usecase labels Jul 22, 2024
@msvinaykumar
Copy link
Contributor

@shekhar316 please resolve conflicts

@shekhar316 shekhar316 changed the title [WIP] Adding Objects for Namespace Data Adding Support For Namespace Level Recommendations Jul 25, 2024
@chandrams
Copy link
Contributor

@shekhar316 - I have merge a few PRs into hackathon branch, can you please rebase yours and resolve the conflicts.

@chandrams chandrams merged commit 1a147c3 into kruize:202407-hackathon Jul 31, 2024
1 of 3 checks passed
@shekhar316 shekhar316 added this to the Kruize 0.0.24_rm Release milestone Jul 31, 2024
@shekhar316 shekhar316 removed this from the Kruize 0.0.24_rm Release milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kruize-local Tag for mentioning all the PR's and issues raised which covers the kruize local monitoring usecase local_monitoring remote_monitoring
Projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants