> ## Documentation Index
> Fetch the complete documentation index at: https://docs.keephq.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Flux CD

> Flux CD Provider enables integration with Flux CD for GitOps topology and alerts.

## Authentication

This provider requires authentication.

* **kubeconfig**: Kubeconfig file content (required: False, sensitive: True)
* **context**: Kubernetes context to use (required: False, sensitive: False)
* **namespace**: Namespace where Flux CD is installed (required: False, sensitive: False)
* **api\_server**: Kubernetes API server URL (required: False, sensitive: False)
* **token**: Kubernetes API token (required: False, sensitive: True)
* **insecure**: Skip TLS verification (required: False, sensitive: False)

Certain scopes may be required to perform specific actions or queries via the provider. Below is a summary of relevant scopes and their use cases:

* **authenticated**: User is Authorized (mandatory)

## In workflows

This provider can be used in workflows.

As "step" to query data, example:

```yaml theme={null}
steps:
    - name: Query fluxcd
      provider: fluxcd
      config: "{{ provider.my_provider_name }}"
      with:
        **_: {value}  # Additional arguments (ignored)
```

As "action" to make changes or update data, example:

```yaml theme={null}
actions:
    - name: Query fluxcd
      provider: fluxcd
      config: "{{ provider.my_provider_name }}"
      with:
        action: {value}  # The action to perform. Supported actions are:
- reconcile: Trigger a reconciliation for a FluxCD resource.
        # Additional arguments for the action.
```

Check the following workflow example:

* [fluxcd\_example.yml](https://github.com/keephq/keep/blob/main/examples/workflows/fluxcd_example.yml)

## Topology

This provider pulls [topology](/overview/servicetopology) to Keep. It could be used in [correlations](/overview/correlation-topology)
and [mapping](/overview/enrichment/mapping#mapping-with-topology-data), and as a context
for [alerts](/alerts/sidebar#7-alert-topology-view) and [incidents](/overview#17-incident-topology).

## Provider Methods

The provider exposes the following [Provider Methods](/providers/provider-methods#via-ai-assistant). They are available in the [AI Assistant](/overview/ai-incident-assistant).

* **get\_fluxcd\_resources** Get resources from Flux CD (, scopes: no additional scopes)

## Overview

Flux CD is a GitOps tool for Kubernetes that provides continuous delivery through automated deployment, monitoring, and management of applications. This provider allows you to integrate Flux CD with Keep to get a single pane of glass for monitoring your GitOps deployments.

## Features

### Topology

The Flux CD provider pulls topology data from the following Flux CD resources:

* GitRepositories
* HelmRepositories
* HelmCharts
* OCIRepositories
* Buckets
* Kustomizations
* HelmReleases

The topology shows the relationships between these resources, allowing you to visualize the GitOps deployment process. Resources are categorized as:

* **Source**: GitRepositories, HelmRepositories, OCIRepositories, Buckets
* **Deployment**: Kustomizations, HelmReleases

### Alerts

The Flux CD provider gets alerts from two sources:

1. Kubernetes events related to Flux CD controllers
2. Status conditions of Flux CD resources (GitRepositories, Kustomizations, HelmReleases)

Alerts include:

* Failed GitRepository operations
* Failed Kustomization operations
* Failed HelmRelease operations
* Non-ready resources

Alert severity is determined based on:

* **Critical**: Events with "failed", "error", "timeout", "backoff", or "crash" in the reason
* **High**: Other warning events
* **Info**: Normal events

## Connecting with the Provider

The Flux CD provider supports multiple authentication methods:

1. **Kubeconfig file content** (recommended for external access)
2. **API server URL and token**
3. **In-cluster configuration** (when running inside a Kubernetes cluster)
4. **Default kubeconfig file** (from \~/.kube/config)

### Using Kubeconfig

```yaml theme={null}
apiVersion: keep.sh/v1
kind: Provider
metadata:
  name: flux-cd
spec:
  type: fluxcd
  authentication:
    kubeconfig: |
      apiVersion: v1
      kind: Config
      clusters:
      - name: my-cluster
        cluster:
          server: https://kubernetes.example.com
          certificate-authority-data: BASE64_ENCODED_CA_CERT
      users:
      - name: my-user
        user:
          token: MY_TOKEN
      contexts:
      - name: my-context
        context:
          cluster: my-cluster
          user: my-user
      current-context: my-context
    context: my-context
    namespace: flux-system
```

### Using API Server and Token

```yaml theme={null}
apiVersion: keep.sh/v1
kind: Provider
metadata:
  name: flux-cd
spec:
  type: fluxcd
  authentication:
    api-server: https://kubernetes.example.com
    token: MY_TOKEN
    namespace: flux-system
```

> Note: Both `api-server` and `api_server` formats are supported for backward compatibility.

### Using In-Cluster Configuration

```yaml theme={null}
apiVersion: keep.sh/v1
kind: Provider
metadata:
  name: flux-cd
spec:
  type: fluxcd
  authentication:
    namespace: flux-system
```

## Comparison with ArgoCD Provider

Keep supports both Flux CD and ArgoCD for GitOps deployments. Here's a comparison of the two providers:

| Feature          | Flux CD                                                         | ArgoCD                   |
| ---------------- | --------------------------------------------------------------- | ------------------------ |
| Topology         | ✅                                                               | ✅                        |
| Alerts           | ✅                                                               | ✅                        |
| Resource Types   | GitRepositories, HelmRepositories, Kustomizations, HelmReleases | Applications, Projects   |
| Authentication   | Kubeconfig, API Server, In-Cluster                              | Username/Password, Token |
| Deployment Model | Kubernetes Controllers                                          | Server + Controllers     |
| UI Integration   | No (CLI only)                                                   | Yes (Web UI)             |

## Related Resources

* [Flux CD Documentation](https://fluxcd.io/docs/)
* [Flux CD GitHub Repository](https://github.com/fluxcd/flux2)
* [Keep Documentation](https://docs.keephq.dev)
