Skip to content

Workflow3 Abandonend Workloads#85

Open
HamzaXgrid wants to merge 2 commits intomasterfrom
xWorkflow3-Abandonend-Workloads
Open

Workflow3 Abandonend Workloads#85
HamzaXgrid wants to merge 2 commits intomasterfrom
xWorkflow3-Abandonend-Workloads

Conversation

@HamzaXgrid
Copy link
Collaborator

@HamzaXgrid HamzaXgrid commented Jul 31, 2024

XkOps

Issue #91

Description

This PR sets up the initial infrastructure and components for the X-Workflow 3, which aims to detect
abandoned workloads in a Kubernetes cluster. The following key components are included in this PR:

Deployment configurations for MongoDB, including a StatefulSet and associated Service.
Writing query pod applicaiton logic in Python.
Creation of a Kubecost query pod to fetch and store abandoned workloads data in MongoDB.
Creating APIs using flask
Deployment of a Flask backend to serve the data and provide an functionality to take necessary actions.
Necessary Roles and RoleBindings

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes (if applicable)
  • Every function, interface, class has a comment describing what it does and input/output parameters

@HamzaXgrid HamzaXgrid self-assigned this Jul 31, 2024
@github-actions
Copy link

github-actions bot commented Jul 31, 2024

Image description CodeRabbit


Uplevel your code reviews with CodeRabbit Pro

CodeRabbit Pro

If you like this project, please support us by purchasing the Pro version. The Pro version has advanced context, superior noise reduction and several proprietary improvements compared to the open source version. Moreover, CodeRabbit Pro is free for open source projects.


return jsonify({"message": "Deployment deletion initiated"})
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code
except pymongo.errors.PyMongoError as e:
return jsonify({"error": f"MongoDB error: {e}"}), 500

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.

return jsonify({"message": "Deployment resizing initiated"})
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code
except pymongo.errors.PyMongoError as e:
return jsonify({"error": f"MongoDB error: {e}"}), 500

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.

return jsonify({"message": "Pod deletion initiated"})
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.
except requests.exceptions.RequestException as e:
return jsonify({"error": f"Error from Robusta API: {e}"}), e.response.status_code
except pymongo.errors.PyMongoError as e:
return jsonify({"error": f"MongoDB error: {e}"}), 500

Check warning

Code scanning / CodeQL

Information exposure through an exception

[Stack trace information](1) flows to this location and may be exposed to an external user.
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 0a0b0eb and 6d1a31e commits.
Files selected (10)
  • xWorkflows/xWorkflow3/README.md (1)
  • xWorkflows/xWorkflow3/backend/Dockerfile (1)
  • xWorkflows/xWorkflow3/backend/app.py (1)
  • xWorkflows/xWorkflow3/backend/requirements.txt (1)
  • xWorkflows/xWorkflow3/kubecost_query_pod/Dockerfile (1)
  • xWorkflows/xWorkflow3/kubecost_query_pod/main.py (1)
  • xWorkflows/xWorkflow3/kubecost_query_pod/requirements.txt (1)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deleteDeployment.py (1)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deletePod.py (1)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/resizeDeploymentReplicaCount.py (1)
Files ignored due to filter (5)
  • xWorkflows/xWorkflow3/manifests/flask-backend.yaml
  • xWorkflows/xWorkflow3/manifests/kubecost-query-pod.yaml
  • xWorkflows/xWorkflow3/manifests/mongodb-statefuleset.yaml
  • xWorkflows/xWorkflow3/manifests/roles-rolebindings.yaml
  • xWorkflows/xWorkflow3/rb-actions/pyproject.toml
Files not summarized due to errors (10)
  • xWorkflows/xWorkflow3/backend/requirements.txt (nothing obtained from openai)
  • xWorkflows/xWorkflow3/backend/Dockerfile (nothing obtained from openai)
  • xWorkflows/xWorkflow3/README.md (nothing obtained from openai)
  • xWorkflows/xWorkflow3/kubecost_query_pod/Dockerfile (nothing obtained from openai)
  • xWorkflows/xWorkflow3/backend/app.py (nothing obtained from openai)
  • xWorkflows/xWorkflow3/kubecost_query_pod/main.py (nothing obtained from openai)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deletePod.py (nothing obtained from openai)
  • xWorkflows/xWorkflow3/kubecost_query_pod/requirements.txt (nothing obtained from openai)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deleteDeployment.py (nothing obtained from openai)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/resizeDeploymentReplicaCount.py (nothing obtained from openai)
Files not reviewed due to errors (10)
  • xWorkflows/xWorkflow3/README.md (no response)
  • xWorkflows/xWorkflow3/kubecost_query_pod/main.py (no response)
  • xWorkflows/xWorkflow3/kubecost_query_pod/Dockerfile (no response)
  • xWorkflows/xWorkflow3/backend/Dockerfile (no response)
  • xWorkflows/xWorkflow3/backend/requirements.txt (no response)
  • xWorkflows/xWorkflow3/backend/app.py (no response)
  • xWorkflows/xWorkflow3/kubecost_query_pod/requirements.txt (no response)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deleteDeployment.py (no response)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/deletePod.py (no response)
  • xWorkflows/xWorkflow3/rb-actions/my_playbook_repo/resizeDeploymentReplicaCount.py (no response)
Review comments generated (0)
  • Review: 0
  • LGTM: 0

Tips

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Pausing incremental reviews

  • Add @coderabbitai: ignore anywhere in the PR description to pause further reviews from the bot.

@HamzaXgrid HamzaXgrid added 2024 Tickets closed in 2024 july labels Aug 1, 2024
@HamzaXgrid HamzaXgrid linked an issue Aug 12, 2024 that may be closed by this pull request
Copy link
Contributor

@SyedMurtazaHassan46 SyedMurtazaHassan46 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Collaborator

@umerxgrid umerxgrid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2024 Tickets closed in 2024 july

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Woekflow-3 Abandoned Workloads

3 participants