Skip to content

Split CRDs into a different chart so they could be fully managed by helm #252

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 4 commits into
base: main
Choose a base branch
from

Conversation

gossion
Copy link

@gossion gossion commented Apr 18, 2025

This pull request introduces the changes to the Helm chart structure and CLI commands for managing the Kagent application. The primary goal is to separate the Kagent Custom Resource Definitions (CRDs) into their own Helm chart, improving modularity, version control, and adherence to Helm best practices. Additionally, the CLI commands for installation and uninstallation have been updated to align with this new structure.

original helm release:

kagent-$version # including kagent and CRDs but CRDs are not fully managed by helm, so CRDs are not delete when uninstall helm

new helm releases:

kagent-crds-$version # fully managed by helm
kagetn-$version

It will also fix #234. Note: For the existing old CRDs deployed by old helm chart:

agents.kagent.dev
modelconfigs.kagent.dev
teams.kagent.dev
toolservers.kagent.dev

users need to delete those resources manually so the next helm install could use the separated CRDs chart.

@EItanya
Copy link
Contributor

EItanya commented Apr 18, 2025

Hi @gossion, thanks so so much for the contribution. I kicked off CI, and will hopefully have a chance to review later today :)

Copy link
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

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

Changes look great to me, looks like there's a merge conflict

.PHONY: helm-publish
helm-publish: helm-version
helm push kagent-crds-$(VERSION).tgz oci://ghcr.io/kagent-dev/kagent/helm
Copy link
Contributor

Choose a reason for hiding this comment

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

Note to self: This may fail the release since the OCI repo won't exist beforehand, I can solve that if this happens.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks @EItanya , please help if that happen.

Comment on lines +64 to +72
if strings.Contains(output, "exists and cannot be imported into the current release") {
s.Stop()
c.Println("Warning: CRDs already exist but not managed by helm, you might need to delete them manually to make them fully managed by helm.")
s.Start()
} else {
c.Println("Error installing kagent-crds:", output)
return
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a requirement, but since we are in a repl anyway we could offer to do this for the user.

Copy link
Author

Choose a reason for hiding this comment

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

That is a good point.

Here is what I am thinking:

  1. InstallCmd - still succeeds (to avoid breaking change) when CRDs are not managed by helm, but warns that users need to manually delete CRDs or run uninstall cmd to delete CRDs.
  2. UninstallCmd - adding steps in uninstall to delete CRDs (by kubctl?) if helm release not found but CRDs are there.

how do you think?

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.

old CRD versions are kept around when you run kagent uninstall
2 participants