Skip to content

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

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

Conversation

Kunal-Darekar
Copy link

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

Copy link

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

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
Author

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

@talboren
Copy link
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
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.

Copy link

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 15, 2025 7:58am

@talboren
Copy link
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 force-pushed the feature/fluxcd-provider branch from a4b2672 to 940c53d Compare May 10, 2025 22:41
Copy link
Contributor

@Matvey-Kuk Matvey-Kuk left a comment

Choose a reason for hiding this comment

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

May I ask you to exclude fixes for docs tests and general tests to the separate PR?

@Kiryous
Copy link
Contributor

Kiryous commented May 15, 2025

hey @Kunal-Darekar! Thank you so much for the thoughtful contribution! Left a few comments, let's address them and merge 🧡

@Kunal-Darekar Kunal-Darekar force-pushed the feature/fluxcd-provider branch 2 times, most recently from e882703 to 74fed44 Compare May 15, 2025 12:01
@Kunal-Darekar Kunal-Darekar requested a review from Kiryous May 15, 2025 15:39
Kunal-Darekar added a commit to Kunal-Darekar/keep that referenced this pull request May 15, 2025
1. Add UTF-8 encoding to file operations in docs_render_provider_snippets.py
2. Normalize path separators for cross-platform compatibility
3. Improve test reliability by increasing sleep time and max attempts
4. Add detailed comments explaining the changes

These changes address the feedback from PR keephq#4721 review.
@Kunal-Darekar Kunal-Darekar requested a review from Matvey-Kuk May 15, 2025 19:51
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 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
5 participants