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

# DEMO Install Image Automation Controller

> This guide explains how to upgrade an existing Flux CD installation to include Image Reflector and Image Automation Controllers.

In this guide, you’ll upgrade an existing Flux CD installation to include both the **Image Reflector Controller** and the **Image Automation Controller**. By the end, you’ll verify new deployments, CRDs, and see the updated Git manifests.

***

## 1. Verify Existing Flux Controllers

Ensure you’re working in the `flux-system` namespace and list deployed controllers:

```bash theme={null}
kubectl -n flux-system get deployment
```

Expected output:

```plaintext theme={null}
NAME                    READY   UP-TO-DATE   AVAILABLE   AGE
helm-controller         1/1     1            1           18h
kustomize-controller    1/1     1            1           18h
notification-controller 1/1     1            1           18h
source-controller       1/1     1            1           18h
```

<Callout icon="lightbulb" color="#1CB2FE">
  No image controllers appear yet. You’ll add them in Step 3.
</Callout>

***

## 2. List All Flux Sources

Check which source types are defined in your cluster:

```bash theme={null}
flux get sources all
```

Sample output:

```plaintext theme={null}
NAME                                           SUSPENDED  READY  MESSAGE
ocirepository/7-demo-source-oci-bb-app         False      True   stored artifact
bucket/4-demo-source-minio-s3-bucket-bb-app    False      False  bucket not found
gitrepository/2-demo-source-git-bb-app         False      True   stored artifact
gitrepository/3-demo-source-git-bb-app         False      True   stored artifact
gitrepository/5-demo-source-git-helm-bb-app    False      True   stored artifact
gitrepository/flux-system                      False      True   stored artifact
gitrepository/infra-source-git                 False      True   stored artifact
helmrepository/6-demo-source-helm-bb-app       False      True   stored artifact
```

This confirms you have all standard source types: **Git**, **Helm**, **OCI**, and **Bucket**.

***

## 3. Upgrade Flux to Include Image Controllers

Re-run the Flux bootstrap command with the `--components-extra` flag:

```bash theme={null}
flux bootstrap github \
  --owner=sidd-harth-2 \
  --repository=block-buster \
  --path=flux-clusters/dev-cluster \
  --personal=true \
  --private=false \
  --components-extra="image-reflector-controller,image-automation-controller"
```

<Callout icon="triangle-alert" color="#FF6B6B">
  When prompted, paste your GitHub Personal Access Token.\
  Never share your token publicly or commit it to Git.
</Callout>

Flux will detect existing components and automatically upgrade to add the image controllers.

***

## 4. Confirm New Deployments and CRDs

### 4.1 Check Pods & Deployments

```bash theme={null}
kubectl -n flux-system get pod,deploy
```

Expected snippet:

```plaintext theme={null}
pod/image-automation-controller-xxxxx    1/1   Running   0   30s
pod/image-reflector-controller-xxxxx     1/1   Running   0   30s
...
deployment.apps/image-automation-controller  1/1  1  1  30s
deployment.apps/image-reflector-controller  1/1  1  1  30s
```

### 4.2 List Image CRDs

```bash theme={null}
kubectl get crds | grep image
```

```plaintext theme={null}
imagepolicies.image.toolkit.fluxcd.io
imagerepositories.image.toolkit.fluxcd.io
imageupdateautomations.images.toolkit.fluxcd.io
```

| CRD                                             | Description                           |
| ----------------------------------------------- | ------------------------------------- |
| imagepolicies.image.toolkit.fluxcd.io           | Define rules for selecting new images |
| imagerepositories.image.toolkit.fluxcd.io       | Specify external container registries |
| imageupdateautomations.images.toolkit.fluxcd.io | Automate updates based on policies    |

***

## 5. Review the Updated Flux Component Manifest

Open the generated manifest at `flux-clusters/dev-cluster/flux-components.yaml` and confirm the new controllers are included:

```yaml theme={null}
# This manifest was generated by flux. DO NOT EDIT.
# Flux Version: v0.41.2
# Components: source-controller,kustomize-controller,helm-controller,notification-controller,image-reflector-controller,image-automation-controller
apiVersion: v1
kind: Namespace
metadata:
  name: flux-system
  labels:
    app.kubernetes.io/instance: flux-system
    app.kubernetes.io/part-of: flux
    app.kubernetes.io/version: v0.41.2
...
```

***

## 6. Sync & Review Git Changes

Pull the latest commits to see the diff:

```bash theme={null}
git pull
```

Sample output:

```plaintext theme={null}
Updating 9b16147..03b28c3
Fast-forward
 flux-clusters/dev-cluster/flux-components.yaml       | 1389 +++++...
 flux-clusters/dev-cluster/flux-system/gotk-sync.yaml |    4 +-
 2 files changed, 1390 insertions(+), 3 deletions(-)
```

Great work! You’ve successfully upgraded Flux with the Image Reflector and Image Automation Controllers.

***

## Links and References

* [Flux CD Documentation](https://fluxcd.io/docs/)
* [GitHub Personal Access Tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token)
* [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/gitops-with-fluxcd/module/e4076c7b-6728-412c-b4d7-9316fc346fc5/lesson/5e3a27cd-3176-4c7f-9ca1-d9de7978bc07" />
</CardGroup>
