简体   繁体   English

带AKS的虚拟Kubelet

[英]Virtual Kubelet with AKS

I followed the doc here When I tried to create a virtual service for Windows, I get error: The Deployment "nanoserver-iis" is invalid: spec.template.metadata.labels: Invalid value: map[string]string{"app":"nanoserver-iis"}: selector does not match template labels 我跟着DOC 这里当我试图为Windows创建一个虚拟服务,我得到错误:部署“nanoserver-IIS”是无效的:spec.template.metadata.labels:值无效:地图[字符串]字符串{“应用程序” :“ nanoserver-iis”}: selector与模板labels不匹配

kubectl get nodes 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`

virtual-kubelet-windows.yaml 虚拟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

Try updating the deployment definition with the following. 尝试使用以下方法更新部署定义。 There is an inconsistency in the YAML definition where labels don't match. YAML定义中的标签不匹配存在不一致之处。 Labels in the matchLabeles field and labels in the metadata field need to match. matchLabeles字段中的标签和元数据字段中的标签需要匹配。 In the deployment definition, they are set to different values aci-helloworld and nanoserver-iis respectively. 在部署定义中,它们分别设置为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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM