Prepare the AWS configuration

  1. On the bootstrap node, verify access to the target cloud endpoint from Docker. For example:

    docker run --rm alpine sh -c "apk add --no-cache curl; \
    curl https://ec2.amazonaws.com"
    

    The system output not must contain error records.

  2. Generate the AWS Access Key ID with Secret Access Key for the user with the IAMFullAccess permissions and select the AWS default region name. For details, see AWS General Reference: Programmatic access.

  3. Change the directory to the kaas-bootstrap folder created by the get_container_cloud.sh script.

  4. Export the following parameters by adding the corresponding values for the AWS IAMFullAccess user credentials created in the previous step:

    export KAAS_AWS_ENABLED=true
    export AWS_SECRET_ACCESS_KEY=XXXXXXX
    export AWS_ACCESS_KEY_ID=XXXXXXX
    export AWS_DEFAULT_REGION=us-east-2
    
  5. For Container Cloud to communicate with the AWS APIs, create the AWS CloudFormation stack that contains properly configured IAM users and policies.

    Note

    If the AWS CloudFormation stack already exists in your AWS account, skip this step.

    ./container-cloud bootstrap aws policy
    

    If you do not have access to create the CloudFormation stack, users, or policies:

    1. Log in to your AWS Management Console.

    2. On the home page, expand the upper right menu with your user name and capture your Account ID.

    3. Create the CloudFormation template:

      ./container-cloud bootstrap aws policy --account-id <accountId> --dump > cf.yaml
      

      Substitute the parameter enclosed in angle brackets with the corresponding value.

    4. Send the cf.yaml template to your AWS account admin to create the CloudFormation stack from this template.

  6. Configure the bootstrapper.cluster-api-provider-aws.kaas.mirantis.com user created in the previous steps:

    1. Using your AWS Management Console, generate the AWS Access Key ID with Secret Access Key for bootstrapper.cluster-api-provider-aws.kaas.mirantis.com and select the AWS default region name.

      Note

      Other authorization methods, such as usage of AWS_SESSION_TOKEN, are not supported.

    2. Export the AWS bootstrapper.cluster-api-provider-aws.kaas.mirantis.com user credentials that were created in the previous step:

      export KAAS_AWS_ENABLED=true
      export AWS_SECRET_ACCESS_KEY=XXXXXXX
      export AWS_ACCESS_KEY_ID=XXXXXXX
      export AWS_DEFAULT_REGION=us-east-2
      
  7. In templates/aws/machines.yaml.template, modify the spec:providerSpec:value section by substituting the ami:id parameter with the corresponding value for Ubuntu 18.04 from the required AWS region. For example:

    spec:
      providerSpec:
        value:
          apiVersion: aws.kaas.mirantis.com/v1alpha1
          kind: AWSMachineProviderSpec
          instanceType: c5d.2xlarge
          ami:
            id: ami-033a0960d9d83ead0
    
  8. Optional. If you are going to use your own TLS certificates for Keycloak, set DISABLE_OIDC=true in bootstrap.env.