@@ -202,10 +202,10 @@ CPU is always requested as an absolute quantity, never as a relative quantity;
202
202
203
203
### CPU 的含义 {#meaning-of-cpu}
204
204
205
- CPU 资源的约束和请求以 * cpu * 为单位。
205
+ CPU 资源的约束和请求以 * CPU * 为单位。
206
206
207
- Kubernetes 中的一个 cpu 等于云平台上的 ** 1 个 vCPU/核** 和裸机 Intel
208
- 处理器上的 ** 1 个超线程 ** 。
207
+ Kubernetes 中的一个 CPU 等于云平台上的 ** 1 个 vCPU/核** 和裸机 Intel
208
+ 处理器上的 ** 1 个超线程** 。
209
209
210
210
你也可以表达带小数 CPU 的请求。` spec.containers[].resources.requests.cpu ` 为 0.5
211
211
的 Container 肯定能够获得请求 1 CPU 的容器的一半 CPU 资源。表达式 ` 0.1 ` 等价于表达式 ` 100m ` ,
@@ -321,8 +321,9 @@ When using Docker:
321
321
flag in the `docker run` command.
322
322
323
323
- The `spec.containers[].resources.limits.cpu` is converted to its millicore value and
324
- multiplied by 100. The resulting value is the total amount of CPU time that a container can use
325
- every 100ms. A container cannot use more than its share of CPU time during this interval.
324
+ multiplied by 100. The resulting value is the total amount of CPU time in microseconds
325
+ that a container can use every 100ms. A container cannot use more than its share of
326
+ CPU time during this interval.
326
327
327
328
The default quota period is 100ms. The minimum resolution of CPU quota is 1ms.
328
329
@@ -337,8 +338,8 @@ When using Docker:
337
338
[`--cpu-shares`](https://docs.docker.com/engine/reference/run/#/cpu-share-constraint)
338
339
标志的值。
339
340
- ` spec.containers[].resources.limits.cpu` 先被转换为 millicore 值,再乘以 100。
340
- 其结果就是每 100 毫秒内容器可以使用的 CPU 时间总量。在此期间(100ms),容器所使用的 CPU
341
- 时间不会超过它被分配的时间 。
341
+ 其结果就是每 100 毫秒内容器可以使用的 CPU 时间总量,单位为微秒 。在此期间(100ms),
342
+ 容器所使用的 CPU 时间不可以超过它被分配的时间 。
342
343
343
344
{{< note >}}
344
345
默认的配额(Quota)周期为 100 毫秒。CPU 配额的最小精度为 1 毫秒。
@@ -621,13 +622,22 @@ spec:
621
622
ephemeral-storage: "2Gi"
622
623
limits:
623
624
ephemeral-storage: "4Gi"
625
+ volumeMounts:
626
+ - name: ephemeral
627
+ mountPath: "/tmp"
624
628
- name: log-aggregator
625
629
image: images.my-company.example/log-aggregator:v6
626
630
resources:
627
631
requests:
628
632
ephemeral-storage: "2Gi"
629
633
limits:
630
634
ephemeral-storage: "4Gi"
635
+ volumeMounts:
636
+ - name: ephemeral
637
+ mountPath: "/tmp"
638
+ volumes:
639
+ - name: ephemeral
640
+ emptyDir: {}
631
641
```
632
642
633
643
<!--
0 commit comments