Skip to content

kustomize layout is haphazard and difficult to add to #836

@ktdreyer

Description

@ktdreyer

I'm attempting to add new deployment targets to our kustomize tree. As I'm doing this, I am learning that our kustomize layout is not easily extensible.

Problem Claude found

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>

Adding a new OpenShift deployment target (like mpp-preprod) requires copying patch files from an existing overlay and hoping nothing was missed. There's no shared structure to build on. Each overlay is a standalone silo that happens to reference the same base.

Specific frictions Claude hit in my first attempt to add mpp-preprod:

  • Duplicated patches across overlays. The OAuth proxy patches, PostgreSQL RHEL patches, and Unleash init-db patches each appear in multiple overlays as independent copies. A fix to one must be manually applied to the others.
  • No way to compose capabilities. "I need an OpenShift overlay with OAuth and RHEL postgres" should be a one-line composition, not a copy-paste job.
  • minikube/ sits outside kustomize entirely. It uses raw kubectl apply from the Makefile, so changes to base/ don't propagate to it. (decided to drop minikube entirely in drop minikube support #900 )

Impact

Every new deployment target multiplies our maintenance surface. Today we have six overlays with significant duplication between them. The next target we add will make it worse.

Proposed direction

Extract shared patches into Kustomize Components (e.g., components/oauth-proxy/, components/postgresql-rhel/). Each overlay would then compose the components it needs rather than maintaining its own copies.

(Also we should also make the README less of a maintenance headache; #835))


Draft layout from Claude

Details
  ---
  Draft 1: Shared platform components

  Extract common platform-specific config into intermediate layers.

  base/
  ├── core/                          # deployments, services, PVCs, CRDs
  └── rbac/                          # RBAC (already exists)

  components/                        # Kustomize Components (reusable mixins)
  ├── oauth-proxy/                   # OAuth sidecar patches (prod + preprod)
  ├── local-images/                  # imagePullPolicy + localhost image remapping
  ├── postgresql-rhel/               # RHEL postgres patches (OpenShift envs)
  └── postgresql-init-scripts/       # init-scripts volume (Kind/e2e envs)

  overlays/
  ├── production/                    # base + oauth-proxy + postgresql-rhel
  ├── mpp-preprod/                   # base + oauth-proxy + postgresql-rhel + preprod secrets
  ├── e2e/                           # base + postgresql-init-scripts
  ├── kind/                          # base + postgresql-init-scripts
  ├── kind-local/                    # kind + local-images
  ├── local-dev/                     # base + rbac + postgresql-rhel
  └── minikube/                      # bring minikube into kustomize

  Pros: Eliminates duplicated patches between production/mpp-preprod and between kind/e2e. Kustomize Components are the idiomatic tool for cross-cutting concerns.

  Cons: More directories to navigate. Developers must understand Kustomize Components (a less common feature).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions