Skip to content

Helm install via yaml and node management #184

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

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

Himanshukrojha
Copy link

  • Helm Chart Installation via YAML:

Adds support for installing Helm charts using YAML manifests, improving flexibility for Kubernetes resource management.

  • Node Management Enhancements:

Updates and refines node management capabilities, including improved tools for node operations and better integration with the unified kubectl command set.

-fixed top command usage

Copy link
Owner

@Flux159 Flux159 left a comment

Choose a reason for hiding this comment

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

Hi, I think that this is a good PR - requesting changes for 2 reasons:

  • It needs tests for the new tools
  • There's some discussion we should have around helm_template_install specifically because it's kinda a duplicate tool to fix errors in regular helm_install?

CC @rr-paras-patel - any comments around the cleanup & node_management tools?


export const helmTemplateApplySchema = {
name: "helm_template_apply",
description: "Install a Helm chart using template generation and kubectl apply (bypasses authentication issues)",
Copy link
Owner

Choose a reason for hiding this comment

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

I'm wondering if this description should be a bit more descriptive for an LLM - "Install a Helm chart using template generation and kubectl apply. Attempt to use this if helm_install has authentication issues or errors".

The other thing is if it would be better to replace the regular helm_install instead of having a new tool that essentially does the same thing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

- `kubectl_generic`: General kubectl command access (may include destructive operations)

### Helm Template Apply Tool
Copy link
Owner

@Flux159 Flux159 Jul 14, 2025

Choose a reason for hiding this comment

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

I feel like this should be in some docs/helm_install.md and docs/cleanup_pods.md file (readme is already pretty long & describing every tool in the readme itself might be excessive)


#### Usage Examples

**1. List all nodes:**
Copy link
Collaborator

Choose a reason for hiding this comment

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

existing kubectl_get cover this operation.

src/index.ts Outdated
);
}

case "cleanup_pods": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

existing kubectl_delete method should cover this. and LLM should be able to pass required params.

}
};

const getProblematicPods = (namespace: string, allNamespaces: boolean = false): { [key: string]: string[] } => {
Copy link
Collaborator

@rr-paras-patel rr-paras-patel Jul 15, 2025

Choose a reason for hiding this comment

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

Technically LLM should be able to filter such problematic pods instead of dedicated tool.


export const helmTemplateApplySchema = {
name: "helm_template_apply",
description: "Install a Helm chart using template generation and kubectl apply (bypasses authentication issues)",
Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

@rr-paras-patel rr-paras-patel requested a review from Copilot July 15, 2025 04:51
Copilot

This comment was marked as outdated.

@Himanshukrojha
Copy link
Author

Hi @Flux159 and @rr-paras-patel ,
Thanks for the review and feedback , I will make the required changes.

FYI for : "here's some discussion we should have around helm_template_install specifically because it's kinda a duplicate tool to fix errors in regular helm_install?"

  • It removes dependency of kubeconfig api version mismatch when installing some helm charts , so should I merge this new helm installation via yaml step into old one ?

@Flux159
Copy link
Owner

Flux159 commented Jul 15, 2025

@Himanshukrojha

It removes dependency of kubeconfig api version mismatch when installing some helm charts , so should I merge this new helm installation via yaml step into old one ?

Couldn't it just be an optional argument for helm_install then? Just have two different codepaths in that tool based on the argument

@Himanshukrojha
Copy link
Author

@Himanshukrojha

It removes dependency of kubeconfig api version mismatch when installing some helm charts , so should I merge this new helm installation via yaml step into old one ?

Couldn't it just be an optional argument for helm_install then? Just have two different codepaths in that tool based on the argument

Hi @Flux159 , yes I will do the changes accordingly.

Himanshukrojha added a commit to Himanshukrojha/mcp-server-kubernetes that referenced this pull request Jul 21, 2025
…m-operations, improve cleanup-pods parsing, add comprehensive tests and documentation
@Himanshukrojha Himanshukrojha force-pushed the helm-install-via-yaml-and-node-management branch from e90a22d to c62a50b Compare July 21, 2025 11:43
Copy link
Collaborator

@rr-paras-patel rr-paras-patel left a comment

Choose a reason for hiding this comment

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

please address comments

@Himanshukrojha
Copy link
Author

please address comments

Hi @rr-paras-patel ,
Now I have , Merged helm-template-apply into helm-operations.ts as optional parameter.
Created separate documentation files and moved detailed docs out of README.
Removed redundant "list" operation from node-management tool.
Deleted cleanup_pods tool entirely, functionality covered by kubectl_get + kubectl_delete also updated readme regarding it.

@Himanshukrojha
Copy link
Author

I have now ,

  • Added Helm installation step in workflow
  • Fixed JSON response format
  • Fixed schema validation and added Helm availability check

@rr-paras-patel rr-paras-patel requested a review from Copilot August 18, 2025 03:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds Helm chart installation via YAML manifests and comprehensive node management capabilities to enhance Kubernetes resource management and maintenance operations.

  • Introduces template-based Helm chart installation that bypasses authentication issues by using helm template + kubectl apply instead of direct helm install
  • Adds comprehensive node management tool for cordoning, draining, and uncordoning operations with safety features
  • Updates existing Helm operations with improved error handling and flexible installation modes

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
tests/node-management.test.ts Complete test suite for node management operations with schema validation and safety feature testing
tests/helm.test.ts Enhanced integration tests with Helm availability checking and improved error handling with debug output
tests/helm-operations.test.ts Unit tests for Helm operations schemas with parameter validation and template mode testing
src/tools/node-management.ts New comprehensive node management tool with cordon, drain, uncordon operations and safety controls
src/tools/helm-operations.ts Enhanced Helm operations with template mode support and improved error handling
src/models/helm-models.ts Updated Helm models to support new optional parameters and error states
src/index.ts Integration of new node management tool into the main server
docs/node-management.md Complete documentation for node management operations and safety features
docs/helm-install.md Documentation for enhanced Helm installation capabilities including template mode
README.md Updated documentation with new features and comprehensive usage examples
.github/workflows/ci.yml Added Helm installation to CI pipeline for testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Himanshukrojha and others added 6 commits August 18, 2025 12:51
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Himanshukrojha
Copy link
Author

Hi @rr-paras-patel , the above suggestions made by copilot were very minor changes so I have commited them directly .

@Himanshukrojha
Copy link
Author

Hi @rr-paras-patel @Flux159 , Please review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants