I have sizeLimit property under emptyDir set to 2Gi in my template base file. I want to remove the sizelimit and just have emptyDir: {}. I've been unable to achieve this using Kustomization overlays. I will detail my folder structure and kustomization yamls below.
Folder Structure:
application
├── majorbase
│ ├── kustomization.yaml
│ └── resources
│ └── web-template.yaml
├── minorbase
│ ├── kustomization.yaml
│ └── resources
└── myoverlays
├── kustomization.yaml
└── resources
└── my-new-web.yaml
The folder myoverlays contains the following contents in it's kustomization.yaml file
bases:
- ../minorbase
patchesStrategicMerge:
- resources/my-new-web.yaml
The folder minorbase contains the following contents in it's kustomization.yaml file
bases:
- ../majorbase
The folder majorbase contains the following contents in it's kustomization.yaml file
resources:
- resources/web-template.yaml
The section I want to edit looks like this in the majorbase/template.
volumes:
- name: test-vol
emptyDir:
sizeLimit: "2Gi"
The above configuration needs to be updated using overlays as below.
volumes:
- name: test-vol
emptyDir: {}
This is where my problem lies. Kustomization just picks the 2Gi value mentioned in the base whenever I remove the sizelimit in my overlays. When I mention different value to sizeLimit such as "1Gi" in my overlays file, kustomization is picking up the change. What is the cause of this behaviour? Is it possible to achieve what I'm trying to do here?