[cmd/k8s] send install namespace to the onboarding manifest endpoint#87
Closed
dilyevsky wants to merge 1 commit into
Closed
[cmd/k8s] send install namespace to the onboarding manifest endpoint#87dilyevsky wants to merge 1 commit into
dilyevsky wants to merge 1 commit into
Conversation
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.
6155af9 to
fbd69ab
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
apoxy k8s installnow forwards the--namespacevalue as anamespacequery param toGET /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
--namespaceclient-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 hardcodedapoxythere, so installing into any other namespace left the ServiceAccount unbound and the controller reading/writing its serving cert,apiz-certsecret, and leader-election lease inapoxy— a startup crashloop (secrets ... is forbidden, lease lock in the wrong namespace).The server side now accepts the
namespaceparam and de-hardcodes those sites. This change passes the flag through. Empty/default (apoxy) is byte-identical to before.Test
onboardingPathgains a namespace case;go test ./pkg/cmd/green.