Skip to content

kubernetes: generalize deployments configuration

Scott French requested to merge work/swfrench/T370934-mediawiki-deployments into master

Extends DeploymentsConfig to support any number of releases per namespace, with per-release mappings to image flavors.

This implements the format proposed in T370934 to support the PHP 8.1 migration. Highlights:

  • The "releases" field specifies a mapping from release name to image flavor and deployment stage, and will replace "release" and "canary" as they exist today (once the config is migrated).
  • If no image flavor is specified, the top-level one acts as a default, to facilitate deduplication (e.g., between canary and main).
  • The stage field only supports "canaries" for now. We could evolve this if, e.g., there's interest in allowing debug to be release-scoped.

While we still assert that a namespace cannot be present multiple times in config, we no longer explicitly assert that a namespace has only one release among the production and testserver stages.

Stated differently, it's now fine for a namespace to have two or more releases, both of which map to, e.g., the "production" stage.

This does not appear to be assumed anywhere in the kubernetes module at this time, so it should be fine to relax, in contrast to the uniqueness of a given (namespace, release) tuple (which is enforced).

An interesting side-effect of this change is that we now also support canary-only namespaces (there is no plan to make use of that yet).

Note: Both before and after this change, it's possible to configure a canary release in a debug: true namespace, in which case it's ignored.

Bug: T370934

Edited by Scott French

Merge request reports