Skip to content

Adds support for zonal clusters, for preprod

John Jarvis requested to merge jarv/zonal-pre into master

This is a no-diff change as it only refactors how we set the cluster name and region.

For gitlab-com/gl-infra/delivery#1175 (closed), we will need to create zonal clusters in addition to the regional cluster. This adds the new zonal clusters as new environments in helm, and serves as the model we will use moving forward for other releases.

  • 3 new environments are created in bases/environments.yml that inherit from <env>.yaml
  • A new environment __base is created which is a dummy environment that can be used for yaml merges into other envs. This is useful for variables that will be common to all zonal clusters, across all environments.
  • Because previously, we were basing the cluster name from the environment, it explicitly configures the cluster name
  • Because previously, we were hardcoding the region to us-east1, it explicitly configures the region
  • region is set to either the region or zone, if it is a zonal cluster. This is compatible with the --region option for gcloud
  • We are introducing a new value named env_prefix, for cases like this where we have multiple clusters within an env and we need to use the environment name. Yes, environment becomes very overloaded here ...

Note that in CI, we already set $CLUSTER and $REGION as CI vars, so this feels a bit redundant. We could derive these values from the env, but I think I also like having them in environments.yaml. One option, if we want a SSOT for this, would be to parse environments.yml in cluster-init-before-script.yml which sets up cluster access for CI.

Edited by John Jarvis

Merge request reports