带AKS的虚拟Kubelet

时间:2018-10-22 08:27:52

标签: docker kubernetes azure-aks

我关注了文档here 当我尝试为Windows创建虚拟服务时,出现错误: 部署“ nanoserver-iis”无效:spec.template.metadata.labels:无效的值:map [string] string {“ app”:“ nanoserver-iis”}:selector与模板{{1不匹配}}

kubectl获取节点

labels

virtual-kubelet-windows.yaml

`NAME STATUS ROLES AGE VERSION aks-agentpool-27326293-0 Ready agent 15m v1.11.3 virtual-kubelet-aci-connector-windows-westeurope Ready agent 9s v1.11.2`

1 个答案:

答案 0 :(得分:1)

尝试使用以下内容更新部署定义。 YAML定义中的标签不匹配存在不一致之处。 matchLabeles字段中的标签和元数据字段中的标签需要匹配。在部署定义中,它们分别设置为aci-helloworld和nanoserver-iis不同的值。

apiVersion: apps/v1
kind: Deployment
metadata:
  name: nanoserver-iis
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nanoserver-iis
  template:
  metadata:
    labels:
      app: nanoserver-iis
  spec:
    containers:
    - name: nanoserver-iis
      image: microsoft/iis:nanoserver
      ports:
    - containerPort: 80
    nodeSelector:
      kubernetes.io/hostname: virtual-kubelet-aci-connector-windows-westeurope
    tolerations:
    - key: virtual-kubelet.io/provider
      operator: Equal
      value: azure
      effect: NoSchedule