Repository navigation
Pin the image by digest, spread replicas, check SOyA for readiness - #28
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kubernetes/deployment.yamlnamesoydeu/dpplint@sha256:…withimagePullPolicy: IfNotPresentinstead oflatestwithAlways. All replicas run the same image, and a restart neverpicks up a newer one.
DOCKERHUB=1 ./build.shpushes the image and writesits digest into the manifest; the README describes the step.
kubernetes/is excluded from the image (
.dockerignore), so writing the digest does notchange the image.
topologySpreadConstraintsoverkubernetes.io/hostname(maxSkew: 1,whenUnsatisfiable: ScheduleAnyway)and
kubernetes/pdb.yamlwithminAvailable: 1forapp=dpplint. Therolling update (
maxUnavailable: 0,maxSurge: 1) is not affected by thebudget, which applies to evictions such as a node drain.
GET /ready, used as readinessprobe.
/api/v1/version) and the SOyArepository (
HEADof one structure of the image) answer, and 503 with thereason when not.
ready.
answer, so the probe (every 5 s, 2 s limit) starts no process.
GET /versionis unchanged.Checks
web-cli (ends below 1 s, nothing left open), a missing repository, a
missing structure and no structures.
it was ready, one question at a time, and
/versionwith the same fieldswithout the web-cli.
main. The 12th, about/version, passes on both, as it should./readytakes 8 ms (median of 20)./versionanswers 200 throughout.kubeconform -strictagainst Kubernetes 1.30: deployment,pod disruption budget, service, ingress and certificate are valid.
build.shtested with a stubdocker. The manifest getsexactly the pushed
oydeu/dpplint@sha256:digest; a second run works too.