step:
name: "Deploy to prod environment"
image: atlassian/default-image:2
script:
- source .env
- envsubst < k8s/deploy.yaml > k8s/deploy-apply.yaml
- cat k8s/deploy-apply.yaml
- pipe: atlassian/aws-eks-kubectl-run:2.2.1
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
CLUSTER_NAME: $CLUSTER_NAME
KUBECTL_COMMAND: "apply"
RESOURCE_PATH: "k8s/deploy-apply.yaml"
DEBUG: "true"
字符串
我已经检查了k8s/deploy-apply.yaml
,当手动应用时,它运行成功,在替换下面的变量后,命令运行成功:
kubectl apply -f k8s/deploy-apply.yaml
型
但是在bitbucket-pipeline中运行时,我得到以下错误:
INFO: Successfully updated the kube config.
error: You must be logged in to the server (the server has asked for the client to provide credentials)
✖ spec file validation failed.
型
我已经检查了AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
,它们是有效的,有权限。
1条答案
按热度按时间ut6juiuv1#
您确定此处引用的IAM用户是创建群集的用户吗?当你用根目录创建群集并尝试用IAM用户访问它时,可能会发生此错误。