Skip to content

The resources.limits.memory unit is automatically converted. Why cannot the unit be displayed as configured? #1729

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Black-max12138 opened this issue Mar 24, 2025 · 8 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@Black-max12138
Copy link

What happened?

When resources.limits.memory is set to 1237.3Mi, the actual pod is 1297403084800 m by running the kubectl command, which is difficult to understand.

What did you expect to happen?

Resources.limits.memory can be displayed based on the configured value and unit.

How can we reproduce it (as minimally and precisely as possible)?

Set resources.limits.memory to 1237.3Mi and run the kubectl command to check the value.

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
# paste output here

1.31

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

@Black-max12138 Black-max12138 added the kind/bug Categorizes issue or PR as related to a bug. label Mar 24, 2025
@k8s-ci-robot k8s-ci-robot added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 24, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@Ritikaa96
Copy link
Contributor

I think this helps us to understand what is the actual limit , if it shows in mentioned unit , the value will only show till particular decimal places.

@Ritikaa96
Copy link
Contributor

/sig storage
/sig node

@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/node Categorizes an issue or PR as relevant to SIG Node. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Mar 26, 2025
@Ritikaa96
Copy link
Contributor

but there has been mention of why Mi value usage created some issue like : kubernetes/kubernetes#128684

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Mar 26, 2025
@sftim
Copy link

sftim commented Mar 26, 2025

/remove-sig storage node api-machinery
/sig cli

/transfer kubectl

IMO, the choice of conversion function (for display) is one made by the kubectl tool

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Mar 26, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in SIG CLI Mar 26, 2025
@k8s-ci-robot k8s-ci-robot transferred this issue from kubernetes/kubernetes Mar 26, 2025
@mpuckett159 mpuckett159 added kind/feature Categorizes issue or PR as related to a new feature. triage/needs-information Indicates an issue needs more information in order to work on it. and removed kind/bug Categorizes issue or PR as related to a bug. labels Mar 26, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 26, 2025
@mpuckett159
Copy link
Contributor

Can you provide a reproduction of what you are talking about? Do you mean on the pod definition if you create deployment using kubectl apply or create? Or possibly describe?

@Black-max12138
Copy link
Author

/remove-sig storage node api-machinery /sig cli

/transfer kubectl

IMO, the choice of conversion function (for display) is one made by the kubectl tool

I also want to know where the code for the conversion function is. Can you tell me

@Black-max12138
Copy link
Author

Can you provide a reproduction of what you are talking about? Do you mean on the pod definition if you create deployment using kubectl apply or create? Or possibly describe?

When kubectl is used to create a deployment, its resources.limits.memory is set to 1237.3Mi. However, when kubectl is used to view the deployment, 1297403084800m is displayed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. sig/cli Categorizes an issue or PR as relevant to SIG CLI. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
Status: Needs Triage
Development

No branches or pull requests

5 participants