mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-30 12:16:03 +09:00
fix(harbor): roll jobservice without a surge
jobservice keeps its job log on a ReadWriteOnce volume, but the upstream chart rolls it with the default surge. When the replacement lands on another node it waits on the volume attach for good, and the nested release fails as stalled. The registry credential rotation restarts jobservice on every existing release, so the upgrade would hit this on any multi-node cluster. Only jobservice is changed, through a post-renderer: the chart's own switch to Recreate also applies to the registry, which keeps its data in S3 and should go on rolling without an outage. Assisted-by: LLM Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
2 files changed
+41
No files matched your search
@@ -167,6 +167,28 @@ spec:
|
||||
retryInterval: 30s
|
||||
remediation:
|
||||
retries: -1
|
||||
{{- /* jobservice mounts a ReadWriteOnce job-log volume, and the upstream
|
||||
chart rolls it with a surge: a replacement scheduled on another node
|
||||
waits on the attach for good and the upgrade fails as stalled. With
|
||||
no surge the old pod goes first and releases the volume. The chart's
|
||||
own switch, updateStrategy=Recreate, also covers the registry, which
|
||||
keeps its data in S3 and should keep rolling without an outage. */}}
|
||||
postRenderers:
|
||||
- kustomize:
|
||||
patches:
|
||||
- target:
|
||||
group: apps
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: {{ .Release.Name }}-jobservice
|
||||
patch: |
|
||||
- op: replace
|
||||
path: /spec/strategy
|
||||
value:
|
||||
type: RollingUpdate
|
||||
rollingUpdate:
|
||||
maxSurge: 0
|
||||
maxUnavailable: 1
|
||||
valuesFrom:
|
||||
- kind: Secret
|
||||
name: cozystack-values
|
||||
|
||||
@@ -124,3 +124,22 @@ tests:
|
||||
- matchRegex:
|
||||
path: stringData.htpasswd
|
||||
pattern: ^harbor_registry_user:\$2[aby]\$
|
||||
|
||||
# Rotating the credential restarts jobservice on every existing release;
|
||||
# with a surge its ReadWriteOnce job-log volume can pin the replacement on
|
||||
# another node and fail the upgrade as stalled.
|
||||
- it: rolls jobservice without a surge
|
||||
documentSelector:
|
||||
path: kind
|
||||
value: HelmRelease
|
||||
asserts:
|
||||
- equal:
|
||||
path: spec.postRenderers[0].kustomize.patches[0].target
|
||||
value:
|
||||
group: apps
|
||||
version: v1
|
||||
kind: Deployment
|
||||
name: harbor-test-jobservice
|
||||
- matchRegex:
|
||||
path: spec.postRenderers[0].kustomize.patches[0].patch
|
||||
pattern: "maxSurge: 0"
|
||||
Reference in new issue
Block a user