Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci-operator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ jobs:
run: |
kubectl get pods -A
kubectl -n kates logs deploy/kates -c kates --tail=50 || true
kubectl -n kates-operator logs deploy/kates-operator --tail=50 || true
kubectl -n kates-operator logs -l app.kubernetes.io/name=kates-operator --prefix --tail=50 || true

gate:
name: Gate · Operator
Expand Down
2 changes: 1 addition & 1 deletion operator/chart/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -298,4 +298,4 @@ The NetworkPolicy allows egress on 8080, 443 and 6443. A Kates URL on any other

Metrics are on `:8080/metrics` under `kates_operator_`, and `monitoring.enabled` renders a PodMonitor. `/readyz` fails on an unreachable API server or a stale served CRD, and it reports the Lease and any refused Kafka namespace in its body without failing on them.

One pod holds the Lease `kates-operator` in the release namespace. `replicas: 2` only shortens the gap after a crash, to between 5 and 15 seconds.
One pod holds the Lease `kates-operator` in the release namespace. The chart runs two, on different nodes where it can (unless `affinity` is set), so the second takes the Lease over within 5 to 15 seconds when the first or its node is lost. With `replicas: 1`, a lost node holds everything until a new pod is scheduled and started.
13 changes: 13 additions & 0 deletions operator/chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,19 @@ spec:
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- else }}
{{- if gt (int .Values.replicas) 1 }}
# Two on one node die with it, and the Lease waits out its node's loss.
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
{{- include "kates-operator.selectorLabels" . | nindent 20 }}
{{- end }}
{{- end }}
containers:
- name: operator
Expand Down
6 changes: 4 additions & 2 deletions operator/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ crdUpgrade:
limits:
memory: 64Mi

# -- 2 only shortens the gap after a crash: one pod holds the Lease.
replicas: 1
# -- One pod holds the Lease; the second takes it over within seconds when the
# first or its node is lost. 1 waits for a new pod to be scheduled and started.
replicas: 2

resources:
requests:
Expand Down Expand Up @@ -107,4 +108,5 @@ podLabels: {}
podAnnotations: {}
nodeSelector: {}
tolerations: []
# -- Empty, with replicas above 1: the pods prefer one node each.
affinity: {}
Loading