Skip to content

Custom container limits (LimitRange) on the custom tier, gated by approval #211

Open

Description

@ephico2real2

What

A custom tier lets a team size its own container limits (the LimitRange), not only its quota. Today NamespaceCreate has no field for them, and the custom tier renders a fixed LimitRange (in dev: container default 500m / 512Mi, default request 100m / 256Mi, max 2 CPU / 4Gi; PVC max 50Gi). A team that needs bigger containers cannot ask.

The owner's decision (2026-11-13)

"we shouldn't block a feature - we should add because what gate a feature is approval right? so as long it is approved we are good to go"

So the API accepts custom limits, and the approval rules are the gate. It does not refuse a value only because a person might not want it; it refuses only what is invalid, and sends the rest to approval.

The design to build (research and refine it, then record the choice)

  1. Request. NamespaceCreate (and the change of an existing namespace) takes an optional limitRange object with tier: custom, for example:
    "limitRange": {
      "container": { "default": {"cpu": "1", "memory": "1Gi"}, "defaultRequest": {"cpu": "250m", "memory": "512Mi"}, "max": {"cpu": "4", "memory": "8Gi"} },
      "pvc": { "max": {"storage": "100Gi"} }
    }
    Keys left out keep the custom tier's values, as the quota does today.
  2. Catalog. tiers.yaml names the sizable limit keys and gives each environment its bounds (min, max, step), the same way it does for sizable quota keys (TierCatalog.quota_for, cmapi/src/cmapi/core/tiers.py).
  3. Validation (invalid, refused with a registered RFC 9457 problem): a key that is not sizable; a value outside the bounds or off its step; defaultRequest above default, or default above max; a container max above the namespace quota it lives in (it could never be scheduled). Each refusal has its problem code in PROBLEMS.
  4. Approval (the gate): a new fact for approval-rules.yaml, for example customLimits (any limit key differs from the tier) and limitIncreasePct, so a rule can require an approver, as quotaIncreasePct does today. The default rules require one approver from the platform group for custom limits; auto-approval never covers them unless a rule says so.
  5. Plan and dry run: the rendered limitrange.yaml shows the values; ?dryRun=true returns it with the approval decision; the Kyverno bundle validates it.
  6. Contract: OpenAPI schema with descriptions and examples, a recorded sample, docs/04 regenerated, the oasdiff gate (an added optional field is not breaking), docs/02 and its live document updated.
  7. Portal: the New namespace tab offers the limits when the tier is custom, faithful to the mockup's style; the Approvals tab shows them.

Research to record, not decided by the owner: whether the same principle ("approval is the gate") should also open the quota keys that the custom tier fixes today (PVCs, storage, load balancers, NodePorts). Load balancers and NodePorts touch network exposure, so give the platform team's view and a recommendation.

Proof

  • Tests that fail before and pass after: each refusal; a valid custom limit goes to pending_approval with the platform slot; an approved one renders the LimitRange; a named tier with limitRange is refused.
  • The service suite, the portal suites, the contract gate and GitHub's six checks green on the exact head.

Activity

  1. added
    feature
    status:open
    Backlog
    on Nov 14, 2026
  2. ephico2real2 commented on Nov 14, 2026

    @ephico2real2
    OwnerAuthor

    Owner decisions, 2026-11-13 (later the same day):

    1. Extra approval for anything beyond the tier. "the workflow is that we need extra approval for custom that is beyond what set in tiers." Any value that differs from (goes beyond) what the namespace's tier sets, on any governed resource (quota keys, LimitRange, and the other overridable objects of Kyverno policies generated from cmapi's configuration, with approved per-namespace overrides #212), adds an approval slot on top of the normal rule for that request. Express it in approval-rules.yaml as a fact (for example beyondTier: true, with the list of keys) that each environment's rules use; auto-approval never covers it unless a rule says so explicitly. The plan and the dry run say which keys are beyond the tier and which extra approval they need.

    2. Kyverno messages parameterized from the configuration. "Kyverno messages can be parameterized so too to use the configured values as generic message stating -". Each rule's message is a generic template filled with the configured values and the offending value (for example "requests.cpu 40 is above the dev maximum of 32; ask for a custom tier with approval"), not a hard-coded number. The same values feed the policy, its message, cmapi's plan-time problem detail and the portal, so the four always agree. Verify Kyverno's variable substitution in message for the pinned version, offline in the CLI as well as at admission.

  3. added a commit that references this issue on Nov 14, 2026
  4. ephico2real2 commented on Nov 14, 2026

    @ephico2real2
    OwnerAuthor

    The API side is merged with PR #224 (limitRange, the overridable quota keys, the facts beyondTier, beyondTierKeys and networkExposure, the decision record docs/reviews/2026-11-14-issue-211/). Still open here: the portal items (the New namespace tab offers the limits on the custom tier; the Approvals tab shows the beyond-tier keys), with those tabs in Wave 6. Proof so far is native only: the service suite on the suite's fakes, no cluster (#157).

  5. added
    In-Progress
    status:partly-fixed
    and removed
    status:open
    Backlog
    on Nov 19, 2026
  6. ephico2real2 commented on Nov 19, 2026

    @ephico2real2
    OwnerAuthor

    Work tag In-Progress. Evidence: merged part(s) of this issue: #224. The issue stays open for the rest; status:partly-fixed. Moved up from Backlog (records sweep 2026-11-19).

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

    In-Progressfeaturestatus:partly-fixed

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions