Skip to content

fix(cli): the admin-less install keeps conformity's Role only when the account may grant it - #452

Merged
bmscomp merged 6 commits into
mainfrom
feat/deploy-adminless
Oct 23, 2026
Merged

bmscomp merged 6 commits into
mainfrom
feat/deploy-adminless

Conversation

@bmscomp

@bmscomp bmscomp commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Why

Follow-up to #451. kates deploy --adminless installs Kates with rbac.scope=namespace, whose chart creates a read-only Role in the Kafka namespace for conformity checks. It grants get on kafkas and list on kafkanodepools, pods, persistentvolumeclaims, podmonitors and endpointslices. RBAC lets an account create a Role only for permissions it holds, and the built-in admin role has no PodMonitor reads, so a team account's Kates install could be refused partway through.

What changes

  • Grant check: before installing, kates deploy --adminless asks kubectl auth can-i for each of those reads in the Kafka namespace.
    • All held: the Role is installed and conformity checks work.
    • Any missing: Kates installs with rbac.kafkaNamespaceRole=false. Deploy names the missing reads and prints, before the install and again at the end, the helm template ... | kubectl apply command that an account holding them runs to turn conformity on.
  • Book: the Deployment Guide's "Deploying Without Cluster Admin" explains the check and the handoff command, wrapped under the 90-character fence limit.

Tests

  • TestRunDeploy_AdminlessConformityRoleFollowsTheGrants covers both paths, the --set and the printed command.
  • Local mirror of the triggered CI jobs, all passing:
    • Go: go vet, go test ./..., golangci-lint --new-from-rev=origin/main (0 issues), govulncheck.
    • Scripts: check-cli-style.sh, check-cli-compat.sh, check-book-style.sh.
    • Backend: the full ./mvnw test.
  • gen-version-matrix.sh --check and gen-chart-table.sh --check fail locally only because of a leftover untracked charts/minio directory, which CI's checkout doesn't have.
  • Not run locally: the Quarto render and PDF.
  • CI only (Docker stays off): the *IT tests, native image, Kind integration tests, Docker builds, CodeQL and Trivy.

The branch merged main after #451 squashed its first two commits. Squash with 5f035e5's message.

…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.
…e account may grant it

The kates chart's namespace-scope Role in the Kafka namespace grants get on
kafkas and list on kafkanodepools, pods, persistentvolumeclaims, podmonitors
and endpointslices. RBAC lets an account create a Role only for permissions
it holds, and the built-in admin role has no PodMonitor reads, so a team
account's Kates install could be refused.

`kates deploy --adminless` now asks `kubectl auth can-i` for each of those
reads in the Kafka namespace. When all are held the Role is installed and
conformity checks work. Otherwise Kates installs with
rbac.kafkaNamespaceRole=false, and deploy names the missing reads and prints,
before the install and again at the end, the `helm template ... | kubectl
apply` command an account that holds them runs to turn conformity on.
# Conflicts:
#	cli/cmd/deploy.go
#	cli/cmd/deploy_adminless.go
#	cli/cmd/deploy_adminless_test.go
#	cli/cmd/deploy_components.go
#	docs/book/12-deployment.md
@bmscomp bmscomp changed the title feat(cli): kates deploy detects cluster admin and offers an admin-less profile fix(cli): the admin-less install keeps conformity's Role only when the account may grant it Oct 22, 2026
@bmscomp
bmscomp merged commit 7b33b1e into main Oct 23, 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