Create the EKSFullAccess policy that allows us access to EKS and ECR.
Give the policy the name and description.
Name: EKSFullAccess Description: Allows full admin access for EKS and ECR resources.
To create a service-linked role:
Back at the Roles page, click the role you just created to show the details. Copy the ARN. We’ll be using it in the IAM Policy next.
arn:aws:iam::1234567890:role/aws-service-role/eks.amazonaws.com/AWSServiceRoleForAmazonEKS
Refer to the links below.
For the keypair, store it inside ~/.ssh
directory.
For the IAM User and Group, you can use the values below. Make sure to add the user to the group.
While you can attach the EKSFullAccess policy to your user, you can also give it the AdministratorAccess. Once you’ve created the k8s-admin
, log-in to the AWS Management Console using this IAM user.
Create the k8s-lab group.
Filter and add the following policy.
Note: You may encounter some issue when using this user with limited IAM permissions. As a workaround, you can attach the AdministratorAccess to the user.
Make sure you’ve installed AWS CLI in your terminal
In your terminal, configure the .aws/credentials
file that’s automatically created in your home directory. Supply the access key ID and secret access key which you downloaded in the previous step.
$ vim ~/.aws/credentials
# /home/user/.aws/credentials
[k8s-admin]
aws_access_key_id = AKIAxxxxxxxxxxxxxxxxxxx
aws_secret_access_key = ABCDXXXXXXXXXXXXXXXXXXXXXXX
region = ap-southeast-1
output = json
You can use a different profile name. To use the profile, export it as a variable.
$ export AWS_PROFILE=k8s-admin
To verify, we can run the commands below:
$ aws configure list
$ aws sts get-caller-identity
Although the region is already set in the profile, we’ll also be using the region in many of the commands. We can save it as a variable.
$ export AWSREGION=ap-southeast-1