environment.kubernetes.namespace does not work with Deployment Boards
Given the following configuration
dev:
stage: deploy
environment:
name: development-1
kubernetes:
namespace: microservice-1
script:
- echo "project = $CI_PROJECT_PATH_SLUG"
- echo "environment = $CI_ENVIRONMENT_SLUG"
- echo "kube_namespace = $KUBE_NAMESPACE"
If I have a deployment with the correct annotations:
Annotations: app.gitlab.com/app: someapp-microservice-1
app.gitlab.com/env: development-1-d1l3ji
inside the namespace: microservice-1
Also the above script prints:
Executing "step_script" stage of the job script
00:01
$ echo "project = $CI_PROJECT_PATH_SLUG"
project = someapp-microservice-1
$ echo "environment = $CI_ENVIRONMENT_SLUG"
environment = development-1-d1l3ji
$ echo "kube_namespace = $KUBE_NAMESPACE"
kube_namespace = microservice-1-development-1-d1l3ji
Job succeeded
The Deploy Board will never find this information because it is looking for the deployment to be in $KUBE_NAMESPACE. And it appears that $KUBE_NAMESPACE is not affected by environment.kubernetes.namespace
at all. The only way the deploy board will show up for that environment is if I have a deployment in the microservice-1-development-1-d1l3ji
namespace.
I can override $KUBE_NAMESPACE in the CI/CD Variables section but again the Deployment Board is unaffected.
If I disable Gitlab-managed cluster
then I can see that kube_namespace = microservice-1
but again the Deployment Board is unaffected. I also see in the deploy job the message: This job is deployed to development-1 using cluster development-1 and namespace microservice-1-development-1-d1l3ji.
even though the output for $KUBE_NAMESPACE was microservice-1
So how do I make Deploy Board work inside of microservice-1
namespace?