我面临从Jenkins管道部署到EKS kubernetes中的问题。
我正在使用kuberneter-cd插件并出现以下错误
Loading configuration: /var/lib/jenkins/workspace/jhipprojectmono/kubedeploy.yaml
Api call failed with code 403, detailed message: {
"kind": "Status",
"apiVersion": "v1",
"metadata": {
},
"status": "Failure",
"message": "deployments.apps \"jhipprojectmono\" is forbidden: User \"system:anonymous\" cannot get resource \"deployments\" in API group \"apps\" in the namespace \"default\"",
"reason": "Forbidden",
"details": {
"name": "jhipprojectmono",
"group": "apps",
"kind": "deployments"
},
"code": 403
}
我确实知道这是针对jenkins用户的权限。我已经为jenkins创建了服务角色..但仍然无法正常工作..附加了kubeconfig以供参考。
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: LS0tLS1...
server: https://xxxx.yl4.us-east-1.eks.amazonaws.com
name: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
contexts:
- context:
cluster: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
namespace: default
user: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
name: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
- context:
cluster: finmanagercluster
user: jenkins
name: finmanagercluster-context
- context:
cluster: ""
namespace: default
user: jenkins
name: gce
current-context: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
kind: Config
preferences: {}
users:
- name: arn:aws:eks:us-east-1:yyyy:cluster/finmanagercluster
user:
exec:
apiVersion: client.authentication.k8s.io/v1alpha1
args:
- --region
- us-east-1
- eks
- get-token
- --cluster-name
- finmanagercluster
command: aws
env: null
我想念的一切
我正在使用kubernetes-CD插件..