带 AKS 的虚拟 Kubelet

Virtual Kubelet with AKS

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

kubectl 获取节点

`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`

虚拟 kubelet-windows.yaml

apiVersion: apps/v1 kind: Deployment metadata: name: nanoserver-iis spec: replicas: 1 selector: matchLabels: app: aci-helloworld 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

尝试使用以下内容更新部署定义。 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