无法创建具有在节点上播发的扩展资源的Pod

时间:2020-08-11 21:17:12

标签: kubernetes kubernetes-pod

您好,我有一个单节点集群,在该集群中,我已经按照kubernetes-extended-resource上的文档,将名为“ sctrls”的扩展资源发布给了节点softserv1141。在这里,我运行了命令:

SubscribeToUpdates(this.globals.interestingString).thenDoThis(result){
     this.displayMsg = this.formatInterestingStrs(result);
}

其输出包含以下部分,这意味着资源创建成功。

kubectl get nodes -o yaml

我尝试创建将扩展资源分配给Pod,并按照kubernetes-assign-extended-resource-pod上的文档进行创建。 pod文件如下

status:
addresses:
- address: 172.16.250.120
  type: InternalIP
- address: softserv1141
  type: Hostname
allocatable:
  cpu: "3"
  ephemeral-storage: "7721503937"
  hugepages-1Gi: "0"
  hugepages-2Mi: "0"
  memory: 16163880Ki
  pods: "110"
  sctrls: "64"
capacity:
  cpu: "3"
  ephemeral-storage: 8182Mi
  hugepages-1Gi: "0"
  hugepages-2Mi: "0"
  memory: 16266280Ki
  pods: "110"
  sctrls: "64"

在广告连播创建过程中出现以下问题

$ cat nginx-pod.yaml 
apiVersion: v1
kind: Pod
metadata:
  name: extended-resource-demo
spec:
  containers:
  - name: extended-resource-demo-ctr
    image: nginx
    resources:
      requests:
        sctrls: 3

我不知道为什么我会收到此错误,并且还没有在网上找到任何好的解决方案。但是我觉得它可能是kubectl版本,因为docs将此作为功能状态提及:Kubernetes v1.18 [stable]其中我的kubectl版本是

$ kubectl create -f nginx-pod.yaml 
The Pod "extended-resource-demo" is invalid: 
* spec.containers[0].resources.limits[sctrls]: Invalid value: "sctrls": must be a standard resource type or fully qualified
* spec.containers[0].resources.limits[sctrls]: Invalid value: "sctrls": must be a standard resource for containers
* spec.containers[0].resources.requests[sctrls]: Invalid value: "sctrls": must be a standard resource type or fully qualified
* spec.containers[0].resources.requests[sctrls]: Invalid value: "sctrls": must be a standard resource for containers

我需要确认是否是问题所在或有未经测试的解决方案。

1 个答案:

答案 0 :(得分:2)

docs中的本段看起来像是这样的答案:“扩展资源完全可以使用* .kubernetes.io /以外的任何域进行限定。有效的扩展资源名称的格式为example.com/ foo ,其中example.com被替换为您组织的域,而foo是描述性资源名称。”。

相关问题