summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-15 14:28:03 +0200
committerPaul Buetow <paul@buetow.org>2026-02-15 14:28:03 +0200
commit36914e0c242bf9e727da4b30dfe180cc968eb43a (patch)
treebb9b682b5367387bff1ae02bf54e90cd51800d6e
parent3cf3637cce1a561214973612378fec15d27fbb7e (diff)
Add health probes to registry deployment to auto-recover from stale NFS mounts
Added startup, liveness, and readiness probes to the docker registry deployment. The liveness probe will automatically restart the pod when it returns 503 errors (which happens when NFS storage becomes stale), preventing prolonged ImagePullBackOff issues for dependent services like radicale and git-server. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
-rw-r--r--f3s/registry/helm-chart/templates/deployment.yaml25
-rw-r--r--snippets/go/go-projects/go-projects.md25
2 files changed, 25 insertions, 25 deletions
diff --git a/f3s/registry/helm-chart/templates/deployment.yaml b/f3s/registry/helm-chart/templates/deployment.yaml
index 70522f8..ae3397f 100644
--- a/f3s/registry/helm-chart/templates/deployment.yaml
+++ b/f3s/registry/helm-chart/templates/deployment.yaml
@@ -20,6 +20,31 @@ spec:
image: registry:2
ports:
- containerPort: 5000
+ # Startup probe: give registry time to initialize (especially if NFS is slow)
+ startupProbe:
+ httpGet:
+ path: /v2/
+ port: 5000
+ initialDelaySeconds: 5
+ periodSeconds: 5
+ timeoutSeconds: 3
+ failureThreshold: 12 # 60 seconds total (12 * 5s)
+ # Liveness probe: restart pod if registry returns 503 (stale NFS) or becomes unresponsive
+ livenessProbe:
+ httpGet:
+ path: /v2/
+ port: 5000
+ periodSeconds: 30
+ timeoutSeconds: 5
+ failureThreshold: 3 # Restart after 90 seconds of failures
+ # Readiness probe: remove from service if not ready
+ readinessProbe:
+ httpGet:
+ path: /v2/
+ port: 5000
+ periodSeconds: 10
+ timeoutSeconds: 3
+ failureThreshold: 2
volumeMounts:
- name: registry-storage
mountPath: /var/lib/registry
diff --git a/snippets/go/go-projects/go-projects.md b/snippets/go/go-projects/go-projects.md
deleted file mode 100644
index d36da21..0000000
--- a/snippets/go/go-projects/go-projects.md
+++ /dev/null
@@ -1,25 +0,0 @@
-* Prefer value semantics over pointer semantics if feasible
-* Have either pointer or value receivers, not both, for methods on a type
-* Have constants, global variables, and type definitions always at the top of the file, before functions and methods
-* Have public functions and method before private ones in the file.
-* constructors must be always the first functions in a file (before all the methods), immediately after type definitions. even if they're non-public.
-* Binary is in ./cmd/NAME/main.go
-* Main file should be fairly small and only be concerned about argument/flags parsing and calling functions from the internal package
-* Internal code is in ./internal
-* Version of the app is a constent in the ./internal/version.go and a -version flag (main.go) prints it out.
-* Avoid using package-level variables unless absolutely necessary; prefer dependency injection
-* Use context.Context as the first parameter for functions that may block, perform I/O, or be canceled
-* Use error wrapping (fmt.Errorf with %w) to provide context for errors
-* Prefer explicit interface satisfaction (var _ MyInterface = (*MyType)(nil)) for public types
-* Keep interfaces small and focused; accept interfaces, return concrete types
-* Use gofmt and goimports to enforce formatting and import order
-* Document all exported identifiers with comments starting with the identifier's name
-* Avoid stutter in package and type names (e.g., "foo.FooType" should be just "foo.Type")
-* Use short variable names for short-lived variables, longer names for longer-lived ones
-* Use iota for related constant values
-* Use table-driven tests for unit testing
-* Avoid using panic except for truly unrecoverable errors (e.g., programmer errors)
-* Use defer to close resources (files, connections) as soon as they are opened
-* Avoid large functions, split them into smaller, focused helper functions. 50 lines per function max.
-* Aim for a unit test coverage of 60%
-* Avoid code duplication where reasonable.