Skip to content

feat(cli): kates deploy detects cluster admin and offers an admin-less profile - #451

Merged
bmscomp merged 2 commits into
mainfrom
feat/deploy-adminless
Oct 22, 2026
Merged

bmscomp merged 2 commits into
mainfrom
feat/deploy-adminless

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

What

kates deploy now checks whether the account is cluster-admin (kubectl auth can-i '*' '*' --all-namespaces) before anything else.

  • Admin: the full profile, unchanged.
  • Not admin: deploy explains why and, on a terminal, offers the admin-less profile. With --yes or without a terminal it stops and prints the --adminless command.
  • No clear answer: full profile, so clusters that work today behave the same.

kates deploy --adminless installs Kafka, Kafka Connect with its PostgreSQL, MirrorMaker 2, Apicurio, Kafka UI and Kates (rbac.scope=namespace) into existing namespaces placed by --topology and the --*-ns flags, as a full deploy does: one per component by default, or all in --namespace (default the kube context's) with --topology single. It skips Strimzi, cert-manager, Kyverno, monitoring, Litmus, node introspection and namespace creation, and refuses --with-chaos, --with-monitoring and the other cluster-scoped toggles.

Before installing it checks that Strimzi's resources exist and that the account may create what the stack needs in each namespace (core resources everywhere, Strimzi's where each is made), and names what is missing per namespace (with the strimzi-kafka-operator.createAggregateRoles=true hint for Strimzi's resources).

Conformity: Kates's read-only Role in the Kafka namespace is installed only when the account holds every read it grants (RBAC refuses a Role for permissions the creator lacks, and the built-in admin role has no PodMonitor reads). Otherwise Kates installs with rbac.kafkaNamespaceRole=false, and deploy names the missing reads and prints the helm template … | kubectl apply command that turns conformity on.

Limits

  • The Kafka version follows the repository's Strimzi pin: the installed operator can't be read without cluster-wide reads. --strimzi-version matches another release.
  • The DNS domain is taken to be cluster.local.
  • Not yet tried live as a namespace-only user.

Docs

10-cli-reference.md (flag + profiles) and a "Deploying Without Cluster Admin" section in 12-deployment.md.

Tests

deploy_adminless_test.go: the can-i answer, the non-admin suggestion with no Helm calls, the admin-less install in both topologies (each release in its namespace, none cluster-scoped, Kates with rbac.scope=namespace), the per-namespace grants, the prerequisite checks, the refused flag. go test ./... in cli/ passes; golangci-lint --new-from-rev=origin/main reports 0 issues.

…s profile

kates deploy asks `kubectl auth can-i '*' '*' --all-namespaces` before
anything else. A cluster admin gets the full profile, as before. Any other
account is told why and, on a terminal, offered the admin-less profile; with
--yes or without a terminal it stops and prints the command.

`kates deploy --adminless` installs Kafka, Kafka Connect with its PostgreSQL,
MirrorMaker 2, Apicurio, Kafka UI and Kates (rbac.scope=namespace) into one
existing namespace (--namespace, default the kube context's). It skips every
cluster-scoped step: Strimzi, cert-manager, Kyverno, monitoring, Litmus, node
introspection and namespace creation, and refuses the flags that ask for them.
Before installing it checks that Strimzi's resources exist and that the
account may create what the stack needs in the namespace, naming what is
missing.

The Kafka version follows the repository's Strimzi pin, since the installed
operator can't be read without cluster-wide reads, and the DNS domain is taken
to be cluster.local.
…spaces

`kates deploy --adminless` no longer forces --topology single. It follows
--topology and the --*-ns flags as a full deploy does, so by default each
component goes into its own namespace (Kafka, Connect, PostgreSQL, Kates,
Kafka UI, MirrorMaker 2), all of which must exist. --topology single still
puts everything in --namespace, or the kube context's namespace.

The prerequisite check now asks, per namespace, for what is created there:
the core resources in every one, and Strimzi's where each is made (the Kafka
cluster, topics and users in the Kafka namespace, Connect's in the Connect
namespace, MirrorMaker 2's in its own). A refusal names its namespace.
@bmscomp
bmscomp merged commit de6babe into main Oct 22, 2026
58 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant