Enable Kaniko registry-based layer caching #106
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "kaniko-layer-cache"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Enable Kaniko registry-based layer caching to cut ~2-3 min off Docker builds when Gemfile.lock is unchanged (most merges).
Changes
cache: trueandcache_reposettings to the Kaniko build-and-push step in.woodpecker.yamlharbor.harbor.svc.cluster.local/landscaping-assistant/cachecacherepo on first push within the existinglandscaping-assistantprojectTest Plan
landscaping-assistant/cacherepo appears in Harbor with cached layersReview Checklist
.woodpecker.yamlRelated Notes
docs/infrastructure-and-pipeline.md— pipeline docs (will update after confirming cache works)Closes #106
PR #106 Review
DOMAIN REVIEW
Tech stack: Woodpecker CI pipeline config (
.woodpecker.yaml) with Kaniko Docker builder pushing to Harbor registry. The change is a 2-line addition to enable registry-based layer caching.Kaniko cache configuration: The two new settings are correct for the
woodpeckerci/plugin-kanikoplugin:cache: trueenables Kaniko's--cache=trueflagcache_repopoints to a dedicated cache repository within the same Harbor instanceRegistry consistency: The
cache_repousesharbor.harbor.svc.cluster.localwhich matches theregistryandinsecure-registryvalues already set on lines 62-64. This is the in-cluster service FQDN -- correct for a Woodpecker runner executing inside the same k8s cluster.Insecure registry: The cache repo is on the same
harbor.harbor.svc.cluster.localhost that is already listed underinsecureandinsecure-registry. Kaniko should inherit these settings for cache pulls/pushes. No additional insecure flags needed.Layer caching effectiveness: The Dockerfile is well-structured for caching --
GemfileandGemfile.lockare copied beforebundle install, so the expensive dependency layer will be cached when only application code changes. The PR description's claim of ~2-3 min savings on unchanged Gemfile merges is plausible.Multi-stage build note: The Dockerfile uses a multi-stage build (
AS buildthen a runtime stage). Kaniko handles multi-stage caching correctly with--cache=true, caching intermediate layers from all stages.No domain concerns.
BLOCKERS
None.
This is a CI configuration change -- no application code, no user input, no auth logic, no secrets exposed. The
cache_repovalue is an internal cluster address, not a secret. Credentials remain sourced fromfrom_secretreferences. No BLOCKER criteria are triggered.NITS
Cache TTL not specified: Kaniko supports
--cache-ttlto control how long cached layers are retained. Without it, cached layers persist indefinitely in the Harbor cache repo. This is fine for now but worth considering if Harbor storage becomes a concern. Non-blocking.No
cache_copy_layerssetting: The plugin supportscache_copy_layers(maps to--cache-copy-layers) which can improve cache performance for certain layer patterns. Default behavior is fine here; mentioning for awareness only.SOP COMPLIANCE
kaniko-layer-cache-- does not follow{issue-number}-{kebab-case-purpose}convention. However, #106 is the PR itself (self-referencing via "Closes #106"), not a separate issue. No standalone issue exists for this work, so there is no issue number to prefix. Minor deviation.docs/infrastructure-and-pipeline.mdand PR #91, but no plan slug from pal-e-docs. Acceptable for a small infra tweak.from_secret. Thecache_repovalue is an internal DNS name, not a secret.PROCESS OBSERVATIONS
docs/infrastructure-and-pipeline.mdwill be updated after confirming cache works. Issue #99/PR #100 appear to track pipeline docs updates separately -- good sequencing.build-and-pushonly runs onmain.VERDICT: APPROVED
Clean, minimal, well-scoped CI change. No blockers. The cache configuration is correct for the existing Kaniko + Harbor setup. Risk is low with graceful degradation on cache miss.