Was trying to integrate GitLab 13.3.2 CE (deployed on On-Prem server) with EKS.
Secondly I created an IAM role in the respective account with the policies mentioned in the link specified. (https://docs.gitlab.com/ce/user/project/clusters/add_eks_clusters.html) Followed all the steps mentioned in this link meticulously.
Policy attached to the aws iam role,
Following were the steps to create the IAM Role,
- Logged in to IAM Console
- Clicked on Roles section in the left menu.
- Select Type of Trusted Entity as "Another AWS account"
- Filled in the Account ID
- Provided the External ID mentioned in GitLab Project's Kubernetes console
{
"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": "*"
}
]
}
After this I copied the ARN of the newly created role and Used it in My Project's Kubernetes section. ()
Had got this as the response Error: Request failed with status code 422