Skip to content

Name the production environments in instance.yaml instead of the literal prod #232

Open

Description

@ephico2real2

Part of #22

What is wanted: a setting that names the production environments of an instance, so that "production" does not depend on the literal name prod. Today four rules apply to the environment named prod only (docs/02, "The names of instances and environments", from #222): no expiry at render (core/render/manifests.py), no prod entry in expiration.yaml (plugins/expiration/rules.py), the start check of core/config.py, and the env/prod/ Kyverno policies (core/validate/__init__.py, _kyverno). A production environment named production or prd gets none of them.

Where: the four sites above, and instance.yaml (examples/instances/*/instance.yaml, deploy/helm/cmapi/values.yaml).

The design to refine: productionEnvironments: [prod] in instance.yaml, with [prod] when the key is absent, so that no instance changes behaviour. The check that each name is in allowedEnvironments applies only when the key is written. When the key is absent, the list is [prod] and is not checked, so an instance that does not serve prod starts as today. The four rules read the list. The prod-only policy folder becomes the folder of the production environments, or the generator of #212 renders it for each one (decide with #212). Precedent: GitLab's environment deployment_tier (development, testing, staging, production, other), guessed from the name unless set (https://docs.gitlab.com/ci/environments/, read on 2026-11-14).

How a test proves it: an instance with allowedEnvironments: [prd] and productionEnvironments: [prd] refuses an expiry in prd, refuses a prd entry in expiration.yaml, and runs the production policies for prd; each test fails before. An instance with no key behaves as today (the current tests pass unchanged), and load_instance on each of examples/instances/{nonprod,staging,prod} with no productionEnvironments key loads (Fable's review of PR #233, F5).

Research mandate: search the primary sources, compare the options (a list, a tier for each environment as GitLab does, or a label on the cluster), choose the industry best practice, and record the choice and its sources.

Class

INV. It adds a setting.

Activity

  1. added
    feature
    class:INV
    status:open
    Backlog
    on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Backlogclass:INVfeaturestatus:open

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions