Setting up your AWS Account for PMK

This article describes how to configure AWS so that we can add it as a Cloud Provider for Platform9 Managed Kubernetes (PMK). We will add a user, group, policy, EC2 key pair, and a domain to our account. There are a few prerequisites that need to be met before we get started.

Prerequisites

  • An AWS Administrative User or Account with IAM Admin Permissions
  • AWS CLI installed
  • A registered Domain Name (optional - Register a domain through Route53)

Configure CLI

Once the administrative user has been created, and the CLI has been installed, we can move on to configuring the CLI. To configure the CLI we will need our Access Key ID and Secret Access Key. In this guide we are going to use the us-west-2 region as the default.

AWS Configure
Copy
Output
Copy

For a full CLI reference refer to: (optional) https://docs.aws.amazon.com/cli/latest/reference/

Setup User

This user account will be used to configure access for the AWS Cloud Provider in PMK.

Create User

Create User
Copy

Create Access Key and save it to platform9.json

We will create an access key for the user and save it to a platform9.json file so that we can reference it when setting up the AWS Cloud Provider in PMK.

Create Access Key
Copy

Setup Group

We are using a group for policy attachment instead of applying it directly to a user. This can be beneficial in case we want to add additional users with the same permission set, instead of having to apply the policy to each user individually.

Create Group

Create Group
Copy

Add User to Group

Add User to Group
Copy

Setup Policy

The policy will be used to configure the required permissions needed by PMK to deploy Kubernetes clusters in AWS.

Download the aws-policy.json file

The aws-policy.json file will allow for adding the permissions needed without having to add each permission individually.

Download Policy json
Copy

Create Policy based on aws-policy.json

We need to create a new policy so that we can attach it to the group. Create the policy and save the output to policy-info.json so that the ARN can be referenced for additional commands.

Create Policy
Copy

View details about the policy (optional)

Get Policy
Copy

Attach Policy to the Group

Attach Policy
Copy

View policies attached to the group (optional)

View Policies attached to Group
Copy

Create EC2 Key Pair

The region we are using in this guide is us-west-2. If a different region is required, replace the region name used for the --region flag.

Create EC2 Key Pair
Copy

Route53 Setup

Add Domain / Hosted Zone

A Route53 hosted zone is needed to configure the AWS Cloud Provider. Replace $HOSTEDZONE with the hosted zone being used for this deployment. A hosted zone is usually a domain name or FQDN.

Create Hosted Zone
Copy

Get NS for the domain

First we need to find the id of our hosted zone. Find the recently added hosted zone in the list-hosted-zone output and note the id.

List Hosted Zones
Copy

Next we will run get-hosted-zone on the id which will output the Nameservers for our Route53 hosted zone.

Get Hosted Zone NS
Copy

Modify the Nameservers for your domain through the registrar. Use an already registered domain.

Register your domain through Route53 (This is an optional step. Do this if you want your PMK cluster API server endpoint to have an FQDN that uses your specific domain. If you do not configure this, the PMK cluster API server end point will be the url corresponding to the ELB auto generated domain name)

https://docs.aws.amazon.com/cli/latest/reference/route53domains/register-domain.html

And now your AWS account is ready to be added as a cloud provider to PMK!

Next Steps

Follow these steps to Create a new PMK AWS cloud provider and then Create a Kubernetes cluster using PMK

Cleanup

If you want to remove your AWS cloud provider you created for PMK, and remove the additions we made in this guide, follow the steps outlined below.

Route53 Cleanup

List Hosted Zones
Copy
Delete Hosted Zone
Copy

Key Pair Cleanup

Describe the key pair (optional)

Describe Key Pairs
Copy

Delete the key pair

Delete Key Pair
Copy

Policy Cleanup

List Policies
Copy
Detach Policy
Copy
Delete Policy
Copy

Group Cleanup

Remove User From Group
Copy
Delete Group
Copy

User Cleanup

List Access Keys for User
Copy
Delete Access Key
Copy
Delete User
Copy
Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard