# Flux Bundle

Generated by AICR v0.14.0

## Prerequisites

- Flux installed on your cluster ([installation guide](https://fluxcd.io/flux/installation/))
- `kubectl` configured for your target cluster
- A Git repository to store this bundle

## Components

| Component | Type | Version | Namespace | Depends On |
|-----------|------|---------|-----------|------------|
| aws-ebs-csi-driver | HelmRelease | 2.59.0 | kube-system | - |
| aws-efa | HelmRelease | v0.5.26 | kube-system | aws-ebs-csi-driver |
| cert-manager | HelmRelease | v1.20.2 | cert-manager | aws-efa |
| nfd | HelmRelease | 0.18.3 | node-feature-discovery | cert-manager |
| nodewright-operator | HelmRelease | v0.15.1 | skyhook | nfd |
| nodewright-customizations | HelmRelease |  | skyhook | nodewright-operator |
| prometheus-operator-crds | HelmRelease | 28.0.1 | monitoring | nodewright-customizations |
| kube-prometheus-stack | HelmRelease | 84.4.0 | monitoring | prometheus-operator-crds |
| gpu-operator | HelmRelease | v26.3.1 | gpu-operator | kube-prometheus-stack |
| k8s-ephemeral-storage-metrics | HelmRelease | 1.19.2 | monitoring | gpu-operator |
| kai-scheduler | HelmRelease | v0.14.1 | kai-scheduler | k8s-ephemeral-storage-metrics |
| kubeflow-trainer | HelmRelease | 2.2.0 | kubeflow | kai-scheduler |
| kubeflow-trainer-post | HelmRelease |  | kubeflow | kubeflow-trainer |
| nvidia-dra-driver-gpu | HelmRelease | 25.12.0 | nvidia-dra-driver | kubeflow-trainer-post |
| nvsentinel | HelmRelease | v1.3.0 | nvsentinel | nvidia-dra-driver-gpu |
| prometheus-adapter | HelmRelease | 5.3.0 | monitoring | nvsentinel |

## Repository Setup

This bundle must be pushed to a Git repository that Flux can access. Some
components are packaged as local Helm charts (with `Chart.yaml` and
`templates/`) that reference a `GitRepository` source included in `sources/`.
Before deploying, either:

- Regenerate the bundle with `--repo` pointing to your GitOps repository:

  ```bash
  aicr bundle -r recipe.yaml -o ./flux-bundle --deployer flux \
    --repo https://github.com/<your-org>/<your-gitops-repo>.git
  ```

- Or manually update `sources/gitrepo-*.yaml` with your repository URL.

## Deployment

The bundle must live at the **root** of the Git repository (or the root of
the branch/path that the `GitRepository` source points to). Local Helm chart
components reference paths relative to the repository root
(e.g., `./nodewright-customizations`).

1. Push this bundle as the repository content:

   ```bash
   cd <your-gitops-repo>
   cp -r /path/to/flux-bundle/* .
   git add . && git commit -m "Add AICR Flux bundle" && git push
   ```

2. Apply the entry-point `GitRepository` and `Kustomization` to your cluster:

   ```yaml
   apiVersion: source.toolkit.fluxcd.io/v1
   kind: GitRepository
   metadata:
     name: aicr-stack
     namespace: flux-system
   spec:
     url: https://github.com/<your-org>/<your-gitops-repo>.git
     ref:
       branch: main
     interval: 10m
   ---
   apiVersion: kustomize.toolkit.fluxcd.io/v1
   kind: Kustomization
   metadata:
     name: aicr-stack
     namespace: flux-system
   spec:
     sourceRef:
       kind: GitRepository
       name: aicr-stack
     path: ./
     prune: true
     interval: 10m
   ```

   Flux reconciles the root `kustomization.yaml`, which expands all
   namespace manifests, Helm sources, and HelmRelease CRs automatically.

3. Monitor reconciliation:

   ```bash
   flux get kustomizations
   flux get helmreleases -A
   flux get sources helm -A
   ```

## Troubleshooting

- Check Flux logs: `flux logs --all-namespaces`
- Inspect a HelmRelease: `kubectl describe helmrelease <name> -n <namespace>`
- Force reconciliation: `flux reconcile kustomization aicr-stack`
- Suspend/resume: `flux suspend/resume helmrelease <name> -n <namespace>`
