Files
cozystack/packages/system/cozystack-api/tests/resources_test.yaml
Nikita Aboltin 8732dc96cf feat(api): add configurable resources and replicas for cozystack-engine components
- cozystack-api, cozystack-controller, lineage-controller-webhook: conditional
  resources block via `{{- with .Values.*.resources }}`, defaulting to `{}` so the
  default render stays unchanged
- cozystack-controller: replicas comes from values (was hardcoded 1); the chart
  now passes --leader-elect unconditionally and grants the Lease verbs through a
  namespaced Role and RoleBinding in cozy-system (the Lease lives in the manager's
  own namespace), so raising replicas adds a standby instead of a second active
  writer over the reconcilers that patch HelmReleases, Gateways, Certificates,
  ResourceQuotas and Secrets

Signed-off-by: Nikita Aboltin <aboltin.nikita@rwb.ru>
2026-09-28 15:19:45 +03:00

41 lines
1.0 KiB
YAML

suite: cozystack-api resources knob
templates:
- templates/deployment.yaml
release:
name: cozystack-api
namespace: cozy-system
# The shipped default is `{}`, which renders no resources key at all, so no
# existing pod moves on upgrade; only an admin who sets the value under the
# Package CR gets requests or limits. The empty default is what makes the change
# safe to land, hence a case on each half.
tests:
- it: the shipped default renders no resources key
asserts:
- isKind:
of: Deployment
- notExists:
path: spec.template.spec.containers[0].resources
- it: a set value renders on the container, not the pod
set:
cozystackAPI.resources:
requests:
cpu: 5m
memory: 160Mi
limits:
cpu: 500m
memory: 512Mi
asserts:
- equal:
path: spec.template.spec.containers[0].resources
value:
requests:
cpu: 5m
memory: 160Mi
limits:
cpu: 500m
memory: 512Mi