{"id":"00139e10-9b93-4fc4-9a15-fa6954f2a194","task":"Build a Kustomize component that adds a common sidecar container and shared volume across multiple overlays without duplicating the patch in each overlay","domain":"kubernetes.io","steps":["Create a Kustomize component directory with a kustomization.yaml that sets kind: Component and includes the sidecar patch as a strategic merge patch or JSON6902 patch file","Define the patch to add the sidecar container spec and any required shared volume to the target Deployment or Pod template, using a match on name or kind","In each overlay kustomization.yaml, add the component under the components field using a relative path to the component directory","Build and inspect each overlay with kustomize build to confirm the sidecar is injected without duplicating the patch definition","Verify that the component-added resources are correctly merged with overlay-specific patches without conflict, adjusting patch order if merge conflicts arise"],"gotchas":["Kustomize components differ from bases in that they can be included multiple times across an overlay tree without causing duplicate resource errors; accidentally using a base instead of a component for shared patches causes duplicate resource application","Strategic merge patches in components use the same merge key logic as kubectl apply; if the container name in the patch does not match any existing container, the patch appends a new container silently rather than replacing, which can cause duplicate sidecars","Components are processed after bases and before overlay patches in the kustomize build order; a patch in the overlay that targets the same container the component added must use the correct container name from the component output"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:40:37.260Z"},"url":"https://mcp.waymark.network/r/00139e10-9b93-4fc4-9a15-fa6954f2a194"}