Windows “始终获取错误”;部署';xxx和x27;超过其进度截止日期”;何时将我的服务部署到azure kubernetes服务

Windows “始终获取错误”;部署';xxx和x27;超过其进度截止日期”;何时将我的服务部署到azure kubernetes服务,windows,azure,kubernetes,containers,azure-aks,Windows,Azure,Kubernetes,Containers,Azure Aks,我是AKS新手,正在使用AKS设置CI/CD。 我创建了一个带有两个节点池的azure kubernetes服务,一个是默认的节点池(nodepool1,使用linux操作系统),另一个是我要部署到的windows操作系统节点池(wdpool) 我的kubernetes节点池: 我看到我的存储库映像已成功推送: kubeevents错误如下,我应该如何修复它 Error: failed to start container "xap": Error response from daemon:

我是AKS新手,正在使用AKS设置CI/CD。 我创建了一个带有两个节点池的azure kubernetes服务,一个是默认的节点池(nodepool1,使用linux操作系统),另一个是我要部署到的windows操作系统节点池(wdpool)

我的kubernetes节点池:

我看到我的存储库映像已成功推送:

kubeevents错误如下,我应该如何修复它

Error: failed to start container "xap": Error response from daemon: hcsshim::CreateComputeSystem xap: The container operating system does not match the host operating system.
"
  • 我的部署.yml
  • 我的服务
  • 我在构建yml中的部署任务:
  • 我的部署到kubernetes群集任务日志:
  • ##[部分]开始:部署到Kubernetes集群
    ==============================================================================
    任务:部署到Kubernetes
    描述:使用Kubernetes清单文件部署到集群,甚至烘焙清单文件,以便使用Helm图表进行部署
    版本:0.165.4
    作者:微软公司
    帮助:https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/kubernetes-manifest
    ==============================================================================
    ==============================================================================
    Kubectl客户端版本:v1.17.1
    Kubectl服务器版本:v1.14.8
    ==============================================================================
    [command]C:\ProgramData\Chocolate\bin\kubectl.exe apply-fd:\a\\ u temp\Deployment\u xap\u 1583635691677,d:\a\\ u temp\Service\u xap\u 158365691677--命名空间kube public
    已配置deployment.apps/xap
    服务/xap保持不变
    [命令]C:\ProgramData\Chocolate\bin\kubectl.exe卷展栏状态部署/xap--超时1800s--命名空间kube public
    错误:部署“xap”超过了其进度截止日期
    正在等待部署“xap”卷展栏完成:1个旧副本正在等待终止。。。
    正在等待观察部署规范更新。。。
    正在等待观察部署规范更新。。。
    正在等待部署“xap”卷展栏完成:1个旧副本正在等待终止。。。
    ##[错误]错误:错误:部署“xap”超过了其进度截止日期
    [command]C:\ProgramData\Chocolate\bin\kubectl.exe描述部署xap--命名空间kube public
    姓名:xap
    名称空间:kube public
    CreationTimestamp:Fri,2020年3月6日14:16:37+0000
    标签:app=xap
    注释:deployment.kubernetes.io/revision:15
    kubectl.kubernetes.io/last-applicated-configuration:
    {“apiVersion”:“apps/v1beta1”,“kind”:“Deployment”,“metadata”:{“annotations”:{},“name”:“xap”,“namespace”:“kube public”},“spec”:{“progressDea…”。。。
    选择器:app=xap
    副本:1个需要的副本| 1个更新的副本| 2个总数| 0个可用副本| 2个不可用副本
    策略类型:RollingUpdate
    最小就绪秒:0
    滚动更新策略:最多25%不可用,最多25%喘振
    Pod模板:
    标签:app=xap
    容器:
    xap:
    图:**/xap
    端口:80/TCP
    主机端口:0/TCP
    环境:
    挂载:
    卷数:
    条件:
    类型状态原因
    ----           ------  ------
    可用的错误最小值ReplicaSunAvailable
    正在进行的错误进程超出了死线
    OldReplicaSets:xap-5b95494dd7(创建了1/1个副本)
    新复制集:xap-79cc65ddf9(创建了1/1个复制副本)
    活动:
    从消息中键入原因年龄
    ----    ------             ----  ----                   -------
    正常扩展复制集36m部署控制器将复制集xap-668784656f缩减为0
    正常扩展复制集36m部署控制器将复制集xap-694857dcd8扩展到1
    正常缩放复制集36m部署控制器将复制集xap-67fd46c7b5缩小为0
    正常扩展复制集36m部署控制器将复制集xap-79cc65ddf9扩展到1
    正常扩展ReplicaSet 10m部署控制器将副本集xap-694857dcd8缩减为0
    正常扩展复制集10m部署控制器将复制集xap-5b95494dd7扩展到1
    有关更多信息,请访问https://msasg.visualstudio.com/Bing_and_IPG/_environments/75/providers/kubernetes/12
    [command]C:\ProgramData\Chocolate\bin\kubectl.exe get service/xap-o json——名称空间kube public
    {
    “apiVersion”:“v1”,
    “种类”:“服务”,
    “元数据”:{
    “注释”:{
    “kubectl.kubernetes.io/last applicated configuration:”{“apiVersion\”:“v1\”,“kind\”:“Service\”,“metadata\”:{“annotations\”:{},\“name\”:“xap\”,“namespace\”:“kube public\”,“spec\”:{“ports\”:[{“port\”:80}],“selector\”:{“app app\:“xap\”,“type\”,“type\:“LoadBalancer\”,“LoadBalancer\”
    },
    “creationTimestamp”:“2020-03-06T14:16:38Z”,
    “名称”:“xap”,
    “名称空间”:“kube public”,
    “资源版本”:“1743607”,
    “selfLink”:“/api/v1/namespaces/kube public/services/xap”,
    “uid”:“17d862ed-5fb5-11ea-ba44-82c49be4b313”
    },
    “规格”:{
    “clusterIP”:“10.0.76.15”,
    “外部流量策略”:“群集”,
    “港口”:[
    {
    “节点端口”:30742,
    “港口”:80,
    “协议”:“TCP”,
    “目标港”:80
    }
    ],
    “选择器”:{
    “应用程序”:“xap”
    },
    “sessionAffinity”:“无”,
    “类型”:“负载平衡器”
    },
    “地位”:{
    “负载平衡器”:{
    “入口”:[
    {
    “ip”:“52.139.245.51”
    }
    ]
    }
    }
    }
    服务xap外部IP为52.139.245.51
    ##[错误]卷展栏状态检查失败。
    ##[部分]完成:部署到Kubernetes集群
    
    根据@Arghya Sadhu的建议,我检查了Azure日志中的日志,“KubeEvent”表中的日志,它说

    failed to start container "xap": Error response from daemon: hcsshim::CreateComputeSystem xap: The container operating system does not match the host operating system. 
    
    上述错误
    apiVersion: v1
    kind: Service
    metadata:
        name: xap
    spec:
        type: LoadBalancer
        ports:
        - port: 80
        selector:
            app: xap
    
    # Deploy to Kubernetes - Review app with Azure DevSpaces
    # Build and push image to Azure Container Registry; Deploy to Azure Kuberentes Services
    # https://docs.microsoft.com/azure/devops/pipelines/languages/docker
    
    trigger:
    - users/jasca/xapaks
    
    resources:
    - repo: self
    
    variables:
    
      # Container registry service connection established during pipeline creation
      dockerRegistryServiceConnection: '49c3dcce-5bc7-4ea4-90fe-4bb701a497e8'
      imageRepository: 'xap'
      containerRegistry: 'xapcontainerregistry.azurecr.io'
      dockerfilePath: '**/Dockerfile'
      tag: '$(Build.BuildId)'
      imagePullSecret: 'xapcontainerregistry4671248d-auth'
    
      # Agent VM image name
      vmImageName: 'windows-latest'
    
      # Azure Service connection
      azureConnection: '4e998ed5-bbcb-4495-b19e-1ad6ca32bbe1'
    
      # Name of the new namespace being created to deploy the PR changes.
      k8sNamespaceForPR: '$(system.pullRequest.sourceBranch)'
      buildConfiguration: 'Debug'
    
    stages:
    - stage: Build
      displayName: Build WebContainerHost
      jobs:  
      - job: Build
        displayName: Build
        pool:
    #      vmImage: $(vmImageName)
           name: XAP_AKS_Pool
    #      name: XapOuterloopProductionOnly
    #      demands:
    #        - Agent.ComputerName -equals xapagent4
        steps:
    
        # ignore build tasks, succeed.
    
    - stage: Deploy
      displayName: Deploy stage
      dependsOn: Build
    
      jobs:
      - deployment: Deploy
        condition: and(succeeded(), not(startsWith(variables['Build.SourceBranch'], 'refs/pull/')))
        displayName: Deploy
        pool:
          vmImage: $(vmImageName)
        environment: 'xapplatform.kube-public'
        strategy:
          runOnce:
            deploy:
              steps:
              - task: KubernetesManifest@0
                displayName: Create imagePullSecret
                inputs:
                  action: createSecret
                  secretName: $(imagePullSecret)
                  dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
    
              - task: KubernetesManifest@0
                displayName: Deploy to Kubernetes cluster
                inputs:
                  rolloutStatusTimeout: 1800
    
                  action: deploy 
                  manifests: |
                    $(Pipeline.Workspace)/manifests/deployment.yml
                    $(Pipeline.Workspace)/manifests/service.yml
                  imagePullSecrets: |
                    $(imagePullSecret)
                  containers: |
                    $(containerRegistry)/$(imageRepository):$(tag)
                timeoutInMinutes: 40
    
    
    
      - deployment: DeployPullRequest
        displayName: Deploy Pull request
        condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/pull/'))
        pool:
          vmImage: $(vmImageName)
    
        environment: 'xapplatform.$(k8sNamespaceForPR)'
        strategy:
          runOnce:
            deploy:
              steps:
              - reviewApp: kube-public
    
              - task: Kubernetes@1
                displayName: 'Create a new namespace for the pull request'
                inputs:
                  command: apply
                  useConfigurationFile: true
                  inline: '{ "kind": "Namespace", "apiVersion": "v1", "metadata": { "name": "$(k8sNamespaceForPR)" }}'
    
              - task: KubernetesManifest@0
                displayName: Create imagePullSecret
                inputs:
                  action: createSecret
                  secretName: $(imagePullSecret)
                  namespace: $(k8sNamespaceForPR)
                  dockerRegistryEndpoint: $(dockerRegistryServiceConnection)
    
              - task: KubernetesManifest@0
                displayName: Deploy to the new namespace in the Kubernetes cluster
                inputs:
                  action: deploy
                  namespace: $(k8sNamespaceForPR)
                  manifests: |
                    $(Pipeline.Workspace)/manifests/deployment.yml
                    $(Pipeline.Workspace)/manifests/service.yml
                  imagePullSecrets: |
                    $(imagePullSecret)
                  containers: |
                    $(containerRegistry)/$(imageRepository):$(tag)
    
              - task: Kubernetes@1
                name: get
                displayName: 'Get services in the new namespace'
                continueOnError: true
                inputs:
                  command: get
                  namespace: $(k8sNamespaceForPR)
                  arguments: svc
                  outputFormat: jsonpath='http://{.items[0].status.loadBalancer.ingress[0].ip}:{.items[0].spec.ports[0].port}'
    
              # Getting the IP of the deployed service and writing it to a variable for posing comment
              - script: |
                  url="$(get.KubectlOutput)"
                  message="Your review app has been deployed"
                  if [ ! -z "$url" -a "$url" != "http://:" ] 
                  then
                    message="${message} and is available at $url.<br><br>[Learn More](https://aka.ms/testwithreviewapps) about how to test and provide feedback for the app."
                  fi
                  echo "##vso[task.setvariable variable=GITHUB_COMMENT]$message"
    
    
    
       ##[section]Starting: Create imagePullSecret
    ==============================================================================
    Task         : Deploy to Kubernetes
    Description  : Use Kubernetes manifest files to deploy to clusters or even bake the manifest files to be used for deployments using Helm charts
    Version      : 0.165.4
    Author       : Microsoft Corporation
    Help         : https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/kubernetes-manifest
    ==============================================================================
    ==============================================================================
                Kubectl Client Version: v1.17.1
                Kubectl Server Version: v1.14.8
    ==============================================================================
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe delete secret xapcontainerregistry4671248d-auth --namespace kube-public
    secret "xapcontainerregistry4671248d-auth" deleted
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe create secret docker-registry xapcontainerregistry4671248d-auth --docker-username *** --docker-password *** --docker-server *** --docker-email ServicePrincipal@AzureRM --namespace kube-public
    secret/xapcontainerregistry4671248d-auth created
    ##[section]Finishing: Create imagePullSecret
    
    ##[section]Starting: Deploy to Kubernetes cluster
    ==============================================================================
    Task         : Deploy to Kubernetes
    Description  : Use Kubernetes manifest files to deploy to clusters or even bake the manifest files to be used for deployments using Helm charts
    Version      : 0.165.4
    Author       : Microsoft Corporation
    Help         : https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/deploy/kubernetes-manifest
    ==============================================================================
    ==============================================================================
                Kubectl Client Version: v1.17.1
                Kubectl Server Version: v1.14.8
    ==============================================================================
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe apply -f d:\a\_temp\Deployment_xap_1583635691677,d:\a\_temp\Service_xap_1583635691677 --namespace kube-public
    deployment.apps/xap configured
    service/xap unchanged
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe rollout status Deployment/xap --timeout 1800s --namespace kube-public
    error: deployment "xap" exceeded its progress deadline
    Waiting for deployment "xap" rollout to finish: 1 old replicas are pending termination...
    Waiting for deployment spec update to be observed...
    Waiting for deployment spec update to be observed...
    Waiting for deployment "xap" rollout to finish: 1 old replicas are pending termination...
    ##[error]Error: error: deployment "xap" exceeded its progress deadline
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe describe Deployment xap --namespace kube-public
    Name:                   xap
    Namespace:              kube-public
    CreationTimestamp:      Fri, 06 Mar 2020 14:16:37 +0000
    Labels:                 app=xap
    Annotations:            deployment.kubernetes.io/revision: 15
                            kubectl.kubernetes.io/last-applied-configuration:
                              {"apiVersion":"apps/v1beta1","kind":"Deployment","metadata":{"annotations":{},"name":"xap","namespace":"kube-public"},"spec":{"progressDea...
    Selector:               app=xap
    Replicas:               1 desired | 1 updated | 2 total | 0 available | 2 unavailable
    StrategyType:           RollingUpdate
    MinReadySeconds:        0
    RollingUpdateStrategy:  25% max unavailable, 25% max surge
    Pod Template:
      Labels:  app=xap
      Containers:
       xap:
        Image:        ***/xap
        Port:         80/TCP
        Host Port:    0/TCP
        Environment:  <none>
        Mounts:       <none>
      Volumes:        <none>
    Conditions:
      Type           Status  Reason
      ----           ------  ------
      Available      False   MinimumReplicasUnavailable
      Progressing    False   ProgressDeadlineExceeded
    OldReplicaSets:  xap-5b95494dd7 (1/1 replicas created)
    NewReplicaSet:   xap-79cc65ddf9 (1/1 replicas created)
    Events:
      Type    Reason             Age   From                   Message
      ----    ------             ----  ----                   -------
      Normal  ScalingReplicaSet  36m   deployment-controller  Scaled down replica set xap-668784656f to 0
      Normal  ScalingReplicaSet  36m   deployment-controller  Scaled up replica set xap-694857dcd8 to 1
      Normal  ScalingReplicaSet  36m   deployment-controller  Scaled down replica set xap-67fd46c7b5 to 0
      Normal  ScalingReplicaSet  36m   deployment-controller  Scaled up replica set xap-79cc65ddf9 to 1
      Normal  ScalingReplicaSet  10m   deployment-controller  Scaled down replica set xap-694857dcd8 to 0
      Normal  ScalingReplicaSet  10m   deployment-controller  Scaled up replica set xap-5b95494dd7 to 1
    For more information, go to https://msasg.visualstudio.com/Bing_and_IPG/_environments/75/providers/kubernetes/12
    [command]C:\ProgramData\Chocolatey\bin\kubectl.exe get service/xap -o json --namespace kube-public
    {
        "apiVersion": "v1",
        "kind": "Service",
        "metadata": {
            "annotations": {
                "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Service\",\"metadata\":{\"annotations\":{},\"name\":\"xap\",\"namespace\":\"kube-public\"},\"spec\":{\"ports\":[{\"port\":80}],\"selector\":{\"app\":\"xap\"},\"type\":\"LoadBalancer\"}}\n"
            },
            "creationTimestamp": "2020-03-06T14:16:38Z",
            "name": "xap",
            "namespace": "kube-public",
            "resourceVersion": "1743607",
            "selfLink": "/api/v1/namespaces/kube-public/services/xap",
            "uid": "17d862ed-5fb5-11ea-ba44-82c49be4b313"
        },
        "spec": {
            "clusterIP": "10.0.76.15",
            "externalTrafficPolicy": "Cluster",
            "ports": [
                {
                    "nodePort": 30742,
                    "port": 80,
                    "protocol": "TCP",
                    "targetPort": 80
                }
            ],
            "selector": {
                "app": "xap"
            },
            "sessionAffinity": "None",
            "type": "LoadBalancer"
        },
        "status": {
            "loadBalancer": {
                "ingress": [
                    {
                        "ip": "52.139.245.51"
                    }
                ]
            }
        }
    }
    service xap external IP is 52.139.245.51
    ##[error]Rollout status check failed.
    ##[section]Finishing: Deploy to Kubernetes cluster
    
    
    
    failed to start container "xap": Error response from daemon: hcsshim::CreateComputeSystem xap: The container operating system does not match the host operating system.