Skip to content

Custom disk volume sizes not being applied with pod manifests #58

@joshhalley

Description

@joshhalley

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

  1. Use a custom extended resource (e.g., cisco.com/persist-disk) - Rejected because Kubernetes already provides ephemeral-storage as a standard resource type, and using it maintains compatibility with standard Kubernetes tooling.

  2. Use annotations - Rejected because resource requests/limits are the idiomatic Kubernetes way to specify container resource requirements.

Additional Context

  • The YANG model disk-size-mb correctly maps to the CLI persist-disk parameter
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions