Skip to content

[cmd/k8s] send install namespace to the onboarding manifest endpoint#87

Closed
dilyevsky wants to merge 1 commit into
mainfrom
dsky/k8s-install-namespace-param
Closed

[cmd/k8s] send install namespace to the onboarding manifest endpoint#87
dilyevsky wants to merge 1 commit into
mainfrom
dsky/k8s-install-namespace-param

Conversation

@dilyevsky

@dilyevsky dilyevsky commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

What

apoxy k8s install now forwards the --namespace value as a namespace query param to GET /v1/onboarding/k8s.yaml, so the server stamps the install namespace into every namespaced object, the ClusterRoleBinding subject, and the controller's runtime config.

Why

The CLI rewrites namespaced objects to --namespace client-side, but it can't touch the ClusterRoleBinding subject namespace or the ConfigMap's embedded controller config — those are baked into the server-generated manifest. The server previously hardcoded apoxy there, so installing into any other namespace left the ServiceAccount unbound and the controller reading/writing its serving cert, apiz-cert secret, and leader-election lease in apoxy — a startup crashloop (secrets ... is forbidden, lease lock in the wrong namespace).

The server side now accepts the namespace param and de-hardcodes those sites. This change passes the flag through. Empty/default (apoxy) is byte-identical to before.

Test

onboardingPath gains a namespace case; go test ./pkg/cmd/ green.

apoxy k8s install rewrites namespaced objects to --namespace client-side, but
the cosmos-generated manifest hardcoded "apoxy" in the ClusterRoleBinding
subject and the controller's runtime config, which the client rewrite can't
touch. Installing into a non-"apoxy" namespace left the ServiceAccount unbound
and the controller operating in "apoxy" for its secrets and leader-election
lease, crashlooping on forbidden errors.

cosmos now accepts a namespace query param on /v1/onboarding/k8s.yaml and
stamps it into every namespaced object, the CRB subject, and the config. Pass
the --namespace flag through so non-default install namespaces are honored
server-side. Empty/default ("apoxy") is unchanged.
@dilyevsky dilyevsky force-pushed the dsky/k8s-install-namespace-param branch from 6155af9 to fbd69ab Compare June 4, 2026 07:34
@dilyevsky dilyevsky closed this Jun 4, 2026
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