User:gitlab-ci,保存生成的Access key ID和Secret Access Key,后面会用到
Group:Gitlab.CI,添加Policy如下:
Policy Name |
---|
AmazonEKSWorkerNodePolicy |
AmazonEC2ContainerRegistryFullAccess |
AmazonEC2ContainerRegistryReadOnly |
AmazonEC2ContainerServiceFullAccess |
AmazonEKS_CNI_Policy |
将user gitlab-ci添加到Group Gitlab.CI
kubectl edit cm aws-auth -n kube-system
在mapUsers键追加:
- "groups":
- "system:masters"
"userarn": "arn:aws:iam::xxxxxxx:user/gitlab-ci"
"username": "gitlab-ci"
Setting => CI/CD => Variables,添加变量: