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

1

8

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
Elsworth answered 28/4, 2019 at 12:36 Comment(0)
S
15

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

resources:
  - volume.yaml
Silesia answered 5/6, 2019 at 8:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.