Setting up EKS Cluster in Amazon Web Services(AWS)

If you do not have a valid HiveMQ license, the HiveMQ cluster uses a trial licence that allows up to 25 concurrent client connections and is limited to testing and evaluation purposes only. To obtain a HiveMQ licence that is suitable for production use, or request an evaluation licence that allows more connections, contact our customer service team.

While creating this guide, our Kubernetes Version is v1.27.9, it might be different in your case

Requirements

Set Up Your Kubernetes Cluster With Elastic Kubernetes Service (EKS)

  1. Create a New IAM User

    1. Run the following command to create a new IAM user:

    2. Attach AdministratorAccess Policy

      Run the following command to attach the AdministratorAccess policy to the newly created user:

    3. Create Access Key

      Run the following command to create an access key for the user:

    4. Following is the output displayed after the successful creation of the access key, Please copy and save AccessKeyId and SecretAccessKey values for the next steps.

    5. Run the following command:

      1. Optionally, you can configure a named profile, such as --profile cluster-admin. If you configure a named profile in the AWS CLI, you must always pass this flag in subsequent commands.

    6. This command will prompt you to enter the following information:

      1. AWS Access Key ID: Enter your AWS access key.

      2. AWS Secret Access Key: Enter your AWS secret key.

      3. Default region name: Enter the AWS region you want to use (e.g., us-west-1).

      4. Default output format: You can leave this as json.
        For example:

Create EKS Cluster

In case of errors in the following command “request send failed, Post "https://sts.eu-east-1.amazonaws.com/", please try changing some other region e.g. eu-west-1

  1. To create an EKS cluster with all the necessary resources for your cluster, enter the following command with the desired location (in this procedure, we use eu-west-1) and instance type c5.2xlarge (8 CPUs, 16 GiB RAM), enter the following command and wait until the process completes. Processing time take up to ~5 minutes and can vary:

Above command will also create IAM role and required permissions for eksctl.

Your AWS account bills you for all resources you create.

Manage the cluster

  1. To manage the resulting Kubernetes cluster with kubectl, download the access credentials of the cluster: (region eu-west-1 in our case, please replace it with your region)

  2. To verify that all three nodes are available, enter:

  3. The output from the command is similar to the following: (k8s v1.27.9 in our case, it might be different for you)

Delete Cluster

If you do not need your cluster anymore, please use the following commands to delete the cluster.

  1. List all services running in your cluster.

  2. Delete any services that have an associated EXTERNAL-IP value. These services are fronted by an Elastic Load Balancing load balancer, and you must delete them in Kubernetes to allow the load balancer and associated resources to be properly released.

  3. Delete the load balancer from AWS console.

  4. Delete the cluster and its associated nodes with the following command,

     

Next steps

Install HiveMQ using Kubernetes Operator