Overview 🔗︎

Amazon Elastic Kubernetes Service (Amazon EKS) makes it easy to deploy, manage, and scale containerized applications using Kubernetes on AWS.

This quickstart will guide you through the steps needed to set up an Amazon EKS cluster with Banzai Cloud Pipeline.

Prerequisites 🔗︎

  • AWS credentials
  • Banzai CLI tool authenticated against the Pipeline instance

Create an AWS secret 🔗︎

In order to access resources on AWS the appropriate credentials need to be registered in the Banzai Cloud Pipeline’s secret store. (The reference to this secret will be used later on instead of passing the credentials around.)

  1. Follow this guide to create EKS AWS credentials.

    The following values are needed for the secret:

    • AWS Access Key ID
    • AWS Secret Access Key
    • Default region name
  2. Add the secret to Banzai Cloud Pipeline’s secret store using one of the following methods:

    • If the AWS credentials are available in the local environment, you can use the following command:

      banzai secret create -t amazon -n eks-aws-secret --magic --tag ""
      
    • Otherwise, run the following command (replace the values in the curly braces):

      banzai secret create <<EOF 
      {
          "name": "eks-aws-secret",
          "type": "amazon",
          "values": {
            "AWS_ACCESS_KEY_ID": "{{aws_access_key_id}}",
            "AWS_DEFAULT_REGION": "{{aws_default_region}}",
            "AWS_SECRET_ACCESS_KEY": "{{aws_secret_access_key}}"
          }
      }
      EOF
      Id                                                                Name     Type    UpdatedBy  Tags
      b32343e28d37e09c26d91b4271eaa8dd689b16d9f1aba07fdc73af2a27750309  eks-aws-secret  amazon  lpuskas    []
      
    • You can also use the Pipeline web UI to add the secret.

Create EKS clusters on AWS 🔗︎

To create EKS clusters on AWS using the CLI, complete the following steps. Alternatively, you can use the Pipeline web UI.

You can check the available regions and instance types in our Cloudinfo service.

  1. Create a cluster descriptor JSON file. This file specifies the properties of the cluster you want to create.

    For the details of the possible options and values you can use in the descriptor, see Create cluster descriptor reference for EKS and the examples on this page.

    1. To list the AWS regions where the EKS service is supported, run:

      curl https://banzaicloud.com/cloudinfo/api/v1/providers/amazon/services/eks/regions | jq .
      
    2. To list the supported EKS versions in a given region, run the following command:

      curl https://banzaicloud.com/cloudinfo/api/v1/providers/amazon/services/eks/regions/eu-west-1/versions | jq .
      
  2. Log in to Pipeline.

  3. Create the cluster by running the following command:

    banzai cluster create --file <path-to-cluster-descriptor-json>
    
  4. Check the status of the cluster.

    To check the status of the cluster, run the following command:

    banzai cluster get "<cluster-name>"
    

    Once the cluster is ready, you can try to run some simple commands. banzai cluster shell executes a shell within the context of the selected cluster. If you type a command in the shell opened, or pass arguments to it, it will be executed in a prepared environment. For example, you can list the nodes of the cluster using the original kubectl command by running:

    banzai cluster shell --cluster-name "<cluster-name>" -- kubectl get nodes
    

    Once the cluster is running, you can Deploy workload on it.

Create a simple EKS cluster on AWS 🔗︎

The command below creates an EKS cluster with 3 worker nodes on AWS (the master is provided by the EKS service). For further examples and the description of the fields in the cluster descriptor, see Create cluster descriptor reference for EKS.

banzai cluster create <<EOF
{
  "name": "eks-cluster",
  "location": "us-west-2",
  "cloud": "amazon",
  "secretName": "eks-aws-secret",
  "properties": {
    "eks": {
      "version": "{{eks-version}}",
      "nodePools": {
        "pool1": {
          "spotPrice": "0",
          "count": 3,
          "minCount": 3,
          "maxCount": 4,
          "autoscaling": true,
          "instanceType": "t2.medium"
        }
      }
    }
  }
}
EOF

Further reading 🔗︎

For further examples and the description of the fields in the cluster descriptor, see Create cluster descriptor reference for EKS.