Skip to content

Allow overriding default CPU and memory resource limits in app push #2900

@kwiatekus

Description

@kwiatekus

Description

Currently kyma app push sets fixed resource limits on the created Deployment:

  • CPU: 50m request / 300m limit
  • Memory: 64Mi request / 512Mi limit

There is no way to override these values. This causes problems for runtimes that need more memory at startup (e.g., Java/JVM apps where the Paketo memory calculator cannot fit within 512Mi without manual JAVA_TOOL_OPTIONS tuning).

Add flags like --memory-limit, --memory-request, --cpu-limit, --cpu-request (or a combined --resources flag) to allow users to specify custom resource allocations.

Reasons

  • Java/JVM apps: The default 512Mi memory limit is too low for most Spring Boot applications. Users currently must pass JAVA_TOOL_OPTIONS and BPL_JVM_THREAD_COUNT env vars as a workaround to reduce JVM memory footprint, which is fragile and non-obvious.
  • Flexibility: Different workloads have different resource profiles. A Node.js prototype may be fine with 512Mi, but a Java app with dependencies typically needs 768Mi–1Gi.
  • Developer experience: The whole point of app push is to remove boilerplate. Forcing users to tune JVM memory calculator parameters defeats that purpose for Java developers.

Proposed flags

--memory-request string   Memory request for the app container (e.g., "256Mi") (default "64Mi")
--memory-limit string     Memory limit for the app container (e.g., "1Gi") (default "512Mi")
--cpu-request string      CPU request for the app container (e.g., "100m") (default "50m")
--cpu-limit string        CPU limit for the app container (e.g., "500m") (default "300m")

The same inputs should be exposed in the kyma-project/setup-kyma-cli/app-push GitHub Action.

Attachments

Error when running a Spring Boot app with default limits:

unable to calculate memory configuration
fixed memory regions require 609483K which is greater than 512M available for allocation:
-XX:MaxDirectMemorySize=10M, -XX:MaxMetaspaceSize=97483K, -XX:ReservedCodeCacheSize=240M, -Xss1M * 250 threads

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions