首页 > 代码库 > 一次kubernetes资源文件创建失败的排查

一次kubernetes资源文件创建失败的排查

今天在jenkins中创建kubernetes的rc时,检查目标yaml文件时报出如下错误:

+ /opt/jenkins/kube/kubectl -s http://10.xx.xx.xx:8080 create -f ./WebSituationAnalysis2.0/src/WebSituationAnalysis/rc.yaml
error validating "./WebSituationAnalysis2.0/src/WebSituationAnalysis/rc.yaml": error validating data: [unexpected type: object, unexpected type: object, unexpected type: object]; if you choose to ignore these errors, turn validation off with --validate=false
Build step Execute shell marked build as failure
Finished: FAILURE

 

检查yaml文件并没有语法错误,在kubernetes项目地址中找到对应问题原因:

Updating go-restful to generate

确认jenkins服务器上的kubectl版本为1.2,因此升级到1.3.4版本,重新在jenkins中创建rc成功。

一次kubernetes资源文件创建失败的排查