From the following documentation (Project-level Kubernetes clusters (certificate-based) (DEPRECATED) | GitLab), my understanding is that I am supposed to be able to override KUBE_NAMESPACE in order to use my own namespace naming scheme. I have tried to set KUBE_NAMESPACE both through CI/CD Settings UI and directly in gitlab-ci.yml without any success. kubectl commands are applied to auto-generated project namespace instead.

I have tried reading all the issues regarding that matter and after a couple of hours, I’m completely at lost on if this is working, should be working, or will be wording. Is the documentation somewhat misleading? Why would one want to override KUBE_NAMESPACE if it’s not taken into account within gitlab?

Basic use case is an application composed of several gitlab projects. It makes senses to deploy the different parts (projects) in the same namespace. Is there any practical solution to this problem?

1 Like

I was wondering about the exact same thing. The service account that gets created doesn’t use $KUBE_NAMESPACE variable, making it impossible to deploy to a different namespace using the auto configured account

I opened an issue on that mater.
I’m really surprised that this is indeed not possible and that there isn’t some part of the documentation that addresses this issue.
Normally there should be hundreds of people requesting this feature to be available … There is something I must be missing.