Repository navigation
fix(k8s): make the health checks and the ingress-nginx overlay work - #174
Merged
Merged
Conversation
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.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
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.
|
Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been created. |
1 similar comment
|
Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been created. |
|
Application faas-reverse-geocoding-ebe2951-174-pr-reviews is now running new version of deployments manifests. |
1 task done
|
Application faas-reverse-geocoding-ebe2951-174-pr-reviews has been deleted. |
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
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
-cachehelp text shows its real default of 60 minutes.Related Issues
Fixes #173.
Changes Made
pgrep geocodenever matchedfaas-reverse-ge. The probe matchesfaas-reverse-geocoding, the name the Helm chart probe uses.wgetruns the healthcheck, because the Alpine runtime image has nocurl. The image dropsPORT, since the binary takes its port from-port.deployment/changes only in the probe name and the droppedPORTvariable, and the image stays:latest.Testing
go vet ./...andgo test ./...- passdocker inspecton a container from the new image -healthyafter the first checkkubectl kustomizeon all three overlays - all build, andkubectl apply --dry-run=serveraccepts the ingress-nginx onego run . -h-Cache duration in minutes (default 60)Checklist