-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Problem Statement
Currently disk volume size specified via ephemeral-storage in a pod spec is not being applied to the IOS-XE app-hosting configuration. The persist-disk parameter always defaults to 1024 MB regardless of the value specified in the pod manifest.
Example pod spec:
resources:
requests:
ephemeral-storage: "10Mi"
limits:
ephemeral-storage: "15Mi"Expected IOS-XE configuration:
app-resource profile custom
persist-disk 15
Actual IOS-XE configuration:
app-resource profile custom
persist-disk 1024
Proposed Solution
The bug is in internal/drivers/iosxe/transformers.go line 379. The code uses Storage() method which returns the storage resource (for PersistentVolumes), not ephemeral-storage.
Current code:
if storage := container.Resources.Requests.Storage(); storage != nil && !storage.IsZero() {
config.diskMB = uint16(storage.Value() / (1024 * 1024))
}Fix:
if storage, ok := container.Resources.Requests[v1.ResourceEphemeralStorage]; ok && !storage.IsZero() {
config.diskMB = uint16(storage.Value() / (1024 * 1024))
}This accesses ephemeral-storage directly from the ResourceList using the v1.ResourceEphemeralStorage constant.
Alternatives Considered
-
Use a custom extended resource (e.g.,
cisco.com/persist-disk) - Rejected because Kubernetes already providesephemeral-storageas a standard resource type, and using it maintains compatibility with standard Kubernetes tooling. -
Use annotations - Rejected because resource requests/limits are the idiomatic Kubernetes way to specify container resource requirements.
Additional Context
- The YANG model
disk-size-mbcorrectly maps to the CLIpersist-diskparameter - The default value of 1024 MB is set in getResourceConfig() and is only overwritten if the storage value is successfully read
- This affects all deployments attempting to specify custom disk sizes via pod specs