Skip to content

[FLINK-40105][Deployment/Kubernetes] Support memory request factor for Kubernetes deployments#28693

Open
ChenlingXie wants to merge 1 commit into
apache:masterfrom
ChenlingXie:FLINK-40105-kubernetes-memory-request-factor
Open

[FLINK-40105][Deployment/Kubernetes] Support memory request factor for Kubernetes deployments#28693
ChenlingXie wants to merge 1 commit into
apache:masterfrom
ChenlingXie:FLINK-40105-kubernetes-memory-request-factor

Conversation

@ChenlingXie

Copy link
Copy Markdown

What is the purpose of the change

This pull request allows Kubernetes deployments to configure memory requests independently from memory limits for JobManager and TaskManager containers.

Previously, Kubernetes memory requests were always set to the configured process memory, while memory limits could be adjusted with the existing memory limit factor. This change adds request factors so users can lower Kubernetes memory requests while preserving the existing limit-factor behavior.

Brief change log

  • Added kubernetes.jobmanager.memory.request-factor and kubernetes.taskmanager.memory.request-factor, both defaulting to 1.0.
  • Applied the memory request factor when generating JobManager and TaskManager Kubernetes resource requirements.
  • Added validation so memory request factors must be greater than 0 and less than or equal to 1.
  • Added unit tests for parameter validation and generated resource requirements.
  • Regenerated the Kubernetes configuration documentation.

Verifying this change

This change added tests and can be verified as follows:

  • Added coverage in InitJobManagerDecoratorTest and InitTaskManagerDecoratorTest for generated memory requests while memory limits still use the existing limit factors.
  • Added coverage in KubernetesJobManagerParametersTest and KubernetesTaskManagerParametersTest for default, custom, and invalid memory request factors.
  • Ran:
    mvn -pl flink-kubernetes -am "-Dtest=InitJobManagerDecoratorTest,InitTaskManagerDecoratorTest,KubernetesJobManagerParametersTest,KubernetesTaskManagerParametersTest" test -DskipITs "-Drat.skip=true" "-Dcheckstyle.skip=true" "-DfailIfNoTests=false" "-Dsurefire.failIfNoSpecifiedTests=false"
  • Ran:
    mvn package -Dgenerate-config-docs -pl flink-docs -am -nsu -DskipTests -DskipITs -Dfast "-Drat.skip=true" "-Dcheckstyle.skip=true" -Pskip-webui-build
  • Ran git diff --check.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: yes, Kubernetes resource requirements
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? docs

Was generative AI tooling used to co-author this PR?
  • Yes (OpenAI Codex)

Generated-by: OpenAI Codex

…r Kubernetes deployments

Generated-by: OpenAI Codex
@flinkbot

flinkbot commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@spuru9 spuru9 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@github-actions github-actions Bot added the community-reviewed PR has been reviewed by the community. label Jul 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants