是否有 Kubectl YAML 数据格式的参考文档?

Is there a reference documentation for the Kubectl YAML data formats?

我正在尝试查找指定配额时使用的所有允许格式,但我能找到的只是可能无法涵盖所有​​情况的示例。例如

它在每个子系统中都有原位记录,但在引擎盖下这两个是同一件事,一个称为 Quantity 的结构。查看 https://pkg.go.dev/k8s.io/apimachinery/pkg/api/resource#Quantity 以获得详尽的解释,但基本上 200m == 0.21Gi == 2^30 == 1073741824。这些数字的实际含义是特定于上下文的,但数量解析是共享的。

文档的 Resource units in Kubernetes 部分描述了 CPU 和内存资源的含义和允许值。

引用:

CPU的含义:

Limits and requests for CPU resources are measured in cpu units. One cpu, in Kubernetes, is equivalent to 1 vCPU/Core for cloud providers and 1 hyperthread on bare-metal Intel processors.

允许的值:

Fractional requests are allowed. A Container with spec.containers[].resources.requests.cpu of 0.5 is guaranteed half as much CPU as one that asks for 1 CPU. The expression 0.1 is equivalent to the expression 100m, which can be read as "one hundred millicpu". Some people say "one hundred millicores", and this is understood to mean the same thing. A request with a decimal point, like 0.1, is converted to 100m by the API, and precision finer than 1m is not allowed. For this reason, the form 100m might be preferred.

CPU is always requested as an absolute quantity, never as a relative quantity; 0.1 is the same amount of CPU on a single-core, dual-core, or 48-core machine.

内存的含义和允许的值:

Limits and requests for memory are measured in bytes. You can express memory as a plain integer or as a fixed-point number using one of these suffixes: E, P, T, G, M, K. You can also use the power-of-two equivalents: Ei, Pi, Ti, Gi, Mi, Ki. For example, the following represent roughly the same values: 128974848, 129e6, 129M, 123Mi