AWS CodeBuild kubectl apply -f无法识别:未授权

问题描述 投票:0回答:1

构建过程失败,出现此错误:

[Container] 2019/12/12 08:07:41 Running command kubectl apply -f simple_jwt_api.yml 
unable to recognize "simple_jwt_api.yml": Unauthorized 
unable to recognize "simple_jwt_api.yml": Unauthorized 
[Container] 2019/12/12 08:07:43 Command did not exit successfully kubectl apply -f simple_jwt_api.yml exit status 1 
[Container] 2019/12/12 08:07:43 Phase complete: POST_BUILD State: FAILED 
[Container] 2019/12/12 08:07:43 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: kubectl apply -f simple_jwt_api.yml. Reason: exit status 1 

simple_jwt_api.yml文件:simple_jwt_api.yml

建筑脚本文件:buildspec.yml

构建日志:

[Container] 2019/12/12 08:07:41 Running command kubectl apply -f simple_jwt_api.yml 
unable to recognize "simple_jwt_api.yml": Unauthorized 
unable to recognize "simple_jwt_api.yml": Unauthorized 

[Container] 2019/12/12 08:07:43 Command did not exit successfully kubectl apply -f simple_jwt_api.yml exit status 1 
[Container] 2019/12/12 08:07:43 Phase complete: POST_BUILD State: FAILED 
[Container] 2019/12/12 08:07:43 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: kubectl apply -f simple_jwt_api.yml. Reason: exit status 1 
[Container] 2019/12/12 08:07:43 Expanding base directory path: . 
[Container] 2019/12/12 08:07:43 Assembling file list 
[Container] 2019/12/12 08:07:43 Expanding . 
[Container] 2019/12/12 08:07:43 Expanding file paths for base directory . 
[Container] 2019/12/12 08:07:43 Assembling file list 
[Container] 2019/12/12 08:07:43 Expanding build.json 
[Container] 2019/12/12 08:07:43 Skipping invalid file path build.json 
[Container] 2019/12/12 08:07:43 Phase complete: UPLOAD_ARTIFACTS State: FAILED 
[Container] 2019/12/12 08:07:43 Phase context status code: CLIENT_ERROR Message: no matching artifact paths found 
kubectl aws-codebuild
1个回答
0
投票

Buildspec看起来不错,所以我怀疑您的CodeBuild服务角色中包含'/ path /',当使用iam身份验证器对EKS进行身份验证时,这会引起问题。

© www.soinside.com 2019 - 2024. All rights reserved.