Is there a way to add new Resources with Kustomize (as opposed to overlaying them)?

4/28/2019

Using kubectl apply -k, you can overlay Resource configs (that you have already defined). Can you create resources as well?

In my specific case I want to create a local Volume for the development environment. I do not have this Resource in the base folder though.

My folder structure is like this:

~/someApp
├── base
│   ├── deployment.yaml
│   ├── kustomization.yaml
│   └── service.yaml
└── overlays
    ├── development
    │   ├── cpu_count.yaml
    │   ├── kustomization.yaml
    │   ├── replica_count.yaml
    │   └── volume.yaml <--- *Is this possible*?
    └── production
        ├── cpu_count.yaml
        ├── kustomization.yaml
        └── replica_count.yaml
-- Tom
kubernetes
kustomize
templating

1 Answer

6/5/2019

In your overlays/development/kustomization.yaml you can add:

resources:
  - volume.yaml
-- ITChap
Source: StackOverflow