-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Odd namespace behaviour incluster for kubectl deploy #2745
Comments
@kuuji Thanks for submitting this issue! Yes this does seem odd, and the recommended usage is to use I'll bring this up for discussion to see if we either want to fix this for the simpler cases, or officially deprecate the flag in favor of |
@lizardruss I cannot use I don't think the flag should be deprecated if there is no other way for incluster. edit: I did try that as well ;) |
@kuuji Ah I see, I skimmed over the incluster part. I'm surprised that setting the |
@lizardruss I found a bit of time to dig and got to the bottom of it. I'll put up a fix today or tomorrow. the TLDR; is it's because of the way the manifests are rendered in https://github.com/devspace-sh/devspace/blob/main/pkg/devspace/deploy/deployer/kubectl/builder.go#L111-L166 when incluster. This is specifically because we run This doesn't affect inlineManifests, because we don't use kubectl to render that. |
What happened?
I'm trying to deploy a preview using devspace in CI (runners running in kubernetes) in a different namespace than where devspace is running. This is using the kubectl deploy method.
Despite providing the namespace via an arg ->
devspace deploy -n ci-tplkjs-1
devspace ends up deploying the preview in the same namespace as the runner (ci).There are interesting things to note here and I tried a few things with various level of success.
info Using namespace 'ci-tplkjs-1'
but ends up creating in namespaceci
namespace: ci-tplkjs-1
in the deployment definition of devspace doesn't seem to helpci
for the namespace (not incluster)applyArgs
andcreateArgs
also worksWhat did you expect to happen instead?
setting namespace via
devspace deploy -n
should be enough to pass down to the manifests when running incluster.How can we reproduce the bug? (as minimally and precisely as possible)
For this you need
Local Environment:
devspace --version
] v6.3.0Kubernetes Cluster:
Anything else we need to know?
Initially I thought this was the reason https://github.com/devspace-sh/devspace/blob/main/pkg/devspace/kubectl/util/util.go#L31
but according to https://github.com/devspace-sh/devspace/blob/main/pkg/devspace/kubectl/util/util.go#L35-L37 it should only override it if the namespace was empty and it shouldn't be by that point.
I'm down to look deeper into this, I didn't get a chance yet and thought to post here first in case maybe this is intended?
The text was updated successfully, but these errors were encountered: