Auto-Deploy to Kubernetes should add labels for Project, Group, Environment
As GitLab integration with Kubernetes increases, and based upon Google's recommendation to use a single large k8s cluster for increased efficiencies by better bin-packing, we should start adding some support for this model.
Right now when we are deploying to Kubernetes, through Auto-Deploy for example, we do not label the constructs we create with much identifying information. For example, while we tag a Pod with CI_ENVIRONMENT_SLUG
, we do not tag it with the Project
or Group
that it came from. This information would be important to be able to quickly identify ownership, responsibility, and drive reporting across a cluster which has a number of different Projects and groups involved. Note: CI_ENVIRONMENT_SLUG
is not unique across projects.
The alternative is that we need to clearly state that each project must be in its own namespace as defined in the Kubernetes project settings, and have a unique KUBE_DOMAIN
. If we do this, it would be worthwhile to validate the namespace is unique across GitLab or throw a configuration error. Forks in particular could cause problems, as it defaults to the project name which is not guaranteed to be unique.