Files
cozystack/packages/system/cozystack-api/templates/deployment.yaml
T
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

51 lines
1.3 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: cozystack-api
namespace: cozy-system
labels:
app: cozystack-api
spec:
replicas: {{ .Values.cozystackAPI.replicas }}
selector:
matchLabels:
app: cozystack-api
template:
metadata:
labels:
app: cozystack-api
spec:
tolerations:
- operator: Exists
serviceAccountName: cozystack-api
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
containers:
- name: cozystack-api
args:
- --tls-cert-file=/tmp/cozystack-api-certs/tls.crt
- --tls-private-key-file=/tmp/cozystack-api-certs/tls.key
image: "{{ .Values.cozystackAPI.image }}"
ports:
- containerPort: 443
name: https
volumeMounts:
- name: cozystack-api-certs
mountPath: /tmp/cozystack-api-certs
readOnly: true
{{- with .Values.cozystackAPI.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
volumes:
- name: cozystack-api-certs
secret:
secretName: cozystack-api-cert
defaultMode: 0400