Skip to content

fix(k8s): make the health checks and the ingress-nginx overlay work - #174

Merged
saidsef merged 5 commits into
mainfrom
fix-health-checks-and-ingress-overlay
Oct 13, 2026
Merged

saidsef merged 5 commits into
mainfrom
fix-health-checks-and-ingress-overlay

Conversation

@saidsef

@saidsef saidsef commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Summary

The image healthcheck and the Kustomize liveness probe now pass against a running server, and the ingress-nginx overlay builds. Two settings that did nothing leave the manifests, and the -cache help text shows its real default of 60 minutes.

Related Issues

Fixes #173.

Changes Made

  • Linux cuts a process name to 15 characters, so pgrep geocode never matched faas-reverse-ge. The probe matches faas-reverse-geocoding, the name the Helm chart probe uses.
  • Busybox wget runs the healthcheck, because the Alpine runtime image has no curl. The image drops PORT, since the binary takes its port from -port.
  • Rendered output from deployment/ changes only in the probe name and the dropped PORT variable, and the image stays :latest.

Testing

  • go vet ./... and go test ./... - pass
  • docker inspect on a container from the new image - healthy after the first check
  • Base manifests in kind - zero restarts after six minutes, against four restarts in five minutes for the previous manifests
  • kubectl kustomize on all three overlays - all build, and kubectl apply --dry-run=server accepts the ingress-nginx one
  • go run . -h - Cache duration in minutes (default 60)

Checklist

  • The HTTP API and the deployed image tag stay the same

The liveness probe in the base Deployment ran pgrep for geocode. Linux
cuts a process name to 15 characters, which leaves faas-reverse-ge, so
the probe never matched and the kubelet restarted a pod that was
serving requests. A match on faas-reverse-geocoding works, and the Helm
chart probe uses that name.

- deployment/base/deployment.yml names the full binary in the probe.
- A pod from the base runs for five minutes with no restarts.
The image healthcheck called curl, which the Alpine runtime image does
not have, and single quotes kept ${PORT} from expanding, so every check
failed. Busybox wget now requests / on port 8080. PORT leaves the image
too, because the binary takes its port from the -port flag.

- Dockerfile swaps curl for wget and exposes 8080 directly.
- A container from the new image reports healthy after its first check.
The ingress-nginx overlay carried a replacement that copied the Ingress
host onto the same Ingress without naming a target field. Kustomize
refused to build it, reporting that fieldPath spec.rules[0].host is
missing for the replacement source. The overlay needs no replacement,
so the block goes.

- deployment/ingress-nginx/kustomization.yml lists its resources and
  nothing else.
- Every overlay builds, and the API server accepts the ingress-nginx one.
Two settings in the Kustomize manifests had no effect. An image
override targeted an image called geocode, which no resource uses, so
the base kept deploying :latest. PORT sat in the container environment,
where the binary never reads it.

- The images block comes out of deployment/kustomization.yml.
- deployment/base/deployment.yml drops the PORT variable.
- Rendered output differs only by that variable, and the image stays
  :latest.
The -cache help text ended in a hand-written "(default 30)", and the
flag package appended the real "(default 60)" after it. The usage string
now reads "Cache duration in minutes", so -h shows one default.

- geocode.go drops the stale default from the usage string.
- Help output shows "(default 60)" once, and nothing else changed.
@saidsef saidsef added bug Something isn't working docker Pull requests that update Docker code mcp maintenance labels Oct 13, 2026
@saidsef saidsef self-assigned this Oct 13, 2026
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@github-actions github-actions Bot added the preview preview label Oct 13, 2026
@saidsef-pr

saidsef-pr Bot commented Oct 13, 2026

Copy link
Copy Markdown

Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been created.

1 similar comment
@saidsef-pr

saidsef-pr Bot commented Oct 13, 2026

Copy link
Copy Markdown

Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been created.

@saidsef-pr

saidsef-pr Bot commented Oct 13, 2026

Copy link
Copy Markdown

Application faas-reverse-geocoding-ebe2951-174-pr-reviews is now running new version of deployments manifests.
See more here: https://argocd.saidsef.co.uk/applications/faas-reverse-geocoding-ebe2951-174-pr-reviews?operation=true

@saidsef
saidsef merged commit 3b3837d into main Oct 13, 2026
8 checks passed
@saidsef
saidsef deleted the fix-health-checks-and-ingress-overlay branch October 13, 2026 11:32
@saidsef-pr

saidsef-pr Bot commented Oct 13, 2026

Copy link
Copy Markdown

Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working docker Pull requests that update Docker code maintenance mcp preview preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(k8s): make the health checks and the ingress-nginx overlay work

1 participant