Skip to content

feat: Add Flux CD provider for service topology and alert integration#4721

Merged
talboren merged 46 commits intokeephq:mainfrom
Kunal-Darekar:feature/fluxcd-provider
May 22, 2025
Merged

feat: Add Flux CD provider for service topology and alert integration#4721
talboren merged 46 commits intokeephq:mainfrom
Kunal-Darekar:feature/fluxcd-provider

Conversation

@Kunal-Darekar
Copy link
Copy Markdown
Contributor

This PR adds a new provider for Flux CD, similar to the existing ArgoCD provider. Flux CD is a GitOps tool for Kubernetes that provides continuous delivery through automated deployment, monitoring, and management of applications.

Features Implemented

Topology Integration

  • Pull topology data from Flux CD resources (GitRepositories, HelmRepositories, Kustomizations, HelmReleases)
  • Create a graph of services with proper dependencies
  • Categorize resources as "source" or "deployment"

Alert Integration

  • Pull alerts from Kubernetes events related to Flux CD controllers
  • Pull alerts from resource status conditions (non-ready resources)
  • Determine alert severity based on event reason
  • Provide detailed alert information

Authentication Options

  • Support for kubeconfig file content
  • Support for API server URL and token
  • Support for in-cluster configuration
  • Support for default kubeconfig file

Provider Metadata

  • Get Flux CD version
  • Get installed controllers
  • Get resource counts

Implementation Details

  • Created a new provider class FluxcdProvider that extends BaseTopologyProvider
  • Implemented authentication with Kubernetes API
  • Implemented methods to get Flux CD resources (GitRepositories, Kustomizations, HelmReleases)
  • Implemented the pull_topology method to create a topology map
  • Implemented the get_alerts method to pull alerts from Flux CD
  • Added comprehensive error handling and logging
  • Added unit tests for all functionality
  • Added documentation

Documentation

  • Added a README.md file with comprehensive documentation
  • Added a documentation file for the Keep documentation site

Testing

  • Added unit tests for all functionality
  • Tested with a local Kubernetes cluster running Flux CD

/fixes #4632
/claim #4632

@vercel
Copy link
Copy Markdown

vercel bot commented May 7, 2025

@Kunal-Darekar is attempting to deploy a commit to the KeepHQ Team on Vercel.

A member of the Team first needs to authorize it.

@dosubot dosubot bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label May 7, 2025
@algora-pbc algora-pbc bot mentioned this pull request May 7, 2025
@CLAassistant
Copy link
Copy Markdown

CLAassistant commented May 7, 2025

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot bot added Documentation Improvements or additions to documentation Feature A new feature hacktoberfest-accepted Provider Providers related issues labels May 7, 2025
@Kunal-Darekar
Copy link
Copy Markdown
Contributor Author

@talboren Could you please review this Flux CD provider implementation when you have a moment? Thanks!

@talboren
Copy link
Copy Markdown
Member

talboren commented May 7, 2025

@talboren Could you please review this Flux CD provider implementation when you have a moment? Thanks!

The implementation looks good! but there are still failing tests, could you please fix them? I think @Kiryous and @Matvey-Kuk can help you with the test-workflow-examples and test-docs, respectively, if you need help.

@Kunal-Darekar
Copy link
Copy Markdown
Contributor Author

Hey @talboren , Thanks for the feedback! I've fixed the failing tests — please have a look when you get a chance. Let me know if anything else needs adjusting.

@vercel
Copy link
Copy Markdown

vercel bot commented May 8, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
keep ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 22, 2025 6:35am

@talboren
Copy link
Copy Markdown
Member

talboren commented May 8, 2025

Hey @talboren , Thanks for the feedback! I've fixed the failing tests — please have a look when you get a chance. Let me know if anything else needs adjusting.

@Kunal-Darekar looks like it is still failing..

@Kunal-Darekar Kunal-Darekar force-pushed the feature/fluxcd-provider branch from 981e17f to 80b6252 Compare May 8, 2025 19:41
@Kunal-Darekar Kunal-Darekar requested a review from Matvey-Kuk May 15, 2025 19:51
@shahargl
Copy link
Copy Markdown
Member

@Kiryous @Kunal-Darekar is it ready?

talboren

This comment was marked as outdated.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 19, 2025
Copy link
Copy Markdown
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

1 comment to be fixed.

@dosubot dosubot bot removed the lgtm This PR has been approved by a maintainer label May 19, 2025
@codecov
Copy link
Copy Markdown

codecov bot commented May 19, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 30.77%. Comparing base (7d126de) to head (658379c).
Report is 15 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #4721       +/-   ##
===========================================
- Coverage   46.14%   30.77%   -15.38%     
===========================================
  Files         165       93       -72     
  Lines       17428    11007     -6421     
===========================================
- Hits         8043     3387     -4656     
+ Misses       9385     7620     -1765     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Kunal-Darekar Kunal-Darekar requested a review from talboren May 20, 2025 11:29
Copy link
Copy Markdown
Member

@talboren talboren left a comment

Choose a reason for hiding this comment

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

LGTM!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label May 22, 2025
@talboren talboren dismissed Matvey-Kuk’s stale review May 22, 2025 06:31

not relevant

@talboren talboren merged commit b5d3713 into keephq:main May 22, 2025
18 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🎉 Fantastic work @Kunal-Darekar! Your very first PR to keep has been merged! 🎉🥳

You've just taken your first step into open-source, and we couldn't be happier to have you onboard. 🙌
If you're feeling adventurous, why not dive into another issue and keep contributing? The community would love to see more from you! 🚀

For any support, feel free to reach out on the community: https://slack.keephq.dev. Happy coding! 👩‍💻👨‍💻

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

Labels

🙋 Bounty claim Documentation Improvements or additions to documentation Feature A new feature hacktoberfest-accepted lgtm This PR has been approved by a maintainer Provider Providers related issues size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🔌 Provider]: Flux CD

6 participants