Files
cozystack/packages/system/lineage-controller-webhook/templates/workload.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

71 lines
2.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: lineage-controller-webhook
labels:
app: lineage-controller-webhook
spec:
replicas: {{ .Values.lineageControllerWebhook.replicas }}
selector:
matchLabels:
app: lineage-controller-webhook
template:
metadata:
labels:
app: lineage-controller-webhook
spec:
serviceAccountName: lineage-controller-webhook
tolerations:
- operator: Exists
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
preference:
matchExpressions:
- key: node-role.kubernetes.io/control-plane
operator: Exists
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
app: lineage-controller-webhook
containers:
- name: lineage-controller-webhook
image: "{{ .Values.lineageControllerWebhook.image }}"
{{- if .Values.lineageControllerWebhook.localK8sAPIEndpoint.enabled }}
env:
- name: KUBERNETES_SERVICE_HOST
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.hostIP
- name: KUBERNETES_SERVICE_PORT
value: "6443"
{{- end }}
args:
{{- if .Values.lineageControllerWebhook.debug }}
- --zap-log-level=debug
{{- else }}
- --zap-log-level=info
{{- end }}
ports:
- name: webhook
containerPort: 9443
volumeMounts:
- name: webhook-certs
mountPath: /tmp/k8s-webhook-server/serving-certs
readOnly: true
{{- with .Values.lineageControllerWebhook.resources }}
resources:
{{- toYaml . | nindent 10 }}
{{- end }}
volumes:
- name: webhook-certs
secret:
secretName: lineage-controller-webhook-cert
defaultMode: 0400