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

# Argo CD and Flux

> Run koperator under Argo CD or Flux, keep the install key out of git, and resolve drift between koperator and another tool.

You can install and upgrade koperator with Argo CD, Flux or `helm template`. These tools change
what koperator can check at install time and whether its uninstall hook runs, so read the
differences below before you hand koperator to one of them.

## Install-time checks that do not run

These tools render the chart without access to the cluster, so three install-time checks do not
run: the check that names the holder of a namespace claim, the check that each namespace exists, and
the check for an existing KEDA. The claim hook
Job still refuses a claimed namespace, and its log names the holder. Do not set `keda.enabled` if
the cluster already runs KEDA.

* Argo CD runs the claim hook as a PreSync hook. It cannot release a namespace you remove from
  `namespaces`; the hook log prints the `kubectl delete lease` command to run.
* These tools can skip the uninstall hook when you remove the app. Then no policy is applied, the
  agents keep running, the claims stay, and the Komodor Agentic Operation Platform (KAOP) shows the
  deploy target as disconnected. Delete the claims with the commands in [Uninstall without the
  hook](https://docs.komodor.com/manage-your-agents/build/koperator/uninstall.md#uninstall-without-the-hook).
* To delete an agent's objects by hand, select them by the agent's label. `<agent>` is the name of
  the agent's Deployment. Its revisions carry `agentops.komodor.io/revision-of=<agent>` instead:

  ```sh theme={null}
  kubectl -n <namespace> delete deployment,service,configmap,secret,serviceaccount,scaledobject,triggerauthentication \
    -l agentops.komodor.io/agent-id=<agent>
  ```

## Keep the install key out of git

Create the `koperator-<name>-credential` Secret with Sealed Secrets, External Secrets Operator or
SOPS, and pass only its name in `credential.existingSecret`.

## When something else changes an agent

Koperator watches the objects it applied. When `kubectl edit`, `kubectl scale`, or an Argo CD or
Flux sync changes a field that koperator applied, koperator applies its version again. After three
reverts in ten minutes it stops, leaves the agent as the other tool set it, and KAOP shows
`drift_conflict` with the name of that tool. To resolve it, remove the agent from the other tool,
then choose **Retry** on the agent's **Deployment** panel. Any new change, a Stop included, also ends
the conflict.

A change to a field koperator does not set is not drift, for example the annotation that
`kubectl rollout restart` adds, or KEDA scaling a scale-to-zero agent.

## Next steps

> [card] [Adopt agents installed with Helm](https://docs.komodor.com/manage-your-agents/build/koperator/adopt-helm-agents.md)
>
> Remove an agent from your GitOps tool before you adopt it.

> [card] [Upgrade koperator](https://docs.komodor.com/manage-your-agents/build/koperator/upgrade.md)
>
> Move to a new koperator version.


## Related topics

- [Uninstall koperator](https://docs.komodor.com/manage-your-agents/build/koperator/uninstall.md)
- [Adopt agents installed with Helm](https://docs.komodor.com/manage-your-agents/build/koperator/adopt-helm-agents.md)
- [Koperator](https://docs.komodor.com/manage-your-agents/build/koperator/overview.md)
- [Deploy a self-hosted agent](https://docs.komodor.com/manage-your-agents/build/deploy-a-self-hosted-agent.md)
- [Declaring resources](https://docs.komodor.com/security-and-governance/identity-and-access/declaring-resources.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.