---
title: "Manage part of a shared cluster"
description: "Manage only your team's topics on a shared Kafka cluster, import just that part with --topic, and keep teams apart with tenancy."
url: https://monedula.dev/flock/docs/gitops/how-to/manage-part-of-a-cluster/
---
monedula-gitops manages what your manifests declare and nothing else. On a cluster that other teams, other tools or hand-run scripts also change, you can bring just your part under GitOps: their topics are never diffed, reported as drift or deleted.

## Before you start

- The CLI with a cluster config file, `clusters/prod.yaml` on this page.
- monedula-gitops 1.1.0 or later for the `--topic` and `--exclude-topic` import flags.
- A naming convention that tells your topics apart, such as the prefix `payments.`. Without one, list your topics by name.

## What stays outside your manifests

- **Topics.** `diff`, `apply` and `verify` look only at the topics your manifests name. A topic that exists on the cluster but in no manifest is never reported or changed, and removing a `KafkaTopic` manifest never deletes the topic: with the CLI the topic is simply no longer managed, and with the operator the deletion policy decides ([Delete topics from Kubernetes](/flock/docs/gitops/how-to/delete-topics-from-kubernetes/)).
- **ACLs and role bindings.** Pruning covers only the scope your manifests declare, and only with `--prune` ([Delete resources safely](/flock/docs/gitops/how-to/delete-resources-safely/)). Other principals' ACLs are left alone.
- **Reads.** Each command reads only the kinds your manifests declare, so a credential that can describe only your topics is enough for topic-only manifests.

## Steps

### 1. Import only your topics

```bash
monedula-gitops import cluster --cluster-config-file ./clusters/prod.yaml --output-dir ./imported \
  --topic 'payments.*' --exclude-topic 'payments.tmp*' --skip-users --skip-quotas
```

`--topic` and `--exclude-topic` take glob patterns, the same syntax as the tenancy `prefixes` globs, and both can be repeated. A topic is imported when it matches any `--topic` pattern, or no `--topic` is given, and no `--exclude-topic` pattern. `*` also matches dots, so `payments.*` covers `payments.eu.orders`.

Along with the selected topics, the import takes what belongs to them:

- ACLs on a selected topic. A prefixed ACL comes along when its prefix itself matches, so `payments.` matches `payments.*`, while a broader prefix such as `pay`, which also covers other teams' topics, is left out.
- Group, cluster and other non-topic ACLs, only for principals that hold an ACL on a selected topic. Your consumers' group ACLs come along; an unrelated admin's do not.
- Role bindings, by the same rule: `Topic` bindings by name, other bindings only for principals with a selected `Topic` binding.
- Schema subjects of the selected topics. Subjects of the topics you left out are skipped instead of being reported as unmatched.
- Mirror topics that match the filter.

SCRAM users and quotas are not tied to topics, so the filter does not select them: add `--skip-users` and `--skip-quotas` unless your team owns them. The summary ends with a `Topic filter:` line that counts the topics, ACLs, role bindings and schema subjects the filter left out.

Review the generated files as [Import an existing Kafka cluster](/flock/docs/gitops/how-to/import-an-existing-cluster/#4-finish-the-manifests) describes.

### 2. Keep teams apart on the operator

With the CLI, whoever runs it decides what the manifests contain. With the operator, a tenancy policy on the `KafkaCluster` makes the boundary enforced: a namespace restricted to `payments.` cannot claim any other topic, group or cluster-wide grant ([Enforce tenancy with admission webhooks](/flock/docs/gitops/how-to/enforce-tenancy/)).

## Check it worked

```bash
monedula-gitops verify -f ./imported -R --cluster-config-file ./clusters/prod.yaml   # exits 0: no drift
```

`verify` exits 0 and mentions none of the topics you left out, even though they are still on the cluster.

## Related

- The [import cluster command reference](/flock/docs/gitops/reference/cli/import-cluster/) lists every flag.
- [Detect and fix drift](/flock/docs/gitops/how-to/detect-and-fix-drift/) explains what counts as drift for the resources you manage.