问题描述
试图将GitLab 13.3.2 CE(部署在本地服务器上)与EKS集成。
第二,我使用指定链接中提到的策略在各自的帐户中创建了一个IAM角色。 (https://docs.gitlab.com/ce/user/project/clusters/add_eks_clusters.html)精心执行了此链接中提到的所有步骤。
aws iam角色附带的政策,
以下是创建IAM角色的步骤,
{
"Version": "2012-10-17","Statement": [
{
"Effect": "Allow","Action": [
"autoscaling:CreateAutoScalingGroup","autoscaling:DescribeAutoScalingGroups","autoscaling:DescribeScalingActivities","autoscaling:UpdateAutoScalingGroup","autoscaling:CreateLaunchConfiguration","autoscaling:DescribeLaunchConfigurations","cloudformation:CreateStack","cloudformation:DescribeStacks","ec2:AuthorizeSecurityGroupEgress","ec2:AuthorizeSecurityGroupIngress","ec2:RevokeSecurityGroupEgress","ec2:RevokeSecurityGroupIngress","ec2:CreateSecurityGroup","ec2:createTags","ec2:DescribeImages","ec2:DescribeKeyPairs","ec2:DescribeRegions","ec2:DescribeSecurityGroups","ec2:Describesubnets","ec2:DescribeVpcs","eks:CreateCluster","eks:DescribeCluster","iam:AddRoletoInstanceProfile","iam:AttachRolePolicy","iam:CreateRole","iam:CreateInstanceProfile","iam:CreateServiceLinkedRole","iam:GetRole","iam:ListRoles","iam:PassRole","ssm:GetParameters"
],"Resource": "*"
}
]
}
此后,我复制了新创建角色的ARN,并在“我的项目”的Kubernetes部分中使用了它。 ()
已将其作为响应Error: Request Failed with status code 422
Response after clicking on "Authenticate with AWS"
解决方法
将此策略附加到在GitLab中启用EKS时使用了访问密钥和秘密密钥的用户。
{
"Version": "2012-10-17","Statement": {
"Effect": "Allow","Action": "sts:AssumeRole","Resource": "arn:aws:iam::<<account-id>>:role/gitlab-eks-4"
}
}
这为用户提供了担任gitlab-eks角色的特权(已创建该角色,并且在进行EKS集成时已赋予其ARN)