skip to content
Alvin Lucillo

Using kustomize components

/ 1 min read

Components are reusable resources that can be referenced by overlays. For example, auth-related resources may only be applied to specific overlays if they are declared as components.

tree
.
└── code
    ├── README.md
    └── project_mercury
        ├── base
   ├── api-depl.yaml
   ├── api-service.yaml
   └── kustomization.yaml
        ├── components
   ├── auth
   ├── api-patch.yaml
   ├── keycloak-depl.yaml
   ├── keycloak-service.yaml
   └── kustomization.yaml
   ├── db
   ├── api-patch.yaml
   ├── db-deployment.yaml
   ├── db-service.yaml
   └── kustomization.yaml
   └── logging
       ├── kustomization.yaml
       ├── prometheus-depl.yaml
       └── prometheus-service.yaml
        └── overlays
            ├── community
   └── kustomization.yaml
            ├── dev
   └── kustomization.yaml
            └── enterprise
                └── kustomization.yaml

If we are to use auth component to community overlay, modify that overlay’s kustomization.yaml similar to below:

bases:
  - ../../base

components:
  - ../../components/auth