![kubernetes 容器部分中的 {} 是什么意思?](https://linux22.com/image/229794/kubernetes%20%E5%AE%B9%E5%99%A8%E9%83%A8%E5%88%86%E4%B8%AD%E7%9A%84%20%7B%7D%20%E6%98%AF%E4%BB%80%E4%B9%88%E6%84%8F%E6%80%9D%EF%BC%9F.png)
我想知道Kubernetes 中resources: {}
的 in是什么意思?pod.spec.containers.resources
答案1
您可以获取kubectl
有关 Kubernetes 资源字段的文档。例如:
$ kubectl explain pod.spec.containers.resources
KIND: Pod
VERSION: v1
FIELD: resources <ResourceRequirements>
DESCRIPTION:
Compute Resources required by this container. Cannot be updated. More info:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
ResourceRequirements describes the compute resource requirements.
FIELDS:
claims <[]ResourceClaim>
Claims lists the names of resources, defined in spec.resourceClaims, that
are used by this container.
This is an alpha field and requires enabling the DynamicResourceAllocation
feature gate.
This field is immutable. It can only be set for containers.
limits <map[string]Quantity>
Limits describes the maximum amount of compute resources allowed. More info:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
requests <map[string]Quantity>
Requests describes the minimum amount of compute resources required. If
Requests is omitted for a container, it defaults to Limits if that is
explicitly specified, otherwise to an implementation-defined value. Requests
cannot exceed Limits. More info:
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
如果您需要有关任何子字段的更多信息,只需将该字段附加到命令中即可
$ kubectl explain pod.spec.containers.resources.claims
$ kubectl explain pod.spec.containers.resources.limits
$ kubectl explain pod.spec.containers.resources.requests
...
在您的情况下,这{}
意味着没有设置任何字段。