Skip to content

Pin the image by digest, spread replicas, check SOyA for readiness - #28

Merged
fabianekc merged 1 commit into
mainfrom
pin-digest-ready-probe
Oct 20, 2026
Merged

fabianekc merged 1 commit into
mainfrom
pin-digest-ready-probe

Conversation

@fabianekc

Copy link
Copy Markdown
Member

Summary

  • Image by digest. kubernetes/deployment.yaml names
    oydeu/dpplint@sha256:… with imagePullPolicy: IfNotPresent instead of
    latest with Always. All replicas run the same image, and a restart never
    picks up a newer one. DOCKERHUB=1 ./build.sh pushes the image and writes
    its digest into the manifest; the README describes the step. kubernetes/
    is excluded from the image (.dockerignore), so writing the digest does not
    change the image.
  • Spread and disruption budget. topologySpreadConstraints over
    kubernetes.io/hostname (maxSkew: 1, whenUnsatisfiable: ScheduleAnyway)
    and kubernetes/pdb.yaml with minAvailable: 1 for app=dpplint. The
    rolling update (maxUnavailable: 0, maxSurge: 1) is not affected by the
    budget, which applies to evictions such as a node drain.
  • Readiness with the SOyA web-cli. New GET /ready, used as readiness
    probe.
    • It answers 200 when the SOyA web-cli (/api/v1/version) and the SOyA
      repository (HEAD of one structure of the image) answer, and 503 with the
      reason when not.
    • The result is held: renewed at most every 30 s, every second while not
      ready.
    • Each question is a local request with 0.25 s to connect and 0.5 s to
      answer, so the probe (every 5 s, 2 s limit) starts no process.
    • Only one question runs at a time.
    • GET /version is unchanged.

Checks

  • Test suite in the image: 253 runs, 0 failures (241 before).
    • The new tests cover ready, web-cli down, error or HTML answers, a hanging
      web-cli (ends below 1 s, nothing left open), a missing repository, a
      missing structure and no structures.
    • They also cover the held result (30 s and 1 s), a web-cli that stops after
      it was ready, one question at a time, and /version with the same fields
      without the web-cli.
  • Counter-check: 11 of the 12 new tests fail on main. The 12th, about
    /version, passes on both, as it should.
  • Container:
    • Ready about 1.6 s after the start; /ready takes 8 ms (median of 20).
    • Web-cli stopped: 503 "SOyA web-cli not reachable" after 21 s.
    • Image without the web-cli: 503 from the start.
    • Repository stopped: 503 "SOyA repository not reachable".
    • /version answers 200 throughout.
  • Manifests: kubeconform -strict against Kubernetes 1.30: deployment,
    pod disruption budget, service, ingress and certificate are valid.
  • Digest step: build.sh tested with a stub docker. The manifest gets
    exactly the pushed oydeu/dpplint@sha256: digest; a second run works too.

The deployment names the image by its digest instead of latest with
imagePullPolicy Always, so that all replicas run the same image and a
restart never picks up a newer one. DOCKERHUB=1 ./build.sh writes the digest
of the pushed image into kubernetes/deployment.yaml. kubernetes/ is no
longer part of the image, so writing the digest does not change the image.

The two replicas are spread over nodes where possible
(topologySpreadConstraints over kubernetes.io/hostname, maxSkew 1,
ScheduleAnyway). A pod disruption budget keeps at least one of them
running while nodes are drained.

GET /ready answers 200 when the SOyA web-cli and the SOyA repository
with the structures of the image answer, and 503 with the reason when
not; it is the readiness probe now. The result is held and renewed at
most every 30 s, every second while not ready, with local requests of at
most 0.75 s each, so the probe starts no process. GET /version is
unchanged.
@fabianekc
fabianekc merged commit a64c7b7 into main Oct 20, 2026
2 checks passed
@fabianekc
fabianekc deleted the pin-digest-ready-probe branch October 20, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant