在Azure Devops发布管道中进行Kubectl部署失败,并显示AKS群集的退出代码1

如何解决在Azure Devops发布管道中进行Kubectl部署失败,并显示AKS群集的退出代码1

我会问是否有人可以帮助我通往AKS集群的发布管道失败。我正在使用Azure Devops发布管道。

2020-09-02T10:56:33.1944594Z ##[section]Starting: kubectl create app and service or apply
2020-09-02T10:56:33.2380678Z ==============================================================================
2020-09-02T10:56:33.2381778Z Task         : Kubectl
2020-09-02T10:56:33.2384698Z Description  : Deploy,configure,update a Kubernetes cluster in Azure Container Service by running kubectl commands
2020-09-02T10:56:33.2385174Z Version      : 1.173.0
2020-09-02T10:56:33.2386143Z Author       : Microsoft Corporation
2020-09-02T10:56:33.2387216Z Help         : https://aka.ms/azpipes-kubectl-tsg
2020-09-02T10:56:33.2387656Z ==============================================================================
2020-09-02T10:56:34.9075560Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.7.0/bin/windows/amd64/kubectl.exe
2020-09-02T10:56:37.8112374Z Caching tool: kubectl 1.7.0 x64
2020-09-02T10:56:37.9135761Z Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\kubectl\1.7.0\x64
2020-09-02T10:56:40.4896282Z Could not fetch Kubectl version. Please make sure that the Kubernetes server is up and running.
2020-09-02T10:56:40.5241929Z [command]C:\hostedtoolcache\windows\kubectl\1.7.0\x64\kubectl.exe apply -f D:\a\r1\a\_praneshshzl_AKSCICDDEMO\aksdeploy.yml -o json
2020-09-02T10:56:49.8395443Z {
2020-09-02T10:56:49.8397440Z     "apiVersion": "apps/v1",2020-09-02T10:56:49.8398489Z     "kind": "Deployment",2020-09-02T10:56:49.8399348Z     "metadata": {
2020-09-02T10:56:49.8400030Z         "annotations": {
2020-09-02T10:56:49.8401188Z             "deployment.kubernetes.io/revision": "2",2020-09-02T10:56:49.8404455Z             "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"kind\":\"Deployment\",\"metadata\":{\"annotations\":{},\"name\":\"aspx-deployment\",\"namespace\":\"default\"},\"spec\":{\"replicas\":2,\"selector\":{\"matchLabels\":{\"app\":\"asp-net\"}},\"template\":{\"metadata\":{\"labels\":{\"app\":\"asp-net\"}},\"spec\":{\"containers\":[{\"image\":\"***/drop:40\",\"name\":\"asp\",\"ports\":[{\"containerPort\":80}]}]}}}}\n"
2020-09-02T10:56:49.8406762Z         },2020-09-02T10:56:49.8407640Z         "creationTimestamp": "2020-09-02T07:19:54Z",2020-09-02T10:56:49.8408392Z         "generation": 2,2020-09-02T10:56:49.8409051Z         "name": "aspx-deployment",2020-09-02T10:56:49.8409752Z         "namespace": "default",2020-09-02T10:56:49.8410403Z         "resourceVersion": "19157",2020-09-02T10:56:49.8411229Z         "selfLink": "/apis/apps/v1/namespaces/default/deployments/aspx-deployment",2020-09-02T10:56:49.8412093Z         "uid": "57c18e4d-0583-43bc-b0c4-58d6bb2c9069"
2020-09-02T10:56:49.8413323Z     },2020-09-02T10:56:49.8413859Z     "spec": {
2020-09-02T10:56:49.8414348Z         "progressDeadlineSeconds": 600,2020-09-02T10:56:49.8414799Z         "replicas": 2,2020-09-02T10:56:49.8415097Z         "revisionHistoryLimit": 10,2020-09-02T10:56:49.8415368Z         "selector": {
2020-09-02T10:56:49.8415640Z             "matchLabels": {
2020-09-02T10:56:49.8416109Z                 "app": "asp-net"
2020-09-02T10:56:49.8416360Z             }
2020-09-02T10:56:49.8416549Z         },2020-09-02T10:56:49.8416778Z         "strategy": {
2020-09-02T10:56:49.8417054Z             "rollingUpdate": {
2020-09-02T10:56:49.8417341Z                 "maxSurge": "25%",2020-09-02T10:56:49.8417658Z                 "maxUnavailable": "25%"
2020-09-02T10:56:49.8417927Z             },2020-09-02T10:56:49.8418189Z             "type": "RollingUpdate"
2020-09-02T10:56:49.8418422Z         },2020-09-02T10:56:49.8418649Z         "template": {
2020-09-02T10:56:49.8419141Z             "metadata": {
2020-09-02T10:56:49.8419452Z                 "creationTimestamp": null,2020-09-02T10:56:49.8419748Z                 "labels": {
2020-09-02T10:56:49.8420044Z                     "app": "asp-net"
2020-09-02T10:56:49.8420308Z                 }
2020-09-02T10:56:49.8420525Z             },2020-09-02T10:56:49.8420745Z             "spec": {
2020-09-02T10:56:49.8422686Z                 "containers": [
2020-09-02T10:56:49.8422953Z                     {
2020-09-02T10:56:49.8423661Z                         "image": "***/drop:40",2020-09-02T10:56:49.8424053Z                         "imagePullPolicy": "IfNotPresent",2020-09-02T10:56:49.8424416Z                         "name": "asp",2020-09-02T10:56:49.8424731Z                         "ports": [
2020-09-02T10:56:49.8425016Z                             {
2020-09-02T10:56:49.8425324Z                                 "containerPort": 80,2020-09-02T10:56:49.8425698Z                                 "protocol": "TCP"
2020-09-02T10:56:49.8426026Z                             }
2020-09-02T10:56:49.8426285Z                         ],2020-09-02T10:56:49.8426562Z                         "resources": {},2020-09-02T10:56:49.8426957Z                         "terminationMessagePath": "/dev/termination-log",2020-09-02T10:56:49.8427380Z                         "terminationMessagePolicy": "File"
2020-09-02T10:56:49.8427696Z                     }
2020-09-02T10:56:49.8427918Z                 ],2020-09-02T10:56:49.8428205Z                 "dnsPolicy": "ClusterFirst",2020-09-02T10:56:49.8428542Z                 "restartPolicy": "Always",2020-09-02T10:56:49.8428896Z                 "schedulerName": "default-scheduler",2020-09-02T10:56:49.8429231Z                 "securityContext": {},2020-09-02T10:56:49.8429585Z                 "terminationGracePeriodSeconds": 30
2020-09-02T10:56:49.8429873Z             }
2020-09-02T10:56:49.8430792Z         }
2020-09-02T10:56:49.8431012Z     },2020-09-02T10:56:49.8431285Z     "status": {
2020-09-02T10:56:49.8431559Z         "availableReplicas": 2,2020-09-02T10:56:49.8431825Z         "conditions": [
2020-09-02T10:56:49.8432059Z             {
2020-09-02T10:56:49.8432383Z                 "lastTransitionTime": "2020-09-02T07:19:54Z",2020-09-02T10:56:49.8432798Z                 "lastUpdateTime": "2020-09-02T07:37:15Z",2020-09-02T10:56:49.8433255Z                 "message": "ReplicaSet \"aspx-deployment-84597d88f5\" has successfully progressed.",2020-09-02T10:56:49.8434044Z                 "reason": "NewReplicaSetAvailable",2020-09-02T10:56:49.8434679Z                 "status": "True",2020-09-02T10:56:49.8435244Z                 "type": "Progressing"
2020-09-02T10:56:49.8435605Z             },2020-09-02T10:56:49.8435825Z             {
2020-09-02T10:56:49.8436146Z                 "lastTransitionTime": "2020-09-02T10:53:01Z",2020-09-02T10:56:49.8436562Z                 "lastUpdateTime": "2020-09-02T10:53:01Z",2020-09-02T10:56:49.8436957Z                 "message": "Deployment has minimum availability.",2020-09-02T10:56:49.8437364Z                 "reason": "MinimumReplicasAvailable",2020-09-02T10:56:49.8437756Z                 "status": "True",2020-09-02T10:56:49.8438064Z                 "type": "Available"
2020-09-02T10:56:49.8438304Z             }
2020-09-02T10:56:49.8438510Z         ],2020-09-02T10:56:49.8438765Z         "observedGeneration": 2,2020-09-02T10:56:49.8439067Z         "readyReplicas": 2,2020-09-02T10:56:49.8439325Z         "replicas": 2,2020-09-02T10:56:49.8439604Z         "updatedReplicas": 2
2020-09-02T10:56:49.8439834Z     }
2020-09-02T10:56:49.8440256Z }
2020-09-02T10:56:50.0434980Z error: error validating "D:\\a\\r1\\a\\_praneshshzl_AKSCICDDEMO\\aksdeploy.yml": error validating data: the server could not find the requested resource; if you choose to ignore these errors,turn validation off with --validate=false
2020-09-02T10:56:50.0592077Z commandOutput{
2020-09-02T10:56:50.0592764Z     "apiVersion": "apps/v1",2020-09-02T10:56:50.0593476Z     "kind": "Deployment",2020-09-02T10:56:50.0593853Z     "metadata": {
2020-09-02T10:56:50.0594453Z         "annotations": {
2020-09-02T10:56:50.0617018Z             "deployment.kubernetes.io/revision": "2",2020-09-02T10:56:50.0619826Z             "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"apps/v1\",\"ports\":[{\"containerPort\":80}]}]}}}}\n"
2020-09-02T10:56:50.0622683Z         },2020-09-02T10:56:50.0623075Z         "creationTimestamp": "2020-09-02T07:19:54Z",2020-09-02T10:56:50.0623735Z         "generation": 2,2020-09-02T10:56:50.0624085Z         "name": "aspx-deployment",2020-09-02T10:56:50.0624371Z         "namespace": "default",2020-09-02T10:56:50.0624697Z         "resourceVersion": "19157",2020-09-02T10:56:50.0628209Z         "selfLink": "/apis/apps/v1/namespaces/default/deployments/aspx-deployment",2020-09-02T10:56:50.0628683Z         "uid": "57c18e4d-0583-43bc-b0c4-58d6bb2c9069"
2020-09-02T10:56:50.0628948Z     },2020-09-02T10:56:50.0629156Z     "spec": {
2020-09-02T10:56:50.0629632Z         "progressDeadlineSeconds": 600,2020-09-02T10:56:50.0629958Z         "replicas": 2,2020-09-02T10:56:50.0630236Z         "revisionHistoryLimit": 10,2020-09-02T10:56:50.0633694Z         "selector": {
2020-09-02T10:56:50.0634104Z             "matchLabels": {
2020-09-02T10:56:50.0634389Z                 "app": "asp-net"
2020-09-02T10:56:50.0634654Z             }
2020-09-02T10:56:50.0634863Z         },2020-09-02T10:56:50.0635116Z         "strategy": {
2020-09-02T10:56:50.0635383Z             "rollingUpdate": {
2020-09-02T10:56:50.0635685Z                 "maxSurge": "25%",2020-09-02T10:56:50.0636003Z                 "maxUnavailable": "25%"
2020-09-02T10:56:50.0636322Z             },2020-09-02T10:56:50.0636572Z             "type": "RollingUpdate"
2020-09-02T10:56:50.0636821Z         },2020-09-02T10:56:50.0637050Z         "template": {
2020-09-02T10:56:50.0637316Z             "metadata": {
2020-09-02T10:56:50.0637611Z                 "creationTimestamp": null,2020-09-02T10:56:50.0637922Z                 "labels": {
2020-09-02T10:56:50.0638230Z                     "app": "asp-net"
2020-09-02T10:56:50.0638483Z                 }
2020-09-02T10:56:50.0638819Z             },2020-09-02T10:56:50.0639105Z             "spec": {
2020-09-02T10:56:50.0639388Z                 "containers": [
2020-09-02T10:56:50.0639651Z                     {
2020-09-02T10:56:50.0640045Z                         "image": "***/drop:40",2020-09-02T10:56:50.0640435Z                         "imagePullPolicy": "IfNotPresent",2020-09-02T10:56:50.0640782Z                         "name": "asp",2020-09-02T10:56:50.0641098Z                         "ports": [
2020-09-02T10:56:50.0641395Z                             {
2020-09-02T10:56:50.0642030Z                                 "containerPort": 80,2020-09-02T10:56:50.0642527Z                                 "protocol": "TCP"
2020-09-02T10:56:50.0642853Z                             }
2020-09-02T10:56:50.0643111Z                         ],2020-09-02T10:56:50.0643405Z                         "resources": {},2020-09-02T10:56:50.0643802Z                         "terminationMessagePath": "/dev/termination-log",2020-09-02T10:56:50.0644232Z                         "terminationMessagePolicy": "File"
2020-09-02T10:56:50.0644550Z                     }
2020-09-02T10:56:50.0644768Z                 ],2020-09-02T10:56:50.0645058Z                 "dnsPolicy": "ClusterFirst",2020-09-02T10:56:50.0645398Z                 "restartPolicy": "Always",2020-09-02T10:56:50.0645752Z                 "schedulerName": "default-scheduler",2020-09-02T10:56:50.0646087Z                 "securityContext": {},2020-09-02T10:56:50.0646605Z                 "terminationGracePeriodSeconds": 30
2020-09-02T10:56:50.0646902Z             }
2020-09-02T10:56:50.0647131Z         }
2020-09-02T10:56:50.0647308Z     },2020-09-02T10:56:50.0647518Z     "status": {
2020-09-02T10:56:50.0647785Z         "availableReplicas": 2,2020-09-02T10:56:50.0648069Z         "conditions": [
2020-09-02T10:56:50.0648292Z             {
2020-09-02T10:56:50.0648700Z                 "lastTransitionTime": "2020-09-02T07:19:54Z",2020-09-02T10:56:50.0649116Z                 "lastUpdateTime": "2020-09-02T07:37:15Z",2020-09-02T10:56:50.0649585Z                 "message": "ReplicaSet \"aspx-deployment-84597d88f5\" has successfully progressed.",2020-09-02T10:56:50.0650020Z                 "reason": "NewReplicaSetAvailable",2020-09-02T10:56:50.0650354Z                 "status": "True",2020-09-02T10:56:50.0650662Z                 "type": "Progressing"
2020-09-02T10:56:50.0650920Z             },2020-09-02T10:56:50.0651117Z             {
2020-09-02T10:56:50.0651508Z                 "lastTransitionTime": "2020-09-02T10:53:01Z",2020-09-02T10:56:50.0652363Z                 "lastUpdateTime": "2020-09-02T10:53:01Z",2020-09-02T10:56:50.0652807Z                 "message": "Deployment has minimum availability.",2020-09-02T10:56:50.0653184Z                 "reason": "MinimumReplicasAvailable",2020-09-02T10:56:50.0653520Z                 "status": "True",2020-09-02T10:56:50.0653840Z                 "type": "Available"
2020-09-02T10:56:50.0654095Z             }
2020-09-02T10:56:50.0654285Z         ],2020-09-02T10:56:50.0654538Z         "observedGeneration": 2,2020-09-02T10:56:50.0654831Z         "readyReplicas": 2,2020-09-02T10:56:50.0655099Z         "replicas": 2,2020-09-02T10:56:50.0655360Z         "updatedReplicas": 2
2020-09-02T10:56:50.0655592Z     }
2020-09-02T10:56:50.0655767Z }
2020-09-02T10:56:50.0655889Z 
2020-09-02T10:56:52.6885299Z ##[error]The process 'C:\hostedtoolcache\windows\kubectl\1.7.0\x64\kubectl.exe' failed with exit code 1
2020-09-02T10:56:52.7480636Z ##[section]Finishing: kubectl create app and service or apply

我的aksdeploy.yml文件位于https://github.com/praneshshzl/AKSCICDDEMO/blob/master/aksdeploy.yml

我要部署的映像是基于Windows的docker hub映像,位于https://hub.docker.com/repository/docker/praneshhzl/drop

解决方法

看起来这是在发布管道中的kubectl apply任务中要做的事情。我们必须转到右窗格,向下滚动,展开“高级”,然后在版本规范中选中“检查最新版本” 框。我的管道构建成功完成。我的部署Yaml中没有问题。

启用此选项可确保下载了正确的kubectl.exe最新版本。 进入VSTS代理

Downloading: https://storage.googleapis.com/kubernetes-release/release/stable.txt
2020-09-02T12:18:39.3539227Z Downloading: https://storage.googleapis.com/kubernetes-release/release/v1.19.0/bin/windows/amd64/kubectl.exe
2020-09-02T12:18:40.7266540Z Caching tool: kubectl 1.19.0 x64
2020-09-02T12:18:40.8028720Z Prepending PATH environment variable with directory: C:\hostedtoolcache\windows\kubectl\1.19.0\x64
2020-09-02T12:18:43.3630075Z ==============================================================================
2020-09-02T12:18:43.3632157Z            Kubectl Client Version: v1.19.0
2020-09-02T12:18:43.3633193Z            Kubectl Server Version: v1.16.13
2020-09-02T12:18:43.3633757Z ==============================================================================

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-